views:

131

answers:

1

I often used Rake tasks that are dependent upon the Rails environment task having loaded. I then interact with Rails Models within the Rake tasks. Can I do this in Capistrano?

+1  A: 

You can definately use capistrano to fire a rake task.

  desc 'Run a Rake Task.'
  task :after_deploy, :roles => :app do
    run "cd /path/to/app && rake -e environnment task here"
  end

If you are asking if you can access a rails model from Capistrano, then I would say I don't think so unless you are using some other way that also loads a rails environment, like script/runner.

I'd say stick with firing a rake task from Capistrano.

railsninja