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

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -