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

Environment variable not replaced in config file

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • FROM jenkins:2.46.1
      config-file-provider:2.15.7
       

      I'm trying  to  replace JENKINS_URL value inside .npmrc

      sass_binary_site=$JENKINS_URL/userContent/node-sass-binaries-master/

       

      But the environment variable never gets replaced into file contents, tested with:

      •   $ or ${}
      • Predefined or global configration declared variables
      • npmrc, maven settings and custom file

       

      pipeline{
          agent any
          stages{
              stage('test'){
              
                  steps{
                      configFileProvider( [configFile(fileId: "test-replace-set", variable: 'file')]){
                      script{
                          def text = readFile "${file}"
                          echo text
                      }
                      }
                      
                  }
              }    
                  
          }
      }

       

      Thanks,

      Nico

            domi Dominik Bartholdi
            nicolasus Nico Navarrete
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: