Last active
August 29, 2015 14:22
-
-
Save riverleo/6c052408c77417643163 to your computer and use it in GitHub Desktop.
deploy.sh
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/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