Can shell script be executed from an Extensible Choice -> Groovy Script?

17 views
Skip to first unread message

Idan Adar

unread,
Nov 9, 2017, 9:51:37 AM11/9/17
to Jenkins Users
In a paramatized job that displays to the user some options before executing it, I also need to show a "dynamic" dropdown. I believe the way to do this is using the Extensible Choice option.
Can I execute a shell script in this option's Groovy Script textarea?

The below does not seem to be executed when starting the job and the job UI is displayed.

sh """
bx login -a https://... -c ... -u ... -p ...
bx cs clusters | tail -n +3 | cut -d ' ' -f 1 > clusters.txt"


def clusters = readFile('clusters.txt').trim()
"rm -rf clusters.txt"
clusters

Reply all
Reply to author
Forward
0 new messages