Created
September 14, 2013 10:27
-
-
Save hendrikbeck/6560856 to your computer and use it in GitHub Desktop.
Rails configuration to test and deploy to Heroku via CircleCI
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 characters
database: | |
override: | |
- mkdir -p config | |
- | | |
echo 'test: | |
host: localhost | |
username: ubuntu | |
database: circle_ruby_test | |
adapter: postgresql | |
' > config/database.yml | |
- bundle exec rake db:create db:migrate --trace | |
deployment: | |
production: | |
branch: production | |
commands: | |
- heroku pgbackups:capture --expire --app [HEROKU_APP_NAME] | |
- heroku maintenance:on --app [HEROKU_APP_NAME] | |
- heroku scale worker=0 --app [HEROKU_APP_NAME] | |
- git push [email protected]:squar.git $CIRCLE_SHA1:refs/heads/master | |
- heroku run rake db:migrate --app [HEROKU_APP_NAME] | |
- heroku scale worker=1 --app [HEROKU_APP_NAME] | |
- heroku restart --app [HEROKU_APP_NAME] | |
- heroku maintenance:off --app [HEROKU_APP_NAME] | |
- curl -H "x-api-key:[NEW_RELIC_API_KEY]" -d "deployment[application_id]=[NEW_RELIC_APP_ID]" -d "deployment[description]=Deployment via CircleCI'" -d "deployment[revision]=$CIRCLE_BUILD_NUM" -d "deployment[changelog]=$CIRCLE_SHA1" -d "deployment[user]=CircleCI" https://rpm.newrelic.com/deployments.xml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment