git-post-receive 379 B

1234567891011121314151617181920
  1. #!/bin/bash
  2. #hook/post-receive
  3. #CONFIG
  4. PRODDIR="www"
  5. read oldrev newrev refname
  6. if [ $refname = "refs/heads/prod" ]; then
  7. echo "===== DEPLOYING APP ====="
  8. unset GIT_DIR
  9. cd ~
  10. cd $PRODDIR
  11. # git pull --ff-only origin prod
  12. # run deploy script instead
  13. . deploy.sh
  14. echo $?
  15. echo "====== OK ====="
  16. else
  17. echo "Warning Commit not deployed, please use prod branch"
  18. fi