Write once, run once.
Manage one-time remote tasks in your Rails project. Plugins with Mina and Capistrano to add support for rake tasks hosted in remote collection, such as FTP, Gist or S3.
Say you have a data migration to perform on a remote server. The procedure is too complex to just do it in the remote console and using database migrations would be evil. A rake task would be nice, but checking this in with the source code repository adds clutter, as you know you will only run this once. Woro offers a quick way of pushing rake tasks onto the remote server, execute them and delete them instantly.
Woro helps you create rake tasks, that you can develop and run locally. Once you are ready, woro let's you push them online to a remote storage like FTP or other adapters like Gist or S3. Using a mina deployment setup, these tasks are downloaded on the remote system, executed by rake and cleaned up afterwards.
By default Woro comes with support for FTP, but additional adapters are available:
Add them as dependency to your
Gemfile and they become available in woro.
Add this line to your application's Gemfile:
gem 'woro', require: false
And then execute:
Or install it yourself as:
$ gem install woro
$ woro init
This creates the
woro.yml in the
config/ folder. This configuration
stores the settings of the available remote collection adapters, eg the
It also creates the
lib/woro_tasks/ folder and
Here the Woro task files are stored, edited locally and run using rake.
The idea of the Woro tasks is, that these are a one time thing and are
not required to be checked in with the repository. Therefore,
lib/woro_tasks/ includes a
.gitignore file to ignore rake tasks in
for use with Mina
mina/woro in your
require 'mina/bundler' require 'mina/rails' require 'mina/git' require 'mina/woro' ...
for use with Capistrano
capistrano/woro in your
require 'capistrano/rails' require 'capistrano/woro' ...
$ woro new cleanup_users $ woro create cleanup_users
Can be used to create the template for a new task in
The task itself is a regular rake-task in the woro-namespace. You can test it locally using rake:
$ rake woro:cleanup_users
Once you are done writing the task and you want to execute it on the remote system. First you have to push them online, in this case to Gist.
$ woro push ftp:cleanup_users
Attention, depending on whether you set up a Gist/Github login on initialization. These tasks are online anonymous, but public, or private under the specified Github account.
Now, to run a task remotely using Mina, specify the task:
$ mina woro:run task=ftp:cleanup_users
Or to run it with Capistrano:
$ cap woro:run task=ftp:cleanup_users
To show a list of all tasks uploaded to any collection do:
$ woro list $ woro ls
And finally you can download an existing task to your local woro tasks directory.
$ woro pull ftp:cleanup_users
The project classes are tested through rspec.
The command line interface is tested through cucmber/aruba.
- 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