diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-11-14 10:45:27 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-11-14 10:45:27 -0200 |
commit | 1148ec488e42984a32a3221662171ebc35c3edf9 (patch) | |
tree | 9501d79cb8af14420125bb6cd165fa8827942583 /share/templater/pushtodeploy | |
parent | a8e73f80974038516054a042ed1b811c781c9db8 (diff) | |
download | templater-1148ec488e42984a32a3221662171ebc35c3edf9.tar.gz templater-1148ec488e42984a32a3221662171ebc35c3edf9.tar.bz2 |
Post receive hook accepting Makefile deploy target
Diffstat (limited to 'share/templater/pushtodeploy')
-rwxr-xr-x | share/templater/pushtodeploy/files/post-receive | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/share/templater/pushtodeploy/files/post-receive b/share/templater/pushtodeploy/files/post-receive index 627198d..3e706e9 100755 --- a/share/templater/pushtodeploy/files/post-receive +++ b/share/templater/pushtodeploy/files/post-receive @@ -3,19 +3,25 @@ # Post-receive git hook # +# Go to repository base cd .. unset GIT_DIR -if [ -d ".git/annex" ]; then - git annex sync +# Check for a Makefile deploy target or run standard deployment +if [ -e "Makefile" ] && grep -q "^deploy:" Makefile; then + make deploy else - git config receive.denyCurrentBranch ignore - #git reset HEAD - git checkout -f -fi + if [ -d ".git/annex" ]; then + git annex sync + else + git config receive.denyCurrentBranch ignore + #git reset HEAD + git checkout -f + fi -git submodule sync --recursive -git submodule update --init --recursive + git submodule sync --recursive + git submodule update --init --recursive -cd - -exec git update-server-info + cd - + exec git update-server-info +fi |