I-am-simple-user
I-am-simple-user

Reputation: 409

Need suggestions while pushing changes on the existing heroku application

Currently I am working on one of the application (abc.com) which is deployed on the Heroku both staiging and production environments.

Now I have to deploy changes on the staging server.

When I start the working, I created a separate dev branch from master and pushed all the changes under dev branch.

Currently staging is working from master branch (Some changes are pushed on master by another developer).

So I need suggestions for following

  1. Should I merge master into dev (master => dev) or dev to master (dev => master).
  2. If I merge (master => dev), did I have to set all the environment variables.
  3. And most important how can I take pull on the heroku.

Here is my application configuration

Ruby 1.9.3
Rails 3.2.11

Let me know anything need.

Upvotes: 1

Views: 45

Answers (1)

Drenmi
Drenmi

Reputation: 8777

Here are some recommendations. You should look into adopting a standardized workflow. Having your friend (or anyone for that matter) pushing directly to master can cause a whole lot of pain. I'll leave a recommendation at the end of the post.

  1. As you're not following any workflow, this doesn't really matter for now. If your code is fit for going into production, merge dev into master. If you're just playing around to test things out, merge master into dev.

  2. No. Environment variables are set on the Heroku environment, or using something like the dotenv gem. It does not matter which branch you use on Git. (If, by chance, your environment variables are checked into Git, please remove them now and read this. You don't want sensitive data checked into your repository.)

  3. If you want to deploy your dev branch to Heroku, simply use: git push staging dev. This assumes your Git remote is named staging. If you're unsure, use git remote -v to get the correct name.

A general rule we apply is that master should always be deployable. To accomplish this at my company, we use GitHub Flow. This might be worth looking into for a unified way of working with Git and deployment.

Upvotes: 1

Related Questions