Dan L
Dan L

Reputation: 4439

Professional rails 3.2+ deployment to Heroku

I'm trying to establish a professional deployment methodology to Heroku and by that I mean:

Since capistrano is a no-go with Heroku, my thoughts are that the next-best thing is writing a ruby script that handles all my automated deployment for me. I've seen people using rake tasks for this, as per https://gist.github.com/362873, but I didn't think rake was really made for this type of functionality. Would a pure ruby script be a preferred alternative to a rake task?

It's pretty simple to deploy to heroku, but to make it professional (ie, users don't get error pages) I need it to be automated to compensate for human errors. And it gets a little old to have to type "git push heroku master", "heroku run db:migrate" all the time.

I'm trying to get it down to one-line deployment and haven't really seen any useful tutorials on Heroku or SO so far that really accomplishes that.

I'm fine with actually writing my own deployment script code, I'm just puzzled on what the best long-term practice is: rake tasks, ruby script, or some 3rd-party utility I haven't found.

I'm certain there are numerous professional development teams that use rails and Heroku but I haven't seen the details of how they implement their deployment process.

I normally do a lot of the development myself and then other members handle the deployment, but now I'm trying to learn the deployment side as well.

Upvotes: 3

Views: 96

Answers (1)

Nick Ginanto
Nick Ginanto

Reputation: 32130

to avoid fat-fingers and accidental fatal typos, use scripts with unique calls like ./deploy-heroku

for the last 2 -

  • I deploy to a server with the exact same settings (also running on heroku). This way I have a test server to test all my scripts, loading, db, etc. I deploy it on production not on staging.
  • for backups - use the heroku add-on - pg:backups. for free you get daily backups

Upvotes: 1

Related Questions