Created
February 13, 2014 01:16
-
-
Save kaezarrex/8967917 to your computer and use it in GitHub Desktop.
post-receive deploy hook
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 | |
build="build-branch" | |
build_dir="/build/path" | |
while read oldrev newrev refname | |
do | |
branch=$(git rev-parse --symbolic --abbrev-ref $refname) | |
if [ "$build" == "$branch" ]; then | |
GIT_WORK_TREE=$build_dir git checkout -f $build | |
cd $build_dir | |
# run build command(s) here | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment