sbuild(package, ref, 'i386', workdir)
-def tagSubmodule(pocket, package, principal, version, env):
+def tagSubmodule(pocket, package, commit, principal, version, env):
"""Tag a new version of a submodule.
If this pocket does not allow_backtracking, then this will create
c.captureOutput(
['git', 'tag', '-m', tag_msg, commit],
- stdout=None,
- env=env)
+ env=env,
+ cwd=b.getRepo(package))
-def updateSubmoduleBranch(pocket, package, ref):
+def updateSubmoduleBranch(pocket, package, commit):
"""Update the appropriately named branch in the submodule."""
branch = b.pocketToGit(pocket)
c.captureOutput(
- ['git', 'update-ref', 'refs/heads/%s' % branch, ref], cwd=b.getRepo(package))
+ ['git', 'update-ref', 'refs/heads/%s' % branch, commit], cwd=b.getRepo(package))
def uploadBuild(pocket, workdir):
finally:
shutil.rmtree(workdir)
-
-def reportBuild(build):
- """Run hooks to report the results of a build attempt."""
-
- c.captureOutput(['run-parts',
- '--arg=%s' % build.build_id,
- '--',
- b._HOOKS_DIR])
-
-
def build():
"""Deal with items in the build queue.
try:
db.failed_stage = 'validating job'
- src = b.validateBuild(pocket, package, commit)
# Don't expand the commit in the DB until we're sure the user
# isn't trying to be tricky.
- db.commit = commit = c.captureOutput(['git', 'rev-parse', commit],
- cwd=b.getRepo(package)).strip()
+ b.ensureValidPackage(package)
+ db.commit = commit = b.canonicalize_commit(package, commit)
+ src = b.validateBuild(pocket, package, commit)
db.version = str(b.getVersion(package, commit))
+ b.runHook('pre-build', [str(db.build_id), db.pocket, db.package,
+ db.commit, db.principal, db.version, str(db.inserted_at)])
# If validateBuild returns something other than True, then
# it means we should copy from that pocket to our pocket.
# build queue item
os.unlink(os.path.join(b._QUEUE_DIR, build))
- reportBuild(db)
-
+ if db.succeeded:
+ b.runHook('post-build', [str(db.build_id)])
+ else:
+ b.runHook('failed-build', [str(db.build_id)])
class Invirtibuilder(pyinotify.ProcessEvent):
"""Process inotify triggers to build new packages."""