Method: Gitlab::QA::Docker::Shellout#execute!
- Defined in:
- lib/gitlab/qa/docker/shellout.rb
#execute! ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/gitlab/qa/docker/shellout.rb', line 16 def execute! raise StatusError, 'Command already executed' if @output.any? Open3.popen2e(@command.to_s) do |_in, out, wait| out.each do |line| @output.push(line) if block_given? yield line, wait else puts line end end if wait.value.exited? && wait.value.exitstatus.nonzero? raise StatusError, "Docker command `#{@command}` failed!" end end @output.join.chomp end |