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.

J Adams
  • 1
  • 1
  • Are you using Jenkins pipelines or just freesstyle jobs ? – Pom12 Aug 05 '16 at 06:00
  • We're using pipelines. – J Adams Aug 06 '16 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](http://stackoverflow.com/questions/24730186/jenkins-extended-parameter-plugin-groovy-script) for Groovy usage with this plugin. – Pom12 Aug 08 '16 at 15:05

0 Answers0