0

I'm using the extended choice Jenkins plugin to allow a user to choose a group of hosts to run a job against. Right now, it's done in a naive way and each menu item is just a long list of hostnames.

What I'd like instead is something more sensible like a group name that is mapped to a data structure that can be updated easily. So, for example, the menu items would be "Prod", "Stage", etc. Even after reading the docs, I don't understand how to get that behavior with this plugin.

3
  • Are you using Jenkins pipelines or just freesstyle jobs ? Commented Aug 5, 2016 at 6:00
  • We're using pipelines. Commented Aug 6, 2016 at 11:37
  • With extended choice Jenkins plugin you can execute Groovy script so you can put code such as return ["item1","item2","item3"]. I think you could return a global env variable, however I didn't succeed returning one from the parameters plugin... Also you could consider using a Groovy or a properties file that you could reuse. Check this answer for Groovy usage with this plugin. Commented Aug 8, 2016 at 15:05

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.