/[adm]/puppet/modules/gitmirror/templates/rsync-metadata.sh
ViewVC logotype

Contents of /puppet/modules/gitmirror/templates/rsync-metadata.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3407 - (show annotations) (download) (as text)
Sun Feb 9 13:55:50 2014 UTC (10 years, 2 months ago) by colin
File MIME type: text/x-sh
File size: 1084 byte(s)
Add a new system to ensure our git repos are mirrored properly.

This is a simple python daemon that I wrote which can be 'pinged' and told
to update (or freshly clone) given git repos.

Deploy this script on alamut (not started automatically yet)
1 #!/bin/bash
2
3 REPO="$1"
4 GITROOT="/git"
5 RSYNCROOT="rsync://valstar.mageia.org/git"
6
7 if [ ! -d "$GITROOT/$REPO" ]; then
8 echo "No repository found $REPO" >&2
9 exit 1
10 fi
11
12 cp -af "$GITROOT/$REPO/config" "$GITROOT/$REPO/config.orig"
13 /usr/bin/rsync -a --delete --include="description" --include="config" --include="info" --include="info/web" --include="info/web/last-modified" --exclude="*" "$RSYNCROOT/$REPO/" "$GITROOT/$REPO/"
14 cp -af "$GITROOT/$REPO/config" "$GITROOT/$REPO/config.upstream"
15 mv -f "$GITROOT/$REPO/config.orig" "$GITROOT/$REPO/config"
16
17 OWNER=$(git config --file "$GITROOT/$REPO/config.upstream" gitweb.owner)
18 DESC=$(git config --file "$GITROOT/$REPO/config.upstream" gitweb.description)
19 rm -f "$GITROOT/$REPO/config.upstream"
20
21 CUROWNER=$(git config --file "$GITROOT/$REPO/config" gitweb.owner)
22 if [ "$CUROWNER" != "$OWNER" ]; then
23 git config --file "$GITROOT/$REPO/config" gitweb.owner "$OWNER"
24 fi
25
26 CURDESC=$(git config --file "$GITROOT/$REPO/config" gitweb.description)
27 if [ "$CURDESC" != "$DESC" ]; then
28 git config --file "$GITROOT/$REPO/config" gitweb.owner "$DESC"
29 fi

Properties

Name Value
svn:eol-style native
svn:executable *
svn:mime-type text/x-sh

  ViewVC Help
Powered by ViewVC 1.1.30