From 370df28d356eeda23711e6a169854af2b100b5e5 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Thu, 24 Jul 2008 17:10:55 +0200 Subject: [PATCH] jobs/: Use Girocco::Config for all configurable values --- jobs/Girocco | 1 + jobs/clone.sh | 22 +++++++++++----------- jobs/clonecheck.sh | 9 +++++---- jobs/shlib.sh | 9 +++++++-- jobs/update.sh | 2 +- jobs/updatecheck.sh | 4 ++-- 6 files changed, 27 insertions(+), 20 deletions(-) create mode 120000 jobs/Girocco diff --git a/jobs/Girocco b/jobs/Girocco new file mode 120000 index 0000000..c73296d --- /dev/null +++ b/jobs/Girocco @@ -0,0 +1 @@ +../Girocco/ \ No newline at end of file diff --git a/jobs/clone.sh b/jobs/clone.sh index 199ed1c..38975d5 100755 --- a/jobs/clone.sh +++ b/jobs/clone.sh @@ -9,9 +9,9 @@ queuedir="$(pwd)" bang_action="clone" bang_trap() { - # This removes any remnants from /srv/git/$proj.git _and_ gets rid + # This removes any remnants from "$cfg_reporoot"/$proj.git _and_ gets rid # of the group record. - perl -I/home/repo/repomgr/cgi -MGirocco::Project -e 'Girocco::Project->ghost('"'$proj'"')->delete;' + perl -I. -MGirocco::Project -e 'Girocco::Project->ghost('"'$proj'"')->delete;' cd "$queuedir" && rm -rf "$proj"/* && rmdir -p "$proj" } @@ -27,32 +27,32 @@ fi bang git clone "${ref[@]}" --bare "$url" repodir # Double-check that we aren't going to overwrite anything existing -! [ -d /srv/git/"$proj".git ] +! [ -d "$cfg_reporoot/$proj.git" ] # Set up fork container if necessary lproj="$(echo "$proj" | sed 's/^\(.*\/\)\(.*\)/\1/')" if [ z"$lproj" != z"$proj" ]; then - bang mkdir -m 0775 -p /srv/git/"$lproj" + bang mkdir -m 0775 -p "$cfg_reporoot/$lproj" fi # Move us into our new home -bang mv repodir /srv/git/"$proj".git +bang mv repodir "$cfg_reporoot/$proj.git" bang chmod g+w base_url owner description homepage README.html -bang mv base_url owner description homepage README.html /srv/git/"$proj".git/ +bang mv base_url owner description homepage README.html "$cfg_reporoot/$proj.git/" # Reconfigure -bang git --git-dir=/srv/git/"$proj".git config --bool --add mirror.allowed true -bang git --git-dir=/srv/git/"$proj".git update-server-info +bang git --git-dir="$cfg_reporoot/$proj.git" config --bool --add mirror.allowed true +bang git --git-dir="$cfg_reporoot/$proj.git" update-server-info # Clean up the queue cd "$queuedir" && rm -rf "$proj"/* && rmdir -p "$proj" # NO bang BELOW THIS POINT! rm -r depends on cwd. -mail -s "[repo.or.cz] $proj clone completed" "$mail",pasky@ucw.cz <.last_refresh if [ -e .banged ]; then - echo "$proj update succeeded - failure recovery" | mail -s "[repo.or.cz] $proj update succeeded" "$mail",pasky@ucw.cz + echo "$proj update succeeded - failure recovery" | mail -s "[$cfg_name] $proj update succeeded" "$mail,$cfg_admin" rm .banged fi diff --git a/jobs/updatecheck.sh b/jobs/updatecheck.sh index d27f850..a8dcb31 100755 --- a/jobs/updatecheck.sh +++ b/jobs/updatecheck.sh @@ -12,7 +12,7 @@ touch /tmp/gitupdatelock # That prevents objects from missing, since repack -l will automagically # put the now-going-away objects into the forked repository's object store. -cd /srv/git +cd "$cfg_reporoot" get_repo_list_here | tac | while read dir; do # echo "+ `date` $dir" @@ -20,7 +20,7 @@ get_repo_list_here | tac | (cd "$dir/objects" && [ "$(ls ?? 2>/dev/null)" ] && git --git-dir=.. repack -a -l -d -q) git --git-dir="$dir" update-server-info else - /home/repo/repomgr/update.sh "${dir%.git}" + "$cfg_basedir"/update.sh "${dir%.git}" fi # echo "- `date` $dir" done 2>&1 | grep -v '^Pack.*created\.$' -- 2.11.4.GIT