I have been trying to tokens in my config file replaced with Environment variables within a pipeline job.
withEnv(['INSTANCE=Something']) {
configFileProvider(
[configFile(fileId: 'prescribe', variable: 'DEPLOY_FILE')]) {
sh "echo $env.INSTANCE"
sh "cat ${env.DEPLOY_FILE}"
}
}
And my config file provider file, I have tried possible combinations that came to my mind. Also tried adding a global parameter INSTANCE.
${ENV, var=INSTANCE}
${ENV.INSTANCE}
${env,var=INSTANCE}
${env, var=INSTANCE}
${INSTANCE}
None of the above seems to do the trick. And I have the file without replaced tokens.
Any help will be greatly appreciated