git-post-reveive 332 B

123456789101112131415161718
  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. echo $?
  13. echo "====== OK ====="
  14. else
  15. echo "Warning Commit not deployed, please use prod branch"
  16. fi