delproj: update code to handle more than one auth type
[girocco.git] / jobs / updateweb.sh
blob9c4500e42b2998730bdefd3270a9e00a289d8df2
1 #!/bin/sh
3 . @basedir@/shlib.sh
5 set -e
7 REPO_DIR=/home/repo/repo
8 LOCK_FILE=/tmp/updateweb-$cfg_tmpsuffix.lock
9 REMOTE=origin
10 BRANCH=rorcz
11 # MAKE must be set to GNU make
12 MAKE=make
14 # Make sure we don't run twice.
15 if [ -s ${LOCK_FILE} ] && kill -0 $(cat ${LOCK_FILE}) 2>/dev/null; then
16 echo "Already running updateweb.sh (stuck?) with pid $(cat ${LOCK_FILE})" >&2
17 exit 1
19 echo $$ >${LOCK_FILE}
21 cd "${REPO_DIR}"
22 git fetch origin
23 if [ -n "`git rev-list $BRANCH..$REMOTE/$BRANCH`" ]; then
24 git merge --ff-only $REMOTE/$BRANCH && \
25 git submodule update && \
26 "$MAKE" --quiet && \
27 "$MAKE" install
30 rm ${LOCK_FILE}