0.0
No release in over a year
Automate your Rails after-deployment tasks with rails_tasker
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 13.0
~> 3.0
~> 0.80
~> 0.9.5

Runtime

 Project Readme

RailsTasker

rails_tasker provides a system to automate your post-deploy tasks as Plain Old Ruby Objects that are easy to test and create.

A new database table (rails_tasker_tasks) is created in order to keep track of the state of each task in a similar way to how rails maintains the states of migrations.

Installation

Add this line to your application's Gemfile:

gem 'rails_tasker'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install rails_tasker

Run the install generator to create the needed configurations and migration:

$ rails generate rails_tasker:install

Run the migration:

$ rails db:migrate

Usage

Create a new task
$ rails generate rails_tasker:task new_task_name
  • This will create the following task file: lib/rails_tasker/tasks/<current_timestamp>_new_task_name.rb
Add the logic to the task
  • Each task must implement a #call instance method.
    • This is the main method that will be called in order execute your new task.
Run all pending tasks
$ rake rails_tasker:run
Or run a specific task
$ rake rails_tasker:run[version]
Note

It is recommended to run this after the migrations in the deployment process.

That's it. A very simple system for post-deploy tasks.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/mawilmouth/rails_tasker.

License

The gem is available as open source under the terms of the MIT License.