Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capistrano roles ignored for symfony_command #124

Open
ChristianVermeulen opened this issue Sep 4, 2020 · 1 comment
Open

Capistrano roles ignored for symfony_command #124

ChristianVermeulen opened this issue Sep 4, 2020 · 1 comment

Comments

@ChristianVermeulen
Copy link

ChristianVermeulen commented Sep 4, 2020

Library Version
Capistrano 3.12.1
Capistrano_symfony 2.0.0

I followed this piece from the docs:

If you want to execute a command on a host with a given role you can use the Capistrano on DSL, additionally using within from Capistrano will change the directory

namespace :deploy do
  task :migrate do
    on roles(:db) do
      symfony_console('doctrine:migrations:migrate', '--no-interaction')
    end
  end
end

I have 2 servers set up:

server "xxx",
  user: "emc",
  roles: %w{web db},
  primary: true,
  ssh_options: {
    user: "www-data", # overrides user setting above
    keys: %w(config/azure_ssh),
    forward_agent: false,
    auth_methods: %w(publickey)
  }

server "xxx2",
  user: "emc",
  roles: %w{web},
  ssh_options: {
    user: "www-data", # overrides user setting above
    keys: %w(config/azure_ssh),
    forward_agent: false,
    auth_methods: %w(publickey),
    port: 23
  }

Yet the symfony_console is still ran on both servers. I noticed another task which did neatly run on just one server, it was not using the symfony command. So I changed my symfony_command to a capistrano execute and now the role is actually taken into account.

For some reason, when using the symfony_command, the roles from capistrano are ignored...

@zalejus
Copy link

zalejus commented Jan 11, 2023

Hi,
I met the same issue and for me the only solution was to install capistrano symfony version 1.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants