...
- Install Node.js from http://nodejs.org
Execute the following:
Code Block git clone https://git-wip-us.apache.org/repos/asf/ambari.git cd ambari/ambari-web npm install -g brunch rm -rf node_modules public npm install brunch build
Note: if you receive a "gyp + xcodebuild" error when running "npm install", confirm you have Xcode CLI tools installed (Xcode > Preferences > Downloads)
Note: if you receive "Error: EMFILE, open" errors when running "brunch build", increase the ulimit for file descriptors (for example, "ulimit -n 10000")
To run the web server in isolation with Ambari Server:
Code Block |
---|
brunch watch --server (or use the shorthand: brunch w -s)
|
...
We will use all default settings for Code Style in the IDE, except for the following:
Code Block |
---|
Go to Preferences
Code Style->General
Line separator (for new files): Unix
Make sure “Use tab character” is NOT checked
Tab size: 2
Indent: 2
Continuation indent: 2
Code Style->JavaScript:
Tabs and Indents
Make sure “use tab character” is NOT checked
Set Tab size, Indent, and Continuation indent to “2”.
Spaces->Other
Turn on “After name-value property separator ‘:’
|
...
Unit tests are written using Mocha and run with the PhantomJS headless browser.
To set your environment up for unit testing, run:
Code Block |
---|
npm install -g mocha-phantomjs phantomjs
|
Run unit tests via:
Code Block |
---|
cd ambari-web
mocha-phantomjs public/test/test.html
|
...