How to create a set of Jenkins variables based on one chosen parameter?
Clash Royale CLAN TAG#URR8PPP
How to create a set of Jenkins variables based on one chosen parameter?
I'm using a jenkins freestyle project which has parameterized build enabled.
How can I create a set of variables based on the chose parameter?
For example:
When the parameter param1
is chosen, I want the set of variables to be equal to
param1
CONFIG=config_a.yml
AWS_PROFILE=aws-profile-aa
ANT_BUILD_FILE=buildA
When param2
is chosen, the above set of variables should be set to
param2
CONFIG=config_b.yml
AWS_PROFILE=aws-profile-bb
ANT_BUILD_FILE=buildB
CONFIG
, AWS_PROFILE
, and ANT_BUILD_FILE
variables will be accessed in Execute shell
, and Invoke Ant
.
CONFIG
AWS_PROFILE
ANT_BUILD_FILE
Execute shell
Invoke Ant
I don't want to define 3 parameters like this
Because my jenkins project should never build with CONFIG
=config_a.yml
and AWS_PROFILE
=aws-profile-bb
together.
CONFIG
config_a.yml
AWS_PROFILE
aws-profile-bb
2 Answers
2
Why you not using ant? Its very easy to write build.xml file for ant
https://ant.apache.org/manual/using.html
I found that Active Choices is able to solve my problem.
This plugin can create 4 parameters like this
Once test_choice_parameter
is changed to param2
, the other 3 parameters will change accordingly.
test_choice_parameter
param2
Here is my configuration of Active Choices:
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.