diff options
Diffstat (limited to 'tools/conf/srv/gitolite/hook-deployweb')
-rwxr-xr-x | tools/conf/srv/gitolite/hook-deployweb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/conf/srv/gitolite/hook-deployweb b/tools/conf/srv/gitolite/hook-deployweb new file mode 100755 index 0000000..a311c00 --- /dev/null +++ b/tools/conf/srv/gitolite/hook-deployweb @@ -0,0 +1,23 @@ +#!/bin/bash + +###################################################################### +# +# Put this file in your gitolite-admin; +# ~/gitolite-admin/local/hooks/repo-specific/hook-deployweb +# +while read oldrev newrev refname +do + BRANCH=$(git rev-parse --symbolic --abbrev-ref $refname) + echo "Commit was for branch $BRANCH" + + if [[ "$BRANCH" == "master" ]];then + + # Get project name from current directory (without .git) + PROJECT=$(basename "$PWD") + PROJECT=${PROJECT%.git} + + echo "Project $PROJECT added to deploy list." + echo $PWD > /srv/gitolite/deploy/$PROJECT + fi + +done |