Hanzo is a sharp tool to handle deployments in multiple environments on Heroku.
Installation
Add this line to your application’s Gemfile:
gem 'hanzo'
Usage
Create an .heroku-remotes
file at the root of your app that will contain the name of the
environment as the key and the Heroku app name as the value.
qa: heroku-app-name-qa
staging: heroku-app-name-staging
production: heroku-app-name-production
Install remotes
Whenever you add a new environment to your .heroku-remotes
file, you'll have to install those
remotes locally by running hanzo install
.
> hanzo install
-----> Creating git remotes
Adding qa
git remote rm qa 2>&1 > /dev/null
git remote add qa [email protected]:heroku-app-name-qa.git
Adding staging
git remote rm staging 2>&1 > /dev/null
git remote add staging [email protected]:heroku-app-name-staging.git
Adding production
git remote rm production 2>&1 > /dev/null
git remote add production [email protected]:heroku-app-name-production.git
Deploy a branch or a tag
> hanzo deploy qa
-----> Branch to deploy: |HEAD|
Install labs
Once all your environments are activated, you might want to enable some Heroku labs feature for all your environments.
> bundle exec hanzo install labs
-----> Activating Heroku Labs
Add preboot? yes
- Enabled for qa
- Enabled for staging
- Enabled for production
Add user-env-compile? yes
- Enabled for qa
- Enabled for staging
- Enabled for production
License
Hanzo
is © 2014 Mirego and may be freely distributed under the New BSD license. See the LICENSE.md
file.
About Mirego
Mirego is a team of passionate people who believe that work is a place where you can innovate and have fun. We're a team of talented people who imagine and build beautiful Web and mobile applications. We come together to share ideas and change the world.
We also love open-source software and we try to give back to the community as much as we can.