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

Variable from JSON in Pipeline outputs as temp file name

XMLWordPrintable

      Whenever I try to use a parameter from a JSON file I'm only getting the name of the temp file that is copied to the workspace. Here is an example of usage and output:

      configFileProvider([configFile(fileId: 'testFile', variable: 'TESTPARAM')]) {
      bat "echo $env.TESTPARAM"
      }

      The output from this is: 
      C:\jenkins\TrustJenkinsPipeline\workspace@tmp\config4843133872643832765tmp

      I have tried all of the following ways as well:
      bat "echo $TESTPARAM"
      bat "echo ${TESTPARAM}"
      bat "echo ${env.TESTPARAM}"
      bat "echo %TESTPARAM%"
      bat "echo %env.TESTPARAM%"

      All of them either return nothing or the same output as above.

      Here is the contents of 'testFile':
      {
      "TESTPARAM": "testValue"
      }

       

      I do not know if this is a bug or me doing it wrong, but so far I haven't had any luck figuring it out.

            domi Dominik Bartholdi
            jefff Jeff Fehringer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: