Hanzo
Hanzo is a sharp tool to handle deployments of multiple environments of the same application on Heroku.


Installation

Add this line to your application’s Gemfile:

gem 'hanzo'

Usage

Create an .hanzo.yml file at the root of your app that will contain a map of remotes, with the remote as the key and the Heroku application name as the value.

You can also specify commands that can be ran on the application after a successful deploy. Hanzo will prompt to run each of them, they each will be ran with heroku run and the application will be restarted at the end.

remotes:
  qa: heroku-app-name-qa
  staging: heroku-app-name-staging
  production: heroku-app-name-production
after_deploy:
  - rake db:migrate

Install remotes

Whenever you add a new remote to your .hanzo.yml 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 remotes are installed, you might want to enable some Heroku labs feature for all of them.

> 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 © 2017 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.