Permanently Switching User in Capistrano 3 (Separate Authorization & Deploy)

`puma:restart' invoke twice but i only call it once on my deploy app via Capistrano?

I assume you are using the capistrano3-puma gem. That gem automatically restarts puma for you at the conclusion of a successful deployment. So that is the first time the restart task is being called.

Additionally, in your deploy.rb, you've defined your own custom restart task, and you are invoking it after :finishing. That is the source of the second invocation, and thus the warning.

To "fix" this problem, remove the redundant task:

desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
invoke 'puma:restart'
end
end

And remove this:

after  :finishing,    :restart

Capistrano leaving remote tail open

Have you tried adding the pty option to stop buffering.

stream(..., :pty => true)

Net::SSH::AuthenticationFailed: Authentication failed for user

Did you add your key to the Agent?

What do you see when you run:

$ ssh-add -l

If you get 'The agent has no identities.', then add your key with:

$ ssh-add id_rsa_key_name

How to have Capistrano NOT rollback if a task fails

from the Capistrano Task docs there is a config you can add to if there is an error, to continue.

task :solr_start, :on_error => :continue do
# your code here
end

Just add that to each task you want to ignore errors and continue. Though, the best possible thing is to see if you can figure out what is causing the failure and have the restart command be more robust to really restart it. I only say this, since when you try to hand off the script to someone else, they might not know exactly how to tell if it restarted correctly.



Related Topics



Leave a reply



Submit