Skip to content

Instantly share code, notes, and snippets.

@ccarrasc
Created March 11, 2020 19:29
Show Gist options
  • Save ccarrasc/ff47af0626c10f14fc30e5b70ae77c32 to your computer and use it in GitHub Desktop.
Save ccarrasc/ff47af0626c10f14fc30e5b70ae77c32 to your computer and use it in GitHub Desktop.
Execute shell command through Jenkins script (Groovy)
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