Skip to content

Instantly share code, notes, and snippets.

@askalee
Created May 30, 2018 09:28
Show Gist options
  • Save askalee/8e19fc2e3d62ea5d20204f6a4d2e6d9a to your computer and use it in GitHub Desktop.
Save askalee/8e19fc2e3d62ea5d20204f6a4d2e6d9a to your computer and use it in GitHub Desktop.
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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment