Skip to content
paperreduction edited this page Feb 3, 2011 · 4 revisions

Recipes for Webistrano are Capistrano recipes and therefore follow the same structure and API discussed in the Capistrano Documentation.

With that said, here's a few short examples of recipes and some extra documentation links to go with:

namespace :wordpress
    task :upload do
        #recipe guts here
    end
end

Examples of Action Module

upload("files/wallpaper.png", "/var/www/html/wp-content/uploads")
run "#{sudo} apachectl restart"

Put the above all together into a recipe

The recipe below simply uploads a file to the remote server and executes an apache restart command. Not that a restart is needed after an upload, this is simply illustrating how to put a recipe together.

namespace :wordpress
    task :upload do
        upload("files/wallpaper.png", "/var/www/html/wp-content/uploads")
        run "#{sudo} apachectl restart"
    end
end

After saving the above as a recipe and assigning that recipe to a stage, you will see the following option in the "All tasks:" Deployments Drop list (for that stage): wordpress:upload

Clone this wiki locally