How can I use different private docker agents based on parameter in Jenkins declarative pipeline?
问题 I am trying to choose a different docker agent from a private container registry based on an a parameter in Jenkins pipeline. For my example let's say I have 'credsProd' and 'credsTest' saved in the credentials store. My attempt is as follows: pipeline { parameters { choice( name: 'registrySelection', choices: ['TEST', 'PROD'], description: 'Is this a deployment to STAGING or PRODUCTION environment?' ) } environment { URL_VAR = "${env.registrySelection == "PROD" ? "urlProd.azure.io" :