0.0
No commit activity in last 3 years
No release in over 3 years
User can define tasks which will start before or after deployment
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies

Development

~> 1.3
>= 0

Runtime

>= 0
 Project Readme

DeployHooks

This tiny gem allows to define tasks which will start before and/or after deployment app to heroku.

Installation

Add this line to your application's Gemfile:

gem 'deploy_hooks'

And then execute:

$ bundle

Usage

At first u should have rake or thor tasks that will be used as hooks. You need to define your hooks in initializer initializers/deploy_hooks.rb like that:

DeployHooks.config do |config|
  config.environments = { stage: 'your-appname-at-stage', production: 'your-appname-at-production' }
  config.before_deploy = { rake: %w[ your_rake_task ], thor: %w[ your_thor_task ] }
  config.after_deploy = { rake: %w[ db:migrate another_your_rake_task ], thor: %w[ another_your_thor_task ] }
end

Also make sure that [push] default = tracking has been added to .git/config in your_project_folder

After that, you can execute rake deploy:<environment> (for example rake deploy:stage) for pushing your app to heroku with before_deploy and/or after_deploy hooks.

Notice

This gem was created for personal educational purposes and I'll be glad if it could find application in any other projects.

Gratitude

Thanks to Michael Dwan and his Article Thanks to ExReanimator for guiding

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request