Author: tchemit Date: 2014-05-29 22:32:48 +0200 (Thu, 29 May 2014) New Revision: 77 Url: http://forge.codelutin.com/projects/adminsys/repository/revisions/77 Log: refs #5074 add script to synch ro repository + improve chaneg authors script Added: scripts/git-tools/git-create-or-fetch-ro-repository.sh Modified: scripts/git-tools/git-change-authors.sh Modified: scripts/git-tools/git-change-authors.sh =================================================================== --- scripts/git-tools/git-change-authors.sh 2014-05-26 09:57:14 UTC (rev 76) +++ scripts/git-tools/git-change-authors.sh 2014-05-29 20:32:48 UTC (rev 77) @@ -68,7 +68,7 @@ cat << EOF >> $script git commit-tree "\$@"; -' HEAD +' -- --all rm -rf refs/original EOF Added: scripts/git-tools/git-create-or-fetch-ro-repository.sh =================================================================== --- scripts/git-tools/git-create-or-fetch-ro-repository.sh (rev 0) +++ scripts/git-tools/git-create-or-fetch-ro-repository.sh 2014-05-29 20:32:48 UTC (rev 77) @@ -0,0 +1,46 @@ +#!/bin/sh +# +# Script pour creer ou mettre a jour un depot RO +# +############################################################################### +# To create o update a read-only git repository +# Usage git-create-or-fetch-ro-repository DOMAIN PROJECT_NAME +# +# Author : Tony CHEMIT <chemit@codelutin.com> +# +############################################################################### +# History +# +# 2014-05-25 tchemit@codelutin.com +# - initial version +############################################################################### + +if [ ! $# -eq 2 ]; then + echo "usage : $0 domain projectName" + exit 0 +fi + +DOMAIN="$1" +PROJECT_NAME="$2" + +RW_REPOSITORY=/var/lib/git/git-"$DOMAIN"/"$PROJECT_NAME".git +RO_REPOSITORY=/var/lib/git/git-ro-"$DOMAIN"/"$PROJECT_NAME".git + +if [ -d "$RO_REPOSITORY" ]; then + + echo "Synchronize read-only repository" + chmod -R u+w $RO_REPOSITORY + git fetch -q $RO_REPOSITORY + sleep 2 + chmod -R u-w $RO_REPOSITORY + +else + + echo "Create read-only repository" + git clone -q --bare --mirror "$RW_REPOSITORY" "$RO_REPOSITORY" + sleep 5 + cp "$RO_REPOSITORY"/hooks/post-update.sample "$RO_REPOSITORY"/hooks/post-update + chmod -R a-w $RO_REPOSITORY + chown -R www-data. $RO_REPOSITORY + +fi \ No newline at end of file Property changes on: scripts/git-tools/git-create-or-fetch-ro-repository.sh ___________________________________________________________________ Added: svn:executable + *
participants (1)
-
tchemit@users.forge.codelutin.com