Skip to content

Instantly share code, notes, and snippets.

@hithwen
Created May 22, 2013 15:52
Show Gist options
  • Save hithwen/5628666 to your computer and use it in GitHub Desktop.
Save hithwen/5628666 to your computer and use it in GitHub Desktop.
Post-receive hook to launch buildbot for master, develop and release/* branches This file has to be placed in remote repo hooks folder You could just call git_buildbot.py $1 $2 $3 but then you'll see every commit in buildbot timeline
from buildbot.changes import pb
c['change_source'] = pb.PBChangeSource()
for branch, builder in {'master':'release-builder', 'develop':'develop-builder'}.iteritems():
c['schedulers'].append(SingleBranchScheduler(
name="Continuous-%s" % branch,
branch=branch,
treeStableTimer=1*60,
builderNames=[builder]))
c['schedulers'].append(SingleBranchScheduler(
name='Release',
change_filter=ChangeFilter(branch_re='^release/.*$'),
builderNames=['release-builder']))
#!/bin/bash
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ "master" == "$branch" ] || [ "develop" == "$branch" ] || [[ $branch == release* ]]; then
echo $oldrev $newrev $refname | /path/to/git_buildbot.py
echo "Launching buildbot for rev" $newrev "in branch" $refname;
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment