2013-09-18 01:55:44 +04:00
Installation
============
2015-02-18 17:00:43 +03:00
You can work on the UI without needing a VM, by using web-server.js.
2015-05-18 17:47:06 +03:00
There are a few limitations, since URL rewriting is not supported (and so some links will be broken), but it works well enough for quick testing. For instructions on how to serve the UI with working URL rewriting, see the Vagrant instructions.
2013-09-18 01:55:44 +04:00
2015-02-18 17:00:43 +03:00
Cloning the Repo
----------------
2015-05-18 17:47:06 +03:00
* Clone the `treeherder repo`_ from Github.
2013-09-18 01:55:44 +04:00
Requirements
------------
2015-02-18 17:00:43 +03:00
* Node.js_
2013-09-18 01:55:44 +04:00
2015-02-18 17:00:43 +03:00
Running the web-server
----------------------
2013-09-18 01:55:44 +04:00
2015-02-18 17:00:43 +03:00
* Open a shell, cd into the root of the repository you just cloned and type:
2013-09-18 01:55:44 +04:00
2015-02-18 17:00:43 +03:00
.. code-block :: bash
2013-09-18 01:55:44 +04:00
2015-05-18 18:00:59 +03:00
cp ui/js/config/sample.local.conf.js ui/js/config/local.conf.js
./web-server.js
2013-09-18 01:55:44 +04:00
2015-02-18 17:00:43 +03:00
Viewing the UI
--------------
2013-09-18 01:55:44 +04:00
2015-02-18 17:00:43 +03:00
Once the server is running, you can navigate to:
2015-05-18 18:38:56 +03:00
`<http://localhost:8000/index.html>`_
2013-09-18 01:55:44 +04:00
2015-02-18 17:00:43 +03:00
Configuration
=============
The sample configuration makes the UI load job/push data from the production service API. If you wish to test the UI against stage/dev's service instead, adjust `` thServiceDomain `` in the config file created as part of installation:
2015-05-18 18:00:59 +03:00
`` ui/js/config/local.conf.js ``
2015-02-18 17:00:43 +03:00
If you wish to run the full treeherder-service Vagrant project (service + UI), remember to remove local.conf.js or else change `` thServiceDomain `` within it to refer to `` vagrant `` , so the UI will use the local Vagrant service API.
2013-09-18 01:55:44 +04:00
Running the unit tests
======================
The unit tests run with Karma: http://karma-runner.github.io/0.8/config/configuration-file.html
Requirements
------------
2015-02-18 17:00:43 +03:00
* Node.js_
2013-09-18 01:55:44 +04:00
* karma: `` sudo npm install -g karma ``
Execution::
2015-05-18 18:00:59 +03:00
./tests/ui/scripts/test.sh
2013-09-18 01:55:44 +04:00
2014-04-25 20:04:06 +04:00
Build
2015-02-18 17:00:43 +03:00
=====
2015-03-27 18:15:55 +03:00
* Install grunt `` sudo npm install grunt-cli -g ``
* Install the `` devDependencies `` in `` package.json `` by running `` npm install `` from the project root
2015-05-18 17:47:06 +03:00
* Run the following command in the repo root:
2014-04-25 20:04:06 +04:00
Build::
grunt build
2015-05-18 17:47:06 +03:00
This will create a `` dist `` directory in the repo root, where concatenated and minified js, css, and application assets can be served from.
2013-09-18 01:55:44 +04:00
2015-05-18 17:47:06 +03:00
.. _treeherder repo: https://github.com/mozilla/treeherder
2015-02-18 17:00:43 +03:00
.. _Node.js: http://nodejs.org/download/