parameterised build which can set multiple values/variables from a choice

1,094 views
Skip to first unread message

paul b

unread,
Jun 29, 2017, 4:26:27 PM6/29/17
to Jenkins Users
Hi,
  I wondered if it is possible to do a parameterised build which can set multiple values.  I would like to use the choice(dropdown box) and select a single value but that then set multiple values/parameters.  This is mentioned in the by Martin Woit in the following.  I also would like to use the choice of target of dev, sit etc etc.  Sure other people have faced this same problem many times. 


Hope you can help.

 

Michael Pailloncy

unread,
Jun 30, 2017, 7:49:33 AM6/30/17
to jenkins...@googlegroups.com

--
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 jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/025ba41f-82d7-4e19-89d6-785884ff2757%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

paul b

unread,
Jun 30, 2017, 8:06:59 AM6/30/17
to Jenkins Users
I have tried to understand the various options but I am not too sure I can use it.  Unless I am missing something...  

All I want is something simple like the following.

my choice(dropdown) selections are:
1. dev
2. sit
3. uat
4. prod

For example when I select dev I would like it set variables like
server=dev-server
port=dev-port

so for each environment I can chose different servers and ports.

which I can then pass into my maven build like
mvn clean deploy -DSERVER=${server} -DPORT=${port}
 

On Friday, 30 June 2017 12:49:33 UTC+1, mpapo - Michael Pailloncy wrote:
2017-06-29 22:26 GMT+02:00 paul b <pbla...@gmail.com>:
Hi,
  I wondered if it is possible to do a parameterised build which can set multiple values.  I would like to use the choice(dropdown box) and select a single value but that then set multiple values/parameters.  This is mentioned in the by Martin Woit in the following.  I also would like to use the choice of target of dev, sit etc etc.  Sure other people have faced this same problem many times. 


Hope you can help.

 

--
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 jenkinsci-use...@googlegroups.com.

Michael Pailloncy

unread,
Jul 2, 2017, 8:49:15 AM7/2/17
to jenkins...@googlegroups.com
Ok.
IMHO, It would be better to avoid too much complexity in your job configuration. Personally, I would create one job per use case : each one with default parameters value targeting each environment type (dev/uat/prod/...).
In this way, you will have a simple job configuration (easily maintainable), but also a clear and distinct build history for each environment type.

Moreover, if you want to avoid managing too much jobs with the (almost) same configuration, I would suggest you to consider some plugins which can help you for that : Jenkins Pipeline (I'm assuming that your are using FreeStyle job, right ?), Job DSL Plugin, Job Builder, ...

Hope it helps.


To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6f55af96-5003-4334-8b6a-db74505df33c%40googlegroups.com.

paul b

unread,
Jul 3, 2017, 3:45:37 AM7/3/17
to Jenkins Users
Ok.  I get what you're saying but that would mean me creating a job for each environment(4 environments).  Then with the 20 jobs for all the components that would work out to be 80 jobs! Which seems excessive.

Michael Pailloncy

unread,
Jul 3, 2017, 3:52:58 AM7/3/17
to jenkins...@googlegroups.com
Yeah, that's the main disadvantage. But as I mentioned, you can avoid this constraint with tools like Jenkins Pipeline, Job DSL Plugin or Job Builder.

To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/4857f738-cf7f-4395-bbc3-c7d2d9f60c4b%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages