X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=scripts%2Fgit-mirror.sh;h=3f05125dfb8410fc4e0ba803ef78e58b953b08c2;hb=0f9d55936cdd62bb3b3d338ad3373a7de3b2b6a6;hp=6a06913718f2cab0d04218b06920f0d43785297d;hpb=14d011a3940ad12048e01138ba50cf8d59815e38;p=infrastructure.git diff --git a/scripts/git-mirror.sh b/scripts/git-mirror.sh index 6a06913..3f05125 100755 --- a/scripts/git-mirror.sh +++ b/scripts/git-mirror.sh @@ -202,40 +202,10 @@ function mirror_repo () { touch ${REPO_DIR}/MIRRORED.stamp } -#################### -# hook to simpler, pull-only repos -# e.g. /git-slave/tophat.git on onelab.eu -# the idea here is, we need to keep a local read-only mirror -# of some repositories -# instead of hacking this script that is already scary, I preferred to write -# a separate script git-update.sh that runs a bit like auto-update.sh -# and that additionally takes care of remote branches -# the layout is as follows -# * manually created the local mirror by running -# cd /git-slave -# git clone ssh://tophat@git.top-hat.info/tophat.git -# which creates a non-bare repo right under /git-slave -# * create a symlink for git-daemon -# cd /git -# ln -s /git-slave/tophat/.git tophat.git -# * enable updates by just dropping a symlink there -# cd /git-slave/tophat -# ln -s /root/infrastructure/scripts/git-udate.sh - -function slave_repo () { - git_slave=$1; shift - cd $git_slave - for subdir in *; do - [ -x $subdir/git-update.sh ] && $subdir/git-update.sh - done -} - function usage () { echo "Usage $COMMAND [options] REPONAME*" echo " [-a admin-mails] : provide space-separated admins emails" echo " [-r remote-git-url] : e.g. -r git://git.onelab.eu/" - echo " [-s slave-area] : git-update.sh in all subdirs of slave-area that have one" - echo " typically /git-slave on the onelab side for e.g. tophat" echo " [-q] quiet mode for running under cron" echo " [-v] verbose mode" echo " [-f] force mode, runs even if the lock file is present" @@ -243,14 +213,10 @@ function usage () { exit 1 } -# set this as a default - won't harm anyone -SLAVE_GITDIR=/git-slave - while getopts "a:r:s:qvfh" opt; do case $opt in a) ADMINS=$OPTARG ;; r) REMOTE_GIT=$OPTARG ;; - s) SLAVE_GITDIR=$OPTARG ;; q) QUIET=true ;; v) VERBOSE=true ;; f) FORCE=true ;; @@ -284,5 +250,4 @@ trap failure INT # if force is set we leave the lock file as is [ -z "$FORCE" ] && date > $LOCKFILE for gitrepo in "$@"; do mirror_repo $gitrepo ; done -if [ -d "$SLAVE_GITDIR" ] ; then slave_repo $SLAVE_GITDIR ; fi [ -z "$FORCE" ] && rm -f $LOCKFILE