Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 442151

Summary: Provide node.js stack for RAP HIPP instance
Product: Community Reporter: Tim Buschtoens <tbuschto>
Component: CI-JenkinsAssignee: CI Admin Inbox <ci.admin-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: denis.roy, mknauer, tbuschto, webmaster
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows NT   
Whiteboard:

Description Tim Buschtoens CLA 2014-08-20 06:08:16 EDT
In order to run JavaScript tests and validations we would need to run a Grunt[1] build, which requires node.js and some npm[2] packages (JsHint, Jasmine). Would it be possible to install these locally on the RAP HIPP server? 

[1] http://gruntjs.com/
[2] https://www.npmjs.org/
Comment 1 Eclipse Webmaster CLA 2014-08-20 09:31:19 EDT
I would suggest you install them on build.eclipse.org:/shared/common(which is shared with the HIPP servers as /opt/public/common) .  

-M.
Comment 2 Denis Roy CLA 2014-08-20 09:32:16 EDT
If someone on your project has shell access to build.eclipse.org, you can install these in /shared/common for everyone to use.  This location is accessible from all the Hudson and HIPP servers.

I already see these directories under /shared/common:
node-v0.10.18
node-v0.10.26
node-latest -> node-v0.10.26

So node-latest seems to be your best bet.
Comment 3 Markus Knauer CLA 2014-08-20 10:02:55 EDT
Yes, maybe this is a path forward... I tried a

 cd /shared/common/node-latest/bin
 export PATH=$PATH:$PWD
 npm install -g grunt-cli

and now there's the grunt executable in shared/common/node-latest/bin/grunt

Is this working for us, Tim?
Comment 4 Denis Roy CLA 2014-08-20 10:23:19 EDT
>  cd /shared/common/node-latest/bin
>  export PATH=$PATH:$PWD
>  npm install -g grunt-cli

If, for some reason your cd fails, you'll be adding $PWD to the $PATH (whatever $PWD may be at that time) and executing a potentially unknown "npm" executable.

May I suggest:

export PATH=$PATH:/shared/common/node-latest/bin

or

cd /shared/common/node-latest/bin && export PATH=$PATH:$PWD
Comment 5 Markus Knauer CLA 2014-08-20 10:55:00 EDT
(In reply to Denis Roy from comment #4)
> May I suggest:
> export PATH=$PATH:/shared/common/node-latest/bin

Sure... my own "snippet" was for myself documenting what I did (interactively). It wasn't meant for production or for use on the HIPP instance. :)
Comment 6 Tim Buschtoens CLA 2014-08-20 11:31:59 EDT
(In reply to Markus Knauer from comment #3)
> Is this working for us, Tim?

It should. I have submitted a Gruntfile to the rap repository root that checks our JS files with jshint. We can try with that. I guess the modules have to be installed before each build, i.e. 

npm install
grunt
Comment 7 Markus Knauer CLA 2014-08-20 12:14:41 EDT
We've been testing this approach in our RAP build and it seems to work pretty well.

Thanks! Closing as fixed.
Comment 8 Denis Roy CLA 2014-08-20 13:11:14 EDT
Thanks for closing the loop.