-
-
Save actionjack/f5aea1fa12d2e2688e4829d108ceff31 to your computer and use it in GitHub Desktop.
Jenkins groovy script to execute shell command
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
| def cmd = 'hostname' | |
| def sout = new StringBuffer(), serr = new StringBuffer() | |
| def proc = cmd.execute() | |
| proc.consumeProcessOutput(sout, serr) | |
| proc.waitForOrKill(1000) | |
| println sout |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment