[HAP-1127] Support NodeJS plugin Created: 10/Jan/19  Updated: 24/Mar/19  Resolved: 16/Jan/19

Status: Resolved
Project: Jenkins Artifactory Plug-in
Component/s: None
Affects Version/s: 3.0.0
Fix Version/s: 3.1.0

Type: New Feature Priority: Normal
Reporter: Yahav Itzhak Assignee: Yahav Itzhak
Resolution: Fixed Votes: 0
Labels: None


 Description   

Support configuring node tool from nodejs plugin and using it in the npm pipeline steps.

def rtNpm = Artifactory.newNpmBuild()

rtNpm.tool = "NodeJS-10"



 Comments   
Comment by Girish [ 21/Mar/19 ]

Getting the error using rtNpm install. Not sure what should be path argument. 

/jenkins/workspace/myproject is the location of the Git pulled project and location of the package.json

Snipped in Jenkins job is as below

rtNpm.resolver server: artServer, repo: 'remote-npm-public'
rtNpm.tool = 'NodeJS11'
def buildInfo = rtNpm.install path:'.'

 

Getting error 

Cannot run program "npm" (in directory "/jenkins/workspace/myproject/."): error=2, No such file or directory [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline java.lang.RuntimeException: npm build failed at org.jfrog.hudson.pipeline.common.executors.NpmInstallExecutor.execute(NpmInstallExecutor.java:49) at org.jfrog.hudson.pipeline.scripted.steps.NpmInstallStep$Execution.run(NpmInstallStep.java:53) at org.jfrog.hudson.pipeline.scripted.steps.NpmInstallStep$Execution.run(NpmInstallStep.java:36) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47) at hudson.security.ACL.impersonate(ACL.java:290) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Finished: FAILURE

 

Can you help with correct path arguments? or is there any bug?

Comment by Yahav Itzhak [ 22/Mar/19 ]

Thanks for reporting this issue, Girish.

Please help us investigating this issue by specifying:

  1. Your Jenkins Artifactory plugin version.
  2. Does you clone your project before running "rtNpm.install"? I mean - Does "/jenkins/workspace/myproject/" exist?
  3. Have you configured "NodeJS11" tool properly in the Jenkins configuration?
Comment by Girish [ 22/Mar/19 ]

Please find response below

  1. Your Jenkins Artifactory plugin version. --> 3.0.0
  2. Does you clone your project before running "rtNpm.install"? I mean - Does "/jenkins/workspace/myproject/" exist? --> Yes, project is cloned. We run sh "ls -al" and the folder structure is displayed in Jenkins log
  3. Have you configured "NodeJS11" tool properly in the Jenkins configuration? --> Yes, this is configured in Jenkins - Yes, please refer below
  4. Unable to render embedded object: File (image-2019-03-22-11-39-39-212.png) not found.
Comment by Yahav Itzhak [ 22/Mar/19 ]

This feature introduced in 3.1.0 (See the fix version of this ticket) and stabilized in 3.1.1.

Please upgrade to the latest version (Currently 3.2.1).

We'll appreciate your feedback for that.

Comment by Girish [ 22/Mar/19 ]

Thanks for quick response. However we cannot see 3.1.1 in the Cloudbees Jenkins plugin center. We might have to wait for Cloudbees to make it available

Comment by Girish [ 22/Mar/19 ]

Current installed version of Cloudbees Jenkins is 2.138.1.2 Does this support Plugin 3.1.1?

Comment by Yahav Itzhak [ 24/Mar/19 ]

[here|http://updates.jenkins-ci.org/download/plugins/artifactory] you can find all versions of Jenkins Artifactory plugin.

However, you are strongly recommended to download the latest through Cloudbees Jenkins plugin center.

Generated at Sun Oct 20 05:53:04 UTC 2019 using JIRA 7.6.16#76018-sha1:9ed376192612a49536ac834c64177a0fed6290f5.