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.

8 bit scraps has been created by Graham Hadgraft a web developer from Ipswich. Graham Hadgraft has 10 Years programming experience in various languages.