Reputation: 529
I have a perl script that return list of names taken from DB:
perl -w /tmp/testdb.pl
"Dana Ron Emily Ethan James Brandon Josef"
I want that Jenkins will show them in the Active Choices Reactive Parameter depends by the value chosen in the previous parameter
This is the groovy script I have:
def command = "perl -w /tmp/testdb.pl"
def proc = command.execute()
proc.waitFor()
def output = proc.in.text
List modifiedList = output.split(' ')
return modifiedList
When trying to run the build, it shows an empty list When I run this groovy script from command line (on the same jenkins machine) it works:
[Dana, Ron, Emily, Ethan, James, Brandon, Josef]
What am I doing wrong?
Upvotes: 0
Views: 715
Reputation: 1
Try using:
List modifiedList = output.tokenize(' ')
Instead of:
List modifiedList = output.split(' ')
Upvotes: 0