clipped from: nubyonrails.com   

Using Capistrano with Perl (or PHP) 4

Posted by topfunky on 03/09/2006

This page has been viewed 671 times since March 29, 2006

UPDATE: The cap command can be used instead of rake.

Theoretically, you can use the Switchtower Capistrano deployment system with Perl, PHP, or any other system. I haven’t seen a tutorial for doing it with non-Rails systems, so here is how I did it tonight:

  • Make the standard ‘public’, and ‘config’ folders that you are used to seeing in Rails.
  • Copy all your Perl or PHP files into ‘public’.
  • Copy this starter deploy.rb file to config/deploy.rb.
  • Make a restart task that does nothing (or restarts FCGI’s for the language in question).
  • Run cap setup
  • Copy any relevant upload folders to shared/system/...
  • Make an after_symlink task that symlinks from any relevant upload folders and makes Perl files executable:
desc 'Link to files'
task :after_symlink do
  run "chmod +x #{current_path}/public/*.pl" 
  run "ln -s #{shared_path}/file #{current_path}/public/file" 
end
  • Run cap deploy

I used this with a Perl-based system and it worked successfully! Yay! Capistrano + Ruby deployment for non-Rails languages!

See also