Skip to content

Instantly share code, notes, and snippets.

@sue445
Created February 4, 2015 06:52
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sue445/d8ee1b5e2094724286fa to your computer and use it in GitHub Desktop.
Save sue445/d8ee1b5e2094724286fa to your computer and use it in GitHub Desktop.
Execute shell command as Jenkins
void system(String command){
def out = new StringBuilder()
def err = new StringBuilder()
println "> $command"
def proc = command.execute()
proc.waitForProcessOutput(out, err)
if (out) println "out:\n$out"
if (err) println "err:\n$err"
}
system "whoami"
system "pwd"
system "ls /precure_allstars/michiru_and_kaoru"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment