3

I am using Capifony, a Symfony-specific extension to Capistrano. I need to override one of the pre-defined tasks so my own symfony task is run - replacing task :permissions in https://github.com/everzet/capifony/blob/master/lib/symfony1.rb#L180 with my own.

I have tried adding the following to the end of my deploy.rb file, but Capistrano doesn't pick it up, and it uses the already defined task instead:

namespace :project do
  desc "Fixes symfony directory permissions using Citizencard custom permission setter"
  task :permissions do
    run "cd #{latest_release} && #{php_bin} ./symfony citizencard:permissions"
  end
end

How can I do this?

PeterB
  • 2,212
  • 2
  • 21
  • 33

1 Answers1

4

I hadn't dug deep enough into the namespace stack. Changing my code to the following made it work:

  namespace :symfony do
    namespace :project do
      desc "Fixes symfony directory permissions using Citizencard custom permission setter"
      task :permissions do
        run "cd #{latest_release} && #{php_bin} ./symfony citizencard:permissions"
      end
    end
  end
PeterB
  • 2,212
  • 2
  • 21
  • 33