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

Environment variable replacement on WINDOWS discard backslashes

      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.

       

          [JENKINS-44482] Environment variable replacement on WINDOWS discard backslashes

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

            abayer Andrew Bayer
            sophiag Sophia Guo
            Votes:
            4 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: