summaryrefslogtreecommitdiff
path: root/git-hooks/auto-deploy
blob: 04807565e005c21a6c39f79aca4dc3cde592c64d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
# auto-deploy
# Usage: auto-deploy /srv/http/repo

# fail on any error
set -e

# Can we write on the clone?
test -w "${1}/.git/HEAD"

# pull this repo 
git --git-dir "${1}/.git" \
    --work-tree "${1}" \
    pull origin master

exit $?