Config file provider token replacement

133 views
Skip to first unread message

Sathyakumar Seshachalam

unread,
Nov 23, 2016, 4:06:29 AM11/23/16
to jenkins...@googlegroups.com
I have been trying to tokens in my config file replaced with Environment variables within a pipeline job.

Below is my JenkinsFile snippet 

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

Reply all
Reply to author
Forward
0 new messages