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

nodejs installer not compatible with declarative pipeline definition

      The following pipeline does not work, as NodeJSInstallation seems not to add node and npm to the classpath.

      pipeline {
      
        tools {
          "jenkins.plugins.nodejs.tools.NodeJSInstallation" "NodeJS_0.10.33"
        }
      
        agent any
        stages {
      
          stage ('test') {
            steps {
                sh "node --version"
                sh "npm --version"
            }
          }
        }
      }
      

          [JENKINS-40624] nodejs installer not compatible with declarative pipeline definition

          Code changed in jenkins
          User: imod
          Path:
          .gitignore
          pom.xml
          src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstallation.java
          http://jenkins-ci.org/commit/nodejs-plugin/be52194cef302939c52c7cae74fa45f25ca66588
          Log:
          JENKINS-40624 add @Symbol(“nodejs”) and populate environment

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: imod Path: .gitignore pom.xml src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstallation.java http://jenkins-ci.org/commit/nodejs-plugin/be52194cef302939c52c7cae74fa45f25ca66588 Log: JENKINS-40624 add @Symbol(“nodejs”) and populate environment

          Code changed in jenkins
          User: Nikolas Falco
          Path:
          src/main/java/jenkins/plugins/nodejs/NodeJSCommandInterpreter.java
          src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstaller.java
          http://jenkins-ci.org/commit/nodejs-plugin/097f82206db79cee497dbe2ee9cde4387ec90b0c
          Log:
          JENKINS-40624 Add @Symbol annotation to installer from nodejs.org and command interpreter build step

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nikolas Falco Path: src/main/java/jenkins/plugins/nodejs/NodeJSCommandInterpreter.java src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstaller.java http://jenkins-ci.org/commit/nodejs-plugin/097f82206db79cee497dbe2ee9cde4387ec90b0c Log: JENKINS-40624 Add @Symbol annotation to installer from nodejs.org and command interpreter build step

          Code changed in jenkins
          User: Nikolas Falco
          Path:
          pom.xml
          src/main/java/jenkins/plugins/nodejs/NodeJSBuildWrapper.java
          src/main/java/jenkins/plugins/nodejs/NodeJSCommandInterpreter.java
          src/main/java/jenkins/plugins/nodejs/NodeJSUtils.java
          src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstallation.java
          src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstaller.java
          src/test/java/jenkins/plugins/nodejs/NpmrcFileSupplyTest.java
          src/test/java/jenkins/plugins/nodejs/configfiles/RegistryHelperTest.java
          http://jenkins-ci.org/commit/nodejs-plugin/1227d93dcff701ca9ee397f2d5c0b1c6eb4e262d
          Log:
          JENKINS-40624 Rework of installer to support pipeline, dsl unit test does not works.

          Compare: https://github.com/jenkinsci/nodejs-plugin/compare/05c09668e6a4...1227d93dcff7

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nikolas Falco Path: pom.xml src/main/java/jenkins/plugins/nodejs/NodeJSBuildWrapper.java src/main/java/jenkins/plugins/nodejs/NodeJSCommandInterpreter.java src/main/java/jenkins/plugins/nodejs/NodeJSUtils.java src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstallation.java src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstaller.java src/test/java/jenkins/plugins/nodejs/NpmrcFileSupplyTest.java src/test/java/jenkins/plugins/nodejs/configfiles/RegistryHelperTest.java http://jenkins-ci.org/commit/nodejs-plugin/1227d93dcff701ca9ee397f2d5c0b1c6eb4e262d Log: JENKINS-40624 Rework of installer to support pipeline, dsl unit test does not works. Compare: https://github.com/jenkinsci/nodejs-plugin/compare/05c09668e6a4...1227d93dcff7

          Robert Watts added a comment -

          Hello, thanks for progress on this.. hoping PR will be merged soon?

          Robert Watts added a comment - Hello, thanks for progress on this.. hoping PR will be merged soon?

          Code changed in jenkins
          User: Nikolas Falco
          Path:
          pom.xml
          src/main/java/jenkins/plugins/nodejs/NodeJSBuildWrapper.java
          src/main/java/jenkins/plugins/nodejs/NodeJSCommandInterpreter.java
          src/main/java/jenkins/plugins/nodejs/NodeJSUtils.java
          src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstallation.java
          src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstaller.java
          src/test/java/jenkins/plugins/nodejs/NpmrcFileSupplyTest.java
          src/test/java/jenkins/plugins/nodejs/configfiles/RegistryHelperTest.java
          src/test/resources/jenkins/plugins/nodejs/dsl/NodeJSBuild.pipeline
          src/test/resources/jenkins/plugins/nodejs/dsl/NodeJSInstallation.pipeline
          http://jenkins-ci.org/commit/nodejs-plugin/cebb2bc6e8077bb9e1816d32d1ac7f6ce7c35188
          Log:
          JENKINS-40624 Add @Symbol annotation to builder wrapper.
          Rework of installer to support pipeline (Computer.currectComputer returns always null).
          Provide some DSL sample to use in the future with unit test (current version of jenkins does not support pipeline).
          Like other plugin does we add support to pipeline adding @Symbol annotation but version of jenkins is that one defined in the parent pom to support older versions.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nikolas Falco Path: pom.xml src/main/java/jenkins/plugins/nodejs/NodeJSBuildWrapper.java src/main/java/jenkins/plugins/nodejs/NodeJSCommandInterpreter.java src/main/java/jenkins/plugins/nodejs/NodeJSUtils.java src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstallation.java src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstaller.java src/test/java/jenkins/plugins/nodejs/NpmrcFileSupplyTest.java src/test/java/jenkins/plugins/nodejs/configfiles/RegistryHelperTest.java src/test/resources/jenkins/plugins/nodejs/dsl/NodeJSBuild.pipeline src/test/resources/jenkins/plugins/nodejs/dsl/NodeJSInstallation.pipeline http://jenkins-ci.org/commit/nodejs-plugin/cebb2bc6e8077bb9e1816d32d1ac7f6ce7c35188 Log: JENKINS-40624 Add @Symbol annotation to builder wrapper. Rework of installer to support pipeline (Computer.currectComputer returns always null). Provide some DSL sample to use in the future with unit test (current version of jenkins does not support pipeline). Like other plugin does we add support to pipeline adding @Symbol annotation but version of jenkins is that one defined in the parent pom to support older versions.

          Nikolas Falco added a comment - - edited

          Current pipeline DSL supported are for:

          • nodejs tool definition
            pipeline {
                agent any
            
                tools {
                    nodejs 'Node 6.x'
                }
            
                stages {
                    stage('Build') {
                        steps {
                            sh 'npm -version'
                        }
                    }
                }
            }
            
          • and nodejs build step
            pipeline {
                agent any
            
                stages {
                    stage('Build') {
                        steps {
                            nodejs(nodeJSInstallationName: 'Node 6.x', configId: null) {
                                sh 'npm config ls'
                            }
                        }
                    }
                }
            }
            

          robwatts the code was merged in master.
          Before it is released could anyone provides feedback?
          A mvn clean package is sufficient to create a snapshot from source code

          Nikolas Falco added a comment - - edited Current pipeline DSL supported are for: nodejs tool definition pipeline { agent any tools { nodejs 'Node 6.x' } stages { stage('Build') { steps { sh 'npm -version' } } } } and nodejs build step pipeline { agent any stages { stage('Build') { steps { nodejs(nodeJSInstallationName: 'Node 6.x', configId: null) { sh 'npm config ls' } } } } } robwatts the code was merged in master. Before it is released could anyone provides feedback? A mvn clean package is sufficient to create a snapshot from source code

          Code changed in jenkins
          User: Nikolas Falco
          Path:
          src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstallation.java
          src/test/java/jenkins/plugins/nodejs/NpmrcFileSupplyTest.java
          http://jenkins-ci.org/commit/nodejs-plugin/15db7f5faf3a6fbb3a558f0150684b88654eb6e1
          Log:
          JENKINS-40624 Fix test case, miss to remove assert on environment

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nikolas Falco Path: src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstallation.java src/test/java/jenkins/plugins/nodejs/NpmrcFileSupplyTest.java http://jenkins-ci.org/commit/nodejs-plugin/15db7f5faf3a6fbb3a558f0150684b88654eb6e1 Log: JENKINS-40624 Fix test case, miss to remove assert on environment

          Code changed in jenkins
          User: Nikolas Falco
          Path:
          src/main/java/jenkins/plugins/nodejs/NodeJSCommandInterpreter.java
          src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstallation.java
          src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstaller.java
          src/test/java/jenkins/plugins/nodejs/NodeJSInstallerTest.java
          http://jenkins-ci.org/commit/nodejs-plugin/8a3cfc8079711395159d966e375e2cf2955fcd1f
          Log:
          Fix regression of JENKINS-40624

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nikolas Falco Path: src/main/java/jenkins/plugins/nodejs/NodeJSCommandInterpreter.java src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstallation.java src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstaller.java src/test/java/jenkins/plugins/nodejs/NodeJSInstallerTest.java http://jenkins-ci.org/commit/nodejs-plugin/8a3cfc8079711395159d966e375e2cf2955fcd1f Log: Fix regression of JENKINS-40624

          Code changed in jenkins
          User: Nikolas Falco
          Path:
          src/main/java/jenkins/plugins/nodejs/NodeJSCommandInterpreter.java
          src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstallation.java
          http://jenkins-ci.org/commit/nodejs-plugin/240e4dd95a0db65453e7c11ccd350900973dc403
          Log:
          Fix regression of JENKINS-40624 in path construction of executable and bin folder because all API similar to java.lang.File have to be wrapped in a callable executed on the target node or paths will be calculated based on the master node O.S.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nikolas Falco Path: src/main/java/jenkins/plugins/nodejs/NodeJSCommandInterpreter.java src/main/java/jenkins/plugins/nodejs/tools/NodeJSInstallation.java http://jenkins-ci.org/commit/nodejs-plugin/240e4dd95a0db65453e7c11ccd350900973dc403 Log: Fix regression of JENKINS-40624 in path construction of executable and bin folder because all API similar to java.lang.File have to be wrapped in a callable executed on the target node or paths will be calculated based on the master node O.S.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          COMPATIBILITY.md
          http://jenkins-ci.org/commit/pipeline-plugin/ddf73bebcafd7bca9293f28b8fa84a0d7bda478b
          Log:
          Merge pull request #430 from nfalco79/master

          JENKINS-40624 Update COMPATIBILITY.md to update NodeJS plugin

          Compare: https://github.com/jenkinsci/pipeline-plugin/compare/b293156039a2...ddf73bebcafd

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: COMPATIBILITY.md http://jenkins-ci.org/commit/pipeline-plugin/ddf73bebcafd7bca9293f28b8fa84a0d7bda478b Log: Merge pull request #430 from nfalco79/master JENKINS-40624 Update COMPATIBILITY.md to update NodeJS plugin Compare: https://github.com/jenkinsci/pipeline-plugin/compare/b293156039a2...ddf73bebcafd

            nfalco Nikolas Falco
            imod Dominik Bartholdi
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: