Can I transfer a stream using Capistrano 3 while the remote command is still running

I would like to do the same as with Capistrano2

task :memory do 
     run "free | awk '/^Mem:/{print $4}'" do | channel, stream, data |
          puts "host: #{channel[:host]} has free memory of #{data.to_i/1024} MB"
     end
end

Using capture does not help, since it only prints after the remote command completes.

+4
source share

Source: https://habr.com/ru/post/1536728/


All Articles