Created
May 30, 2018 09:28
-
-
Save askalee/8e19fc2e3d62ea5d20204f6a4d2e6d9a to your computer and use it in GitHub Desktop.
Groovy run command, get stdout stderr and exit code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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