Replacing a task in Capistrano / Capifony

I am using Capifony , an extension for Symfony for Capistrano. I need to override one of the predefined tasks to accomplish my own task symfony - replacing task :permissionson https://github.com/everzet/capifony/blob/master/lib/symfony1.rb#L180 my own.

I tried adding the following to the end of my file deploy.rb, but Capistrano does not pick it up, and instead it uses an already defined task:

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?

+3
source share
1 answer

I did not dig 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
+4
source

All Articles