Created
October 2, 2011 02:11
-
-
Save ichikaway/1256946 to your computer and use it in GitHub Desktop.
git pull manager
This file contains hidden or 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/sh | |
CMDPATH=/usr/local/git/bin/ | |
CMD=git | |
test -f $CMDPATH$CMD || exit 0 | |
REPO_hoge_app="/usr/local/deploy/git/hoge" | |
REPO_hoge_app2="/usr/local/deploy/git/hoge2" | |
hoge_app() | |
{ | |
echo "------- git pull app start-----------"; | |
cd $REPO_hoge_app | |
pwd | |
$CMDPATH$CMD pull | |
echo "------- git pull app end ------------"; | |
echo ""; | |
} | |
hoge_app2() | |
{ | |
echo "------- git pull app2 start-----------"; | |
cd $REPO_hoge_app2 | |
pwd | |
$CMDPATH$CMD pull | |
echo "------- git pull app2 end ------------"; | |
echo ""; | |
} | |
case $1 in | |
all) | |
echo " ############ git pull All repository start ######### "; | |
echo "" | |
hoge_app | |
hoge_app2 | |
echo " ############ git pull All repository end ######### "; | |
;; | |
app) | |
hoge_app | |
exit | |
;; | |
app2) | |
hoge_app2 | |
exit | |
;; | |
*) | |
echo "Usage: git-pull.sh { all | app | app2 }" | |
echo "" | |
exit | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment