Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-39998

Token expansion of a config file not happening

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • Jenkins version : 2.7.1
      Config file provider plugin : 2.13

      I have a config file with some tokens that I expected to be replaced when used with a buildWrapper. But this did not work for me. My pipeline reads like

      node {
          checkout scm
          withEnv(['INSTANCE=Something']) {
              configFileProvider(
                  [configFile(fileId: 'prescribe', variable: 'DEPLOY_FILE')]) {
                  sh "echo $env.INSTANCE" 
                  sh "cat ${env.DEPLOY_FILE}"
              }
          }
      }
      

      And my 'prescribe' id'ed file looks like

      ${INSTANCE}
      ${branch}
      
      ${ENV, var=INSTANCE}
      
      ${ENV.INSTANCE}
      ${ENV,INSTANCE}
      
      ${env, var=INSTANCE}
      

      However the file does not come out as token replaced. I have also tried providing INSTANCE as a global password and global variable with the same result

            domi Dominik Bartholdi
            sathyakumars Sathyakumar Seshachalam
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: