Falcon Deploy
A simple wrapper to make it easier and less nerve-wracking to deploy to Heroku and roll code back when you mess things up.
Inspired by Space X's awesome Falcon rocket, which is working towards the first combined take-off and safe landing, and drawn from this gist.
Falcon aims to be a simple, pared-down, easy-to-use (and easy-to-maintain) solution to a very specific problem.
Installation
Note: This gem is built to use Heroku Toolbelt. It won't do anything if you don't have the Toolbelt installed.
Add to your Gemfile (:development
group is fine):
gem 'falcon-deploy'
And then execute:
$ bundle
Usage
Falcon is run from the command line. It takes two arguments, appname
and command
, and an optional --force
(or -f
) flag.
The commands are:
deploy
- Deploy code to your app.migrations
- Deploy code to your app, turn on maintenance mode, run accompanying migrations, and turn maintenance off.rollback
- Roll back the most recent deploy. This will not reverse migrations, so as the instructions stipulate, runrake db:rollback
before this command as necessary.
The optional -f
flag disables the above rollback warning.
Some examples:
falcon staging-appname deploy
# => Deploy code to your staging app
falcon my-prod-app migrations
# => Deploy code to production app, turn on maintenance mode, run accompanying migrations, and turn maintenance off
falcon app-name rollback -f
# => You will not be warned about migrations; falcon will go ahead and reverse the previous deploy
falcon help
# => ?
Development
The usual:
After checking out the repo, run bin/setup
to install dependencies. Then, run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
to create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Contributing
- Fork it ( https://github.com/sashafklein/falcon/fork )
- 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 a new Pull Request