We have requirement to select Environment from Jenkins UI to run the feature files.
Different Environment Options: QA, UAT, PROD
On the basis of the Environment selection from drop-down, all the available tenants i.e. different servers associated with that Environment should be visible.
To achieve above purpose I've used "Active Choices Parameter" for Environment.
- Name: "Environment"
- Groovy Script: return ['QA','UAT']
- Fallback Script: return['error']
- Choice Type: Single Select
To select the server or tenant on the basis of Environment selection, I've used "Active Choices Reactive Parameter"
- Name: Tenants
- Groovy Script:
return ['http://node-1.nginx.portal.daa-1.can.qa.aws.abc.net/login':'CAN','http://node-1.nginx.portal.daa-1.wan.qa.aws.abc.net/login':'WAN']
} else if (Environment.equals("UAT")) {
return ['https://can.uat.daa.app/login':'CANUAT','https://blic.uat.daa.app/login':'BLIC']
}
else if (Environment.equals("PROD")){
return ['http://node-1.nginx.portal.daa-1.can.qa.aws.abc.net/login':'CANPROD','http://node-1.nginx.portal.daa-1.blic.qa.aws.abc.net/login':'BLIC']
} else {
return ["Unknown"]
}
- Fallback Script: return['error']
- Choice Type: Single Select
After applying and saving this configuration, I'm getting ERROR in the Tenants drop-down. Seems making minor mistake but unable to catch it.