A few helpful rake tasks to automate configuring and deploying to Heroku apps.
Add this line to your application's Gemfile:
gem 'heroploy'
And then execute:
$ bundle
Or install it yourself as:
$ gem install heroploy
See the documentation for a more detailed description of the options available for configuring and deploying with Heroploy.
Add a heroploy.yml
file to your application's config directory which describes the Heroku apps you will deploy to, and the checks you would like when deploying to each.
If you're running Rails, you can use this generator to add an example config file:
rails generate heroploy:install
Here's an example heroploy.yml
file:
travis_repo: my-travis-user/my-travis-repo
environments:
development:
app: my-development-app
staging:
app: my-staging-app
checks:
pushed: true
branch: master
production:
app: my-production-app
tag: 'RELEASE_%Y%m%dT%H%M%S%z'
checks:
pushed: true
branch: master
staged: true
travis: true
This file:
- Describes
development
,staging
andproduction
deployment rules for three Heroku apps (namedmy-development-app
,my-staging-app
andmy-production-app
on Heroku). - Allows any branch to be pushed directly to
development
. - Only allows
master
to be pushed tostaging
, and requires all changes to have first been pushed toorigin
. - Only allows deployment to
production
if the changes have first been staged onstaging
and the Travis build is passing.
To deploy to one of these environments, run rake heroploy:<environment>:deploy
. For example:
rake heroploy:production:deploy
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request