Created
April 11, 2014 14:35
-
-
Save danieljohnmorris/10473930 to your computer and use it in GitHub Desktop.
Rails deploy scripts
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
# This goes in user root dir, ie ~ | |
# So you can just call | |
alias deploy=./deploy.sh | |
alias deploy_ci=./deploy_ci.sh | |
alias deploy_live=./deploy_live.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/bash | |
# clear the screen (can still scroll up) | |
clear | |
# call deploy scripts in order | |
./deploy_ci.sh | |
./deploy_live.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/bash | |
# clear the screen (can still scroll up) | |
clear | |
# test ci tests locally first | |
cucumber --tags @ci | |
# merge development branch into master | |
git checkout master | |
git merge develop | |
git checkout develop | |
# push to heroku staging git remote | |
#git push sofar-staging master | |
# check no database migrations need to run | |
# heroku run rake db:migrate -a sofar-staging | |
# Instead of pushing to staging directly, push to CI environment, which then pushes code to staging and imports db backup from live | |
git push github master |
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 | |
# clear the screen (can still scroll up) | |
clear | |
# show "check back in a few minutes" message | |
heroku maintenance:on -a HEROKU_APP_NAME | |
# push to heroku staging git remote | |
git push HEROKU_APP_NAME master | |
# run any db migrations on live | |
heroku run rake db:migrate -a HEROKU_APP_NAME | |
# allow visitors again | |
heroku maintenance:off -a HEROKU_APP_NAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment