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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

Idan Adar
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

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a085cc05-e47b-4c41-9e04-7c7bca15ed32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.