I would like to run local commands and exit on failure of any command. whats the best way to do this with capistrano? run_locally will continue going on failure.
Do i have to check the last commands exist status everytime (or create a custom run locally function)?
I had to create my own function like this:
task :build_backend do
run_local("echo hello")
run_local("abcdef")
run_local("echo 'not run'")
end
def run_local(cmd)
system cmd
if($?.exitstatus != 0) then
puts 'exit code: ' + $?.exitstatus.to_s
exit
end
end
Using this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With