1

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?

Niels Kristian
  • 8,661
  • 11
  • 59
  • 117

1 Answers1

0

This solved my problem How to deploy to a single specific server using Capistrano

Community
  • 1
  • 1
Niels Kristian
  • 8,661
  • 11
  • 59
  • 117