auto-deploy 303 B

1234567891011121314151617
  1. #!/bin/bash
  2. # auto-deploy
  3. # Usage: auto-deploy /srv/http/repo
  4. # fail on any error
  5. set -e
  6. # Can we write on the clone?
  7. test -w "${1}/.git/HEAD"
  8. alias git="git --git-dir '${1}/.git' --work-tree '${1}'"
  9. # pull this repo on the current branch
  10. git pull origin $(git rev-parse --abbrev-ref HEAD)
  11. exit $?