Created
February 4, 2015 06:52
-
-
Save sue445/d8ee1b5e2094724286fa to your computer and use it in GitHub Desktop.
Execute shell command as Jenkins
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
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