-
-
Save rameshz23/15b70f2ce5bb098602f510450a86a95f to your computer and use it in GitHub Desktop.
Jenkins groovy script to execute shell command
This file contains 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