discuss!help wanted
描述
run_locally ignores the --dry-run flag and runs anyway. This seems to be because in https://github.com/capistrano/capistrano/blob/master/lib/capistrano/dsl.rb#L68 the current sshkit backend is ignored and the local one is used directly.
Steps to reproduce
So with the following contrived test case:
namespace :test_case do
desc 'A test for run_locally dry-run issue'
task :testing do
on roles(:app) do |host|
run_locally do
execute :echo, "fail"
end
end
end
end
Then running it with cap --dry-run stage test_case:testing
Expected behavior
It should output:
00:00 test_case:testing
01 echo fail
Like it does if you remove the run_locally block.
Actual behavior
It outputs:
00:00 test_case:testing
01 echo fail
01 fail
✔ 01 notroot@localhost 0.002s
Indicating it actually ran the program.
System configuration
doctor output: https://gist.github.com/BenoitHiller/fc0fd11b95bf4faa5f7cd34da34d0711