0

I'm trying to setup a new rails project to have three environments: staging, test, and production. I want to host on Heroku, and use GitHub for source control. The basic workflow I want is to:

1) Develop on a local environment

2) Push to the staging branch on GitHub, kicking off a build on the staging server.

3) Merge staging into test on GitHub kicking off my tests first and then building on the test server if they're successful.

4) Merge test into production kicking off a build of the production server.

I also own the domain I want to use and I want the servers to reflect this. So I'd want my production app to be at example.com, while my test server would be test.example.com, and my staging server would be staging.example.com.

Does anyone know how I'd set all this up even at a high level? I know it's a lot of stuff with potentially many ways to do it.

Captain Stack
  • 3,572
  • 5
  • 31
  • 56

1 Answers1

0

I'm doing something similar(ish). My workflow is (roughly):

  1. Develop on local
  2. Test on local (unit, integration)
  3. git push to staging on Heroku (staging-example.herokuapp.com)
  4. Test on staging (integration only)
  5. git push to GitHub which triggers an auto deploy to production on Heroku (example.com)

A couple of notes:

  • I am not sure that Heroku supports the kind of 'merging' between environments that your question implies. Theoretically, I believe this is what pipelines are for. But, as I'm sure you've read here, pipelines may not play nicely with RoR.

  • I set up my apps as https. I don't want to deal with setup of https for my staging applications, so I just use the app-name.herokuapp.com that's free and easy.

I'll add to if I think of anything else.

jvillian
  • 19,953
  • 5
  • 31
  • 44