We have the following template in server management - all users have their own user, but the deployment is completely performed by a special deployment user without direct login.
We used this method in Capistrano 2.x:
default_run_options[:shell] = "sudo -u deploy bash" $ cap stage deploy -s user=thisisme
I know that Capistrano 3.x has a way to directly switch the user:
task :install do on roles(:all) do as :deploy do execute :whoami end end end
But this code will populate all tasks, and tasks by default will not inherit the deployment user. Is it possible to immediately configure the login user without dragging this code for each task?
ruby deployment capistrano
Meredian
source share