Creating App Docs When deploying with Capistrano

I’ve been starting to use capistrano and a couple of projects lately. One thing i wanted to do when i deploy my app is generate documentation automatically.

I sat there wondering how to do this with capistrano for a few minutes and performed a few searches before i realised how you do this is blindingly obvious.

Just use the system tag to runa a local command e.g. in this case its the following.

system("rake doc:app")

rather than adding this to my deploy namespace i’ve created a new namespace

namespace :docs do
    desc "Generate Build Docs"
    task :build, :roles => :app do
        system("rake doc:app")
    end
end

and then added the following to run the command after a deployment

after "deploy:update_code", "docs:build"

I plan to follow up by generating code complexity and code coverage reports on deployment aswell. This can be achieved by adding additional tasks to the :docs namespace.



Wednesday, October 5th, 2011
Graham
Tags: , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>