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

PATH value is being overwritten in declarative pipeline syntax

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Component/s: nodejs-plugin
    • Labels:
      None
    • Similar Issues:

      Description

      Declarative pipeline example:

      pipeline {
          agent any
          
          stages {
              stage('Without NPM'){
                  steps {
                      echo PATH
                  }
              }
              
              stage('With NPM'){
                  tools {
                      nodejs 'Node v6'
                  }
                  steps {
                      echo PATH
                  }
              }
          }
      }
      

      Output

      [Pipeline] node
      Running on master in /data/jenkins/workspace/_playground
      [Pipeline] {
      [Pipeline] stage
      [Pipeline] { (Without NPM)
      [Pipeline] echo
      /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] stage
      [Pipeline] { (With NPM)
      [Pipeline] tool
      [Pipeline] envVarsForTool
      [Pipeline] withEnv
      [Pipeline] {
      [Pipeline] echo
      /data/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/Node_v6/bin
      [Pipeline] }
      [Pipeline] // withEnv
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      Finished: SUCCESS
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                nfalco Nikolas Falco
                Reporter:
                catufunwa Chima Atufunwa
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: