thoughtbot / parity

Shell commands for development, staging, and production parity for Heroku apps
https://thoughtbot.com
MIT License
895 stars 57 forks source link

Deploy other branch to production? #132

Closed ledermann closed 7 years ago

ledermann commented 7 years ago

I'm trying to use parity for deploying a branch named stable to production. This seems not to be possible, because there is a hard-coded git push production master:

https://github.com/thoughtbot/parity/blob/c6b8fc9ea2688d254e645440c9a4cc5abcc7aa6f/lib/parity/environment.rb#L51

Is this intended? How to configure the branch used for production deployment?

geoffharcourt commented 7 years ago

Hi @lederman this is intended functionality (intended to prevent accidental deploying of a feature branch to production). Are you pushing stable on your local machine to master on Heroku?

We've shied away from building configuration options or accommodating a configuration file. If it doesn't make using or packaging Parity significantly more complicated I would be happy to look at a PR.

ledermann commented 7 years ago

@geoffharcourt yes, I want to push my stable branch to heroku:master (like git push production stable:master --force).

Maybe this is not a good practice. For my project I will think about another branching model like git-flow, where the branch for production deploy is master. This seems to better fit with parity.

geoffharcourt commented 7 years ago

I think if you're using Heroku it makes sense to have your local master line up with the production app's master. On a recent client project I worked on, the GitHub base branch wasn't master, which helped make this flow work. We facilitate non-master deploys to staging/feature apps, so as long as you can make master reflect production I think you can keep the rest of your flow.

I don't think it's likely we'll ever append the --force argument for production deploys for safety reasons, but I think it may get passed along as an argument if you add it yourself.

ledermann commented 7 years ago

You are right, thanks for your detailed explanation!