Massively simplify cloning process further
[girocco.git] / mirroring / clone.sh
blob30392e802e75d198677b511a84e46f965d03f324
1 #!/bin/bash
3 . @basedir@/shlib.sh
5 set -e
7 projdir="$1"
8 proj="${projdir%.git}"
10 bang_setup
11 bang_action="clone"
12 bang_trap() {
13 # This removes our stage directory _and_ gets rid of the group record.
14 perl -I@basedir@ -MGirocco::Project -e 'Girocco::Project->load('"'$proj'"')->delete;'
17 cd "$cfg_reporoot/$projdir"
18 url="$(cat base_url)"
19 mail="$(cat owner)"
21 # Configure
22 bang git config --bool --add mirror.allowed true
23 bang git remote add origin "$url" # superfluous?
25 # Initial mirror
26 bang git mirror "$url"
27 bang git update-server-info
29 mail -s "[$cfg_name] $proj clone completed" "$mail,$cfg_admin" <<EOT
30 Congratulations! The clone of project $proj just completed.
32 * GitWeb interface: $cfg_gitweburl/$projdir
33 * Project settings: $cfg_webadmurl/editproj.cgi?name=$proj
35 Have a lot of fun.
36 EOT