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

Environment variable replacement on WINDOWS discard backslashes

    Details

    • Epic Link:
    • Similar Issues:

      Description

      Using Declarative Pipeline set environment:

          environment {

                      TEST="$WORKSPACE/test"

                      ...

                      SPEC='linux_x86-64'

                      }

      works fine on linux.

      On Windows 
      WORKSPACE=C:\Users\jenkins\workspace\openjdk_test_x86-64_windows
      TEST will be C:Usersjenkinsworkspaceopenjdk_test_x86-64_windows/test. That is saying passing $WORKSPACE to toString() return discard all backslashes.

      Tried using slash string TEST=/$WORKSPACE/ +'/test' got same issue.

       

        Attachments

          Issue Links

            Activity

            sophiag Sophia Guo created issue -
            sophiag Sophia Guo made changes -
            Field Original Value New Value
            Epic Link JENKINS-35390 [ 171183 ]
            abayer Andrew Bayer made changes -
            Component/s pipeline-model-definition-plugin [ 21706 ]
            Component/s pipeline [ 21692 ]
            abayer Andrew Bayer made changes -
            Labels pipeline windows declarative-variable-and-method-resolution pipeline windows
            abayer Andrew Bayer made changes -
            Assignee Andrew Bayer [ abayer ]
            jamesdumay James Dumay made changes -
            Epic Link JENKINS-35390 [ 171183 ] JENKINS-45422 [ 183590 ]
            abayer Andrew Bayer made changes -
            Link This issue depends on JENKINS-42753 [ JENKINS-42753 ]
            abayer Andrew Bayer made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                sophiag Sophia Guo
              • Votes:
                4 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: