Avoid join(':',%$self) warnings
[girocco.git] / jobs / updateweb.sh
blob3b4cb50c7c7dbfc2596d241cdc1b949ec30d1dcc
1 #!/bin/bash
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
12 # Make sure we don't run twice.
13 if [ -s ${LOCK_FILE} ] && kill -0 $(cat ${LOCK_FILE}); then
14 echo "Already running (stuck?) with pid $(cat ${LOCK_FILE})" >&2
15 exit 1
17 echo $$ >${LOCK_FILE}
19 pushd ${REPO_DIR} > /dev/null
20 git fetch origin
21 if [ "`git rev-list $BRANCH..$REMOTE/$BRANCH`" ]; then
22 git merge --ff-only $REMOTE/$BRANCH &&
23 git submodule update &&
24 make --quiet &&
25 make install
27 popd > /dev/null
29 rm ${LOCK_FILE}