aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-08-27 18:14:59 +0300
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-08-30 15:06:19 +0300
commit17dd327b1adea02a2db7031ca82413406ad30402 (patch)
tree67e103a37b7499edc7010fc809a7844bd579aaf0
parent593088856036055b9ccf885407fbff6bd823a833 (diff)
bootstrap: Support hooks
Initial support for per-branch hooks. Currently only post-build hook is supported. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rwxr-xr-xbootstrap.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/bootstrap.py b/bootstrap.py
index a35ddf6..1061f59 100755
--- a/bootstrap.py
+++ b/bootstrap.py
@@ -82,6 +82,11 @@ def build_test_pkg(pkg_name, branch, outdir):
tag_pattern = 'srcdata/%s/%s/release/*' % (pkg_name, branch)
git_cmd('checkout', ['srcdata/%s/%s' % (pkg_name, branch)])
+ # Check for hooks
+ hooks = {}
+ if os.path.exists('.bootstrap_hooks.py'):
+ LOG.info('Loading bootstrap hooks')
+ execfile('.bootstrap_hooks.py', hooks, hooks)
tags = git_cmd('tag', ['-l', tag_pattern], True)
for ind, tag in enumerate(tags):
builddir = tempfile.mkdtemp(dir='.',
@@ -95,6 +100,12 @@ def build_test_pkg(pkg_name, branch, outdir):
raise Exception('Building %s / %s failed! Builddata can be found '
'in %s' % (pkg_name, tag, builddir))
+ # Run postbuild_all hook
+ if 'postbuild' in hooks:
+ LOG.info('Running postbuild_all() hook for %s / %s' %
+ (pkg_name, tag))
+ hooks['postbuild'](builddir, tag, LOG)
+
# Create subdirs
orig_dir = '%s/%s' % (outdir, 'orig')
if not os.path.isdir(orig_dir):