perl - Groovy script to download script and run it with parameters -
need groovy script.
we have perl script in github. need download , run perl-script inside groovy script (jenkins) , pass parameters script , output.
example, perl script in github accepts parameter "item1" "item2", using curl raw format of script.
def command = "curl -s https://github.com/raw/script.pl?token=%3d" def proc = command.execute() | "perl /dev/stdin $item1 $item2".execute() proc.waitfor() def roles = [] roles = "${proc.in.text}" .eachline { line -> roles << line } return roles
above script not return expected result. please help.
thanks in advance..
thanks guys. found it. following work..
def command = "curl -s https://github.com/raw/script.pl?token=%3d" def proc = command.execute() | "perl /dev/stdin $item1 $item2".execute() proc.waitfor() def roles = [] roles = "${proc.in.text}" .eachline { line -> roles << line } return roles
Comments
Post a Comment