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

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

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: pipeline
    • Labels:
      None
    • Similar Issues:

      Description

      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())

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            CHANGES.md
            aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/IsUnixStepTest.java
            basic-steps/src/main/java/org/jenkinsci/plugins/workflow/steps/IsUnixStep.java
            basic-steps/src/main/resources/org/jenkinsci/plugins/workflow/steps/IsUnixStep/config.jelly
            basic-steps/src/main/resources/org/jenkinsci/plugins/workflow/steps/IsUnixStep/help.html
            http://jenkins-ci.org/commit/workflow-plugin/bbd1e838533601139b6daf2f255d456b5090b329
            Log:
            [FIXED JENKINS-31691] Added isUnix step.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: CHANGES.md aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/IsUnixStepTest.java basic-steps/src/main/java/org/jenkinsci/plugins/workflow/steps/IsUnixStep.java basic-steps/src/main/resources/org/jenkinsci/plugins/workflow/steps/IsUnixStep/config.jelly basic-steps/src/main/resources/org/jenkinsci/plugins/workflow/steps/IsUnixStep/help.html http://jenkins-ci.org/commit/workflow-plugin/bbd1e838533601139b6daf2f255d456b5090b329 Log: [FIXED JENKINS-31691] Added isUnix step.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            CHANGES.md
            aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/IsUnixStepTest.java
            basic-steps/src/main/java/org/jenkinsci/plugins/workflow/steps/IsUnixStep.java
            basic-steps/src/main/resources/org/jenkinsci/plugins/workflow/steps/IsUnixStep/config.jelly
            basic-steps/src/main/resources/org/jenkinsci/plugins/workflow/steps/IsUnixStep/help.html
            http://jenkins-ci.org/commit/workflow-plugin/3d60b260ee0c069aad72897fcce819923964ea69
            Log:
            Merge pull request #256 from jglick/isUnix-JENKINS-31691

            JENKINS-31691 isUnix step

            Compare: https://github.com/jenkinsci/workflow-plugin/compare/13a467c07203...3d60b260ee0c

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: CHANGES.md aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/IsUnixStepTest.java basic-steps/src/main/java/org/jenkinsci/plugins/workflow/steps/IsUnixStep.java basic-steps/src/main/resources/org/jenkinsci/plugins/workflow/steps/IsUnixStep/config.jelly basic-steps/src/main/resources/org/jenkinsci/plugins/workflow/steps/IsUnixStep/help.html http://jenkins-ci.org/commit/workflow-plugin/3d60b260ee0c069aad72897fcce819923964ea69 Log: Merge pull request #256 from jglick/isUnix- JENKINS-31691 JENKINS-31691 isUnix step Compare: https://github.com/jenkinsci/workflow-plugin/compare/13a467c07203...3d60b260ee0c
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/IsUnixStepTest.java
            basic-steps/src/main/java/org/jenkinsci/plugins/workflow/steps/IsUnixStep.java
            basic-steps/src/main/resources/org/jenkinsci/plugins/workflow/steps/IsUnixStep/config.jelly
            basic-steps/src/main/resources/org/jenkinsci/plugins/workflow/steps/IsUnixStep/help.html
            http://jenkins-ci.org/commit/workflow-basic-steps-plugin/bdc3bb92b17ad978bcc34f1033b9a160dcb99dcf
            Log:
            [FIXED JENKINS-31691] Added isUnix step.
            Originally-Committed-As: bbd1e838533601139b6daf2f255d456b5090b329

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/IsUnixStepTest.java basic-steps/src/main/java/org/jenkinsci/plugins/workflow/steps/IsUnixStep.java basic-steps/src/main/resources/org/jenkinsci/plugins/workflow/steps/IsUnixStep/config.jelly basic-steps/src/main/resources/org/jenkinsci/plugins/workflow/steps/IsUnixStep/help.html http://jenkins-ci.org/commit/workflow-basic-steps-plugin/bdc3bb92b17ad978bcc34f1033b9a160dcb99dcf Log: [FIXED JENKINS-31691] Added isUnix step. Originally-Committed-As: bbd1e838533601139b6daf2f255d456b5090b329
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/IsUnixStepTest.java
            http://jenkins-ci.org/commit/workflow-cps-plugin/01ad0a12129f710ed1076bd6610bb32a88fd1132
            Log:
            [FIXED JENKINS-31691] Added isUnix step.
            Originally-Committed-As: bbd1e838533601139b6daf2f255d456b5090b329

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/IsUnixStepTest.java http://jenkins-ci.org/commit/workflow-cps-plugin/01ad0a12129f710ed1076bd6610bb32a88fd1132 Log: [FIXED JENKINS-31691] Added isUnix step. Originally-Committed-As: bbd1e838533601139b6daf2f255d456b5090b329

              People

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

                Dates

                Created:
                Updated:
                Resolved: