Created
March 11, 2020 19:29
-
-
Save ccarrasc/ff47af0626c10f14fc30e5b70ae77c32 to your computer and use it in GitHub Desktop.
Execute shell command through Jenkins script (Groovy)
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 out = new StringBuilder() | |
def err = new StringBuilder() | |
def proc = 'ls -lrt'.execute() | |
proc.consumeProcessOutput(out, err) | |
proc.waitForProcessOutput() | |
println "$out" | |
println "$err" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment