Our capistrano setup is: ssh with regular user, but deploy to a location requiring sudo permissions to create files.
I want to run the specific capistrano command run "cd #{configuration[:releases_path]} && #{decompress(remote_filename).join(" ")} && rm #{remote_filename}" using sudo. Is there a neat way to over ride it?
def distribute!
upload(filename, remote_filename)
run "cd #{configuration[:releases_path]} && #{decompress(remote_filename).join(" ")} && rm #{remote_filename}"
end
I believe you can use the “sudo” function inside capistrano e.g.