Created
May 22, 2013 15:52
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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