askalee
5/30/2018 - 9:28 AM

Groovy run command, get stdout stderr and exit code

Groovy run command, get stdout stderr and exit code

  cmd = "./restart.sh ${server} ${containerName}"
  println("INFO: Restarting the container: ${cmd}")
  def proc = cmd.execute()
  proc.waitForProcessOutput(System.out, System.err)
  def errorCode = proc.exitValue()