Created
April 30, 2015 07:26
-
-
Save mosluce/6aa3155e41b5c06c5e48 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 | |
if [ $# -eq 0 ] ; then | |
echo "input app name, plz" | |
exit 0 | |
fi | |
#echo $1 | |
home="/home/mosluce" | |
app="$home/apps/$1" | |
repo="$home/repos/$1.git" | |
hook="$repo/hooks/post-receive" | |
if [ -d $app ]; then | |
echo "exists" | |
exit 0; | |
fi | |
mkdir -p $app | |
mkdir -p $repo | |
cd $repo | |
git init --bare | |
git config core.bare false | |
git config core.worktree $app | |
git config receive.denyCurrentBranch ignore | |
echo -e "#!/bin/bash \ngit checkout -f \ndocker exec $1 /launch" > $hook | |
chmod +x $hook | |
docker run -t -i -d --expose 8081 -P -v "/home/mosluce/apps/$1":/app --name="$1" mosluce/node |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment