I have a capistrano deployment setup that simplified looks something like this:
server "server_ip1", :role1
server "server_ip2", :role2
And a pair of tasks
namespace :postgresql do
desc "Install necessary ubuntu packages"
task :install, roles: [:role2] do
run "#{sudo} apt-get -y install postgresql libpq-dev"
end
after "deploy:install", "postgresql:install"
end
namespace :app_install do
desc "Install necessary ubuntu packages"
task :install, roles: [:role1, :role2] do
run "#{sudo} apt-get -y install imagemagick"
end
after "deploy:install", "app_install:install"
end
Now the problem is if I run cap deploy:install ROLES=role1
it correctly runs the tasks on server_ip1 BUT it runs BOTH task app_install:install AND postgresql:install
And the funny thing is if I run cap deploy:install
(without ROLES=role1) it does everything 'correctly'.
Am I getting something wrong?