Created
December 11, 2015 00:11
-
-
Save milki/ce67af16eb284662fe1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# gitolite mirror push <slave> <repo> | |
CMD=$1 | |
SLAVE=$2 | |
REPO=$3 | |
script="$(gitolite query-rc GL_BINDIR)"/commands/mirror | |
GL_REPO_BASE="$(gitolite query-rc GL_REPO_BASE)" | |
lockfile="$GL_REPO_BASE/$REPO.git/$SLAVE" | |
if [ "$CMD" = 'push' ] | |
then | |
[ "${FLOCKER}" != "$SLAVE" ] && exec env FLOCKER="$SLAVE" flock -en "$lockfile" "$0" "$@" || : | |
fi | |
$script $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment