Skip to content

Instantly share code, notes, and snippets.

@riverleo
Last active August 29, 2015 14:22
Show Gist options
  • Save riverleo/6c052408c77417643163 to your computer and use it in GitHub Desktop.
Save riverleo/6c052408c77417643163 to your computer and use it in GitHub Desktop.
deploy.sh
#!bin/sh
REPOSITORY="riverleo/riverleo.github.io"
MESSAGE=`date +%y%m%d:%H`
count=0
params=("$@")
for param in ${params[@]}; do
if [[ $param == "-m" ]]
then MESSAGE=${params[count+1]}
fi
if [[ $param == "-r" ]]
then REPOSITORY=${params[count+1]}
fi
((count++))
done
ember build -prod # build ember app and make dist foder
if [ ! -d "dist" ]
then
echo "dist directory make not right."
return
fi
cd dist
git init
git remote add origin git@github.com:$REPOSITORY.git
git add --all
git commit -m "$MESSAGE"
git push --force origin master
echo "success deploy to $REPOSITORY, $MESSAGE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment