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

add a step to determine if the current node is windows or not.

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • pipeline
    • None

      it is often usefull in reusable code to know if you are running on a windows slave or not.

      For example you may want to invoke maven - but on windows you need bat 'mvn ...' and Unix like systems sh ' mvn...'

      The current workaround involves a function like

      boolean isWindows() {
          return env.OS == 'Windows_NT'
      }
      

      but this is not ideal.

      so please implement something that can be more reliable to determine a windows node. (get the path separator, directory seporator - or just isCurrentNodeWindows())

          [JENKINS-31691] add a step to determine if the current node is windows or not.

          James Nord created issue -
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-26169 [ JENKINS-26169 ]
          Jesse Glick made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Jesse Glick made changes -
          Remote Link New: This issue links to "PR 256 (Web Link)" [ 13543 ]
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 167129 ] New: JNJira + In-Review [ 198122 ]
          Andrew Bayer made changes -
          Component/s New: pipeline-general [ 21692 ]
          Andrew Bayer made changes -
          Component/s Original: workflow-plugin [ 18820 ]

            jglick Jesse Glick
            teilo James Nord
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: