There is any way to deploy a heroku rails app after a travis-ci success build?
相关问题
- Question marks after images and js/css files in ra
- Using :remote => true with hover event
- Eager-loading association count with Arel (Rails 3
- How to specify memcache server to Rack::Session::M
- Is there a way to remove IDV Tags from an AIFF fil
相关文章
- Right way to deploy Rails + Puma + Postgres app to
- AWS S3 in rails - how to set the s3_signature_vers
- how to call a active record named scope with a str
- How to add a JSON column in MySQL with Rails 5 Mig
- Django/Heroku: FATAL: too many connections for rol
- Best way to manage docker containers with supervis
- “No explicit conversion of Symbol into String” for
- form_for wrong number of arguments in rails 4
I just implemented this case with an application of mine. It's actually not that hard to do, but it requires some steps:
.travis.yml
and get thetravis_deployer.rb
scripttravis encrypt your_username/your_repo HEROKU_API_KEY=<your key here>
.travis.yml
in the env -> global sectionThe
travis_deployer.rb
file takes care of the ssh keys and the remote branch for heroku.If you've performed all these steps you
.travis.yml
might look like this:Travis CI now has built-in support for deploying to Heroku: http://about.travis-ci.org/blog/2013-07-09-introducing-continuous-deployment-to-heroku/
Here is a version I found on Mark Bates' blog. It's similar to Odi's, just that it relies on the
after_script
in your.travis.yml
file alone.First of all, use Travis' feature to encrypt environment variables so your secret API keys remain protected:
Then append the following to your
.travis.yml
file:And you're done: commit your new changes and enjoy deploying to Heroku via TravisCI.
Edit: If you get any errors on
travis encrypt
, this might be your solution.I had just been thinking of this kind of scenario, though I didn't specifically consider Heroku as the platform of choise. Anyhow, this is what I have come-up with:
I'm sure you could implement a Heroku app that will handle the role of being the deployer host or something even more crazy.
Also, you may wish to try having Travis to notify you via IRC and have another IRC bot on your client side which will have access to you personal SSH key and make a push to Heroku, you could also implement a confirmation interface there by means of having a private conversation with your own bot or scripted GUI interface with a "Go ahead!" button. If you are not so old-school, you can use Hubot for that purpose.
By the way, you could also introduce some sort of staging branch or whatever you like in between some of the above steps. You probably should also use tags and the rollback would just pushing a know working tag into "release/production" from where it'll be picked up by your deployer script.