Changeset 3036
- Timestamp:
- Jul 6, 2010, 12:27:50 AM (14 years ago)
- Location:
- trunk/packages/invirt-dev
- Files:
-
- 6 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/invirt-dev/debian/invirt-dev.dirs
r2627 r3036 1 1 var/lib/invirt-dev/queue 2 2 var/log/invirt/builds 3 usr/share/invirt-dev/build .d3 usr/share/invirt-dev/build-hooks -
trunk/packages/invirt-dev/debian/invirt-dev.install
r2555 r3036 1 1 reprepro-env usr/bin 2 2 repository-config/* srv/repository/conf 3 build-hooks usr/share/invirt-dev -
trunk/packages/invirt-dev/invirt-submit-build
r3035 r3036 47 47 b.validateBuild(pocket, package, commit) 48 48 except b.InvalidBuild, e: 49 print >>sys.stderr, "E: %s" % e 49 msg = "E: %s" % e 50 print >>sys.stderr, msg 51 # Prevent an attack by submitting excessively long arguments 52 args = [arg[:min(len(arg), 80)] for arg in (pocket, package, commit)] 53 b.runHook('failed-submit', args + [principal], stdin_str=msg) 50 54 sys.exit(1) 51 55 … … 58 62 q.close() 59 63 os.rename(q_name, q_path) 64 short_commit = b.canonicalize_commit(package, commit, shorten=True) 65 b.runHook('post-submit', [pocket, package, short_commit, principal]) 66 print '%s, your job to build %s for %s:%s has been submitted!' % (principal, short_commit, package, pocket) 60 67 61 68 -
trunk/packages/invirt-dev/invirtibuilder
r3035 r3036 250 250 shutil.rmtree(workdir) 251 251 252 253 def reportBuild(build):254 """Run hooks to report the results of a build attempt."""255 256 c.captureOutput(['run-parts',257 '--arg=%s' % build.build_id,258 '--',259 b._HOOKS_DIR])260 261 262 252 def build(): 263 253 """Deal with items in the build queue. … … 296 286 297 287 db.version = str(b.getVersion(package, commit)) 288 b.runHook('pre-build', [str(db.build_id), db.pocket, db.package, 289 db.commit, db.principal, db.version, str(db.inserted_at)]) 298 290 299 291 # If validateBuild returns something other than True, then … … 367 359 os.unlink(os.path.join(b._QUEUE_DIR, build)) 368 360 369 reportBuild(db) 370 361 if db.succeeded: 362 b.runHook('post-build', [str(db.build_id)]) 363 else: 364 b.runHook('failed-build', [str(db.build_id)]) 371 365 372 366 class Invirtibuilder(pyinotify.ProcessEvent): -
trunk/packages/invirt-dev/python/invirt/builder.py
r3035 r3036 18 18 _REPO_DIR = '/srv/git' 19 19 _LOG_DIR = '/var/log/invirt/builds' 20 _HOOKS_DIR = '/usr/share/invirt-dev/build .d'20 _HOOKS_DIR = '/usr/share/invirt-dev/build-hooks' 21 21 22 22 … … 75 75 return changelog.Changelog(getGitFile(package, ref, 'debian/changelog')) 76 76 77 def runHook(hook, args=[], stdin_str=None): 78 """Run a named hook.""" 79 hook = os.path.join(_HOOKS_DIR, hook) 80 try: 81 c.captureOutput([hook] + args, stdin_str=stdin_str) 82 except OSError: 83 pass 77 84 78 85 def getVersion(package, ref):
Note: See TracChangeset
for help on using the changeset viewer.