I am using jenkinsfile (DSL) for Jenkins pipeline in my project as part of the migration from TeamCity. It uses parameterized build approach where I am defining 2 parameter choices to trigger the build. One of these parameters takes environment name as an input as to where the release package is going to be deployed.
For each environment there are number of env specific settings involved which are in the form of <Key, Value> pair (as done in TeamCity), I am clueless about how can I achieve the same on jenkins side that too using jenkinsfile as we do not have access to configure the jobs via the Jenkins UI.
Environments are like (for e.g. only) - Env1, Env2, Env3, Env4, Env5 etc…
Settings like (for each Env) - <Setting1Name, Value>, <Setting2Name, Value>… etc etc
All settings are in string format.
The ideal approach would be to store these in such a way that its available to any build within my project anytime, and I can access it by providing the env name. For e.g. If I ask settings for ENV1 , it should return all the setting for ENV1 in the form of <SettingsKeysName, Values> pairs.
One of the approaches I read over the net is to use “Active Choices Reactive Parameter” but I am not sure how to make use of it in my fashion.
PS: Pls note that I do not have the admin access of Jenkins as we are working on Odyssey Platform where Jenkins is by default integrated for build and deployment purposes. Also I am a bit new to Jenkins, So if you could elaborate your answer, would be very helpful.