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

Environment variable replacement on WINDOWS discard backslashes

XMLWordPrintable

      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.

       

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

              Created:
              Updated:
              Resolved: