Store last_*, owner, base_url and homepage in git config
[girocco/radio.git] / daemons / update.sh
blobf939f1f6ad8ffb4a5419b53514c02f72071ec822
1 #!/bin/bash
3 . @basedir@/shlib.sh
5 set -e
7 proj="$1"
8 cd "$cfg_reporoot/$proj.git"
10 progress "+ `date` update: $proj"
12 bang_setup
13 bang_once=1
14 bang_action="update"
16 url="$(config_get base_url)"
17 mail="$(config_get owner)"
19 case "$url" in
20 svn://*)
21 GIT_DIR=. bang git svn fetch
22 GIT_DIR=. bang git fetch
25 bang git remote update
26 bang git remote prune origin
28 esac
30 bang git update-server-info
31 bang config_set last_refresh "$(date -R)"
33 if [ -e .banged ]; then
34 echo "$proj update succeeded - failure recovery" | mail -s "[$cfg_name] $proj update succeeded" "$mail,$cfg_admin"
35 rm .banged
38 progress "- `date` update: $proj"