Reputation: 409
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
Here is my application configuration
Ruby 1.9.3
Rails 3.2.11
Let me know anything need.
Upvotes: 1
Views: 45
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.
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
.
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.)
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