Last active
October 31, 2016 23:28
-
-
Save brenolf/d7ccd8285a8e5b1cc70da456cb4c4874 to your computer and use it in GitHub Desktop.
Revisions
-
brenolf revised this gist
Aug 29, 2016 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,20 +2,20 @@ PROJECT=name; if [[ "$1" == "staging" || "$1" == "production" ]]; then TARGET=`echo "$1" | tr '[:lower:]' '[:upper:]'`; read -p "Do you really wish to deploy to $TARGET? [yn] " yn; if [[ "$yn" != "y" ]]; then exit 0; fi else echo "You must supply a parameter: 'staging' or 'production'"; exit 1; fi if [[ "$1" == "staging" ]]; then BRANCH=staging; else BRANCH=production; @@ -51,6 +51,6 @@ git checkout -f @{-2}; git branch -D $TMP; git stash pop; bower install --force; exit 0; -
brenolf created this gist
Aug 25, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,56 @@ #!/bin/bash PROJECT=name; if [[ $1 == "staging" || $1 == "production" ]]; then TARGET=`echo $1 | tr '[:lower:]' '[:upper:]'`; read -p "Do you really wish to deploy to $TARGET? [yn] " yn if [[ $yn != "y" ]]; then exit 0; fi else echo "You must supply a parameter: 'staging' or 'production'"; exit 1; fi if [[ $1 == "staging" ]]; then BRANCH=staging; else BRANCH=production; fi TMP=tmp-deploy-branch-`date +%s`; rm -rf dist bower_components; bower install; NODE_ENV=$BRANCH gulp; git stash save -u; git checkout master; git pull; git checkout -b $TMP; sed -i -e 's/dist\///;s/bower_components//' .gitignore; heroku git:remote -a $PROJECT-$BRANCH; git add -A; git commit -m "`date`"; heroku maintenance:on --app $PROJECT-$BRANCH; git push -f git@heroku.com:$PROJECT-$BRANCH.git $TMP:master; heroku run --app $PROJECT-$BRANCH -- npm run migrate; heroku maintenance:off --app $PROJECT-$BRANCH; git checkout -f @{-2}; git branch -D $TMP; git stash pop; bower install; exit 0;