recipes

UIMC - LEAF RAKE

Rake

On July 15, 2011, in Announce, by Mike Bailey
0

I woke up this morning with a great idea. What if deprec could include rake tasks as well as cap tasks?

This would be handy when working on your dev box as you could run tasks the same tasks locally (with Rake) that you can run on remote servers with Capistrano.

It would also allow us to simplify many cap tasks. They would simply call rake tasks with the same name.

I actually envisaged this almost four years ago but the sticking point was how to distribute and maintain the rake tasks on remote servers.

Bundler is the final piece that makes it all incredibly simple.

Check this out!

# Gemfile

gem 'deprec', '>=3.1.0.rc13'

Simply run ‘bundle’ and that’s all you need to have deprec’s rake tasks available to you.

$ rake -T deprec:db

rake deprec:db:backup # Backup the database to a file.

rake deprec:db:restore # Restore database [pending]

The same task is also available as a cap task! ‘cap deprec:db:backup’

$ cap -T deprec:db

cap deprec:db:activate   # Enable startup script for db server
cap deprec:db:backup     # Backup data for db server
cap deprec:db:config     # Deploy configuration files(s) for db server
cap deprec:db:config_gen # Generate config file(s) for db server
cap deprec:db:deactivate # Disable startup script for db server
cap deprec:db:install    # Install Db server
cap deprec:db:restart    # Stop db server
cap deprec:db:restore    # Restore data for db server from backup
cap deprec:db:start      # Start db server
cap deprec:db:stop       # Stop db server

Thanks to Craig Ambrose for the database backup task.

Expect to see more tasks becoming available on http://deprec.org

 

Comments are closed.