Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
641 views
in Technique[技术] by (71.8m points)

node.js - how to run npm/grunt command from jenkins

I'm new to this area and was trying to run the following commands from jenkins:

npm install
grunt quickStart

So far I've a jenkins running on a window machine as a window service and I've also installed NodeJs plugin for jenkins.

However, I'm stuck and quit confused following instructions here, its asking me to to add one or mode nodeJs installation and I could not find those setting and not even sure if I even need them in the first place.

Here is the bit that's asking me to do: enter image description here

I cannot see this setting for the jenkins job I create. Is there an easy way to run those command in jenkins from a .bat or .sh script, a .bat would be recomended since I'm on window machine.

Note : I've already checked out a project using git in jenkins!!!

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

"its asking me to to add one or mode nodeJs installation and I could not find those setting and not even sure if I even need them in the first place."
I don't think you need that I have pointed jenkins to the node installation folder an nothing more.., for this you go to Manage Jenkins->Configure System->NodeJS->NodeJS installations.. type in any name you like and point to where the node home folder is.

node home directory ...cannot see this setting for the jenkins job I create...

Once you have configure that in your jenkins configuration you should have that configuration available like so:

node in project

...Is there an easy way to run those command in jenkins from a .bat or .sh script, a .bat would be recomended since I'm on window machine
I'm sorry don't get what commands are you referring to... so summarizing :

  1. you have to tell jenkins where you have your node installation
  2. use that configuration in your jobs

hope this helps...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...