Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
post-receive deploy hook
#!/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
You can’t perform that action at this time.