summaryrefslogtreecommitdiff
path: root/git-hooks/auto-deploy
blob: 02a22e7332b18a183f6e76e2145b4b6ceb84a5e2 (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"

alias git="git --git-dir '${1}/.git' --work-tree '${1}'"

# pull this repo on the current branch
git pull origin $(git rev-parse --abbrev-ref HEAD)

exit $?