Balrog: Difference between revisions

Jump to navigation Jump to search
9 bytes removed ,  8 September 2016
Rework hacking section
(Rework hacking section)
Line 283: Line 283:
  git submodule init
  git submodule init
  git submodule update
  git submodule update
== Docker ==
You can run a complete Balrog environment locally with Docker, configured very similarly to production. You'll need Docker and Docker Compose installed; on Mac or Windows we require Docker for Mac/Docker for Windows v1.12 or higher. Then run the following in the root of the Balrog repo:
docker-compose up
Once it completes, you should be able to access
* the admin interface at [http://127.0.0.1:8080 http://127.0.0.1:8080]
* the public interface on port 9090, for example [http://127.0.0.1:9090/update/3/Firefox/33.0/20141202185629/Darwin_x86_64-gcc3-u-i386-x86_64/en-US/release/default/default/default/update.xml?force=1 http://127.0.0.1:9090/update/3/Firefox/33.0/20141202185629/Darwin_x86_64-gcc3-u-i386-x86_64/en-US/release/default/default/default/update.xml?force=1]
== UI hacking ==


If you want to hack on the UI, you'll also need to install some npm modules:
If you want to hack on the UI, you'll also need to install some npm modules:
Line 290: Line 300:
  cd ..
  cd ..


Whenever you make changes to the UI, you'll need to run a command to rebuild it:
To make code changes visible to docker you need to run:
  cd ui
  cd ui
  lineman build
  lineman build


Basic Balrog development and testing can be done on your local machine. It is recommended that you use Docker to test your changes, because it is configured very similar to production. How to use it, and the standalone applications, is described below.
lineman build minifies the js & css, which can make debugging more difficult, but you can use the ''run'' mode of lineman instead. First make sure docker-compose is up, then
 
cd ui
== Docker ==
lineman run
You can run a complete Balrog environment locally with Docker. Once you have Docker and Docker Compose installed (as well as Docker Machine if you're on Windows or Mac), run the following in the root of the Balrog repo:
The UI will be available at [http://127.0.0.1:8000 http://127.0.0.1:8000]. lineman will watch for changes to the source so you need only refresh the browser after saving your work.
docker-compose up
 
Once it completes, you should be able to access the admin interface with URLs such as [http://127.0.0.1:8080 http://127.0.0.1:8080], and the public interface with URLs such as [http://127.0.0.1:9090/update/3/Firefox/33.0/20141202185629/Darwin_x86_64-gcc3-u-i386-x86_64/en-US/release/default/default/default/update.xml?force=1 http://127.0.0.1:9090/update/3/Firefox/33.0/20141202185629/Darwin_x86_64-gcc3-u-i386-x86_64/en-US/release/default/default/default/update.xml?force=1]
 
If you're on Windows or Mac you'll need to replace 127.0.0.1 with the IP address of your Docker Machine VM, which can be discovered by running:
docker-machine ip default


== Unit Tests ==
== Unit Tests ==
Line 309: Line 313:
The recommended way to run backend tests is through Docker. Doing so will ensure your tests will run the same way they do in CI. To run them, use this command in the root of your Balrog repository:
The recommended way to run backend tests is through Docker. Doing so will ensure your tests will run the same way they do in CI. To run them, use this command in the root of your Balrog repository:
  ./run-tests.sh
  ./run-tests.sh
If you run Windows or OS X you'll need to do this from within the "Docker Quickstart Terminal".


If you can't or don't want to run tests within Docker for some reason, you can run them with directly with:
If you can't or don't want to run tests within Docker for some reason, you can run them with directly with:
  tox
  tox


Tests <em>emphasis</em> run fine on any posix-like environment, but are only run regularly within the Docker image, so it's possible to have failures that aren't related to Balrog code or your changes when running directly with tox.
Tests run fine on any posix-like environment, but are only run regularly within the Docker image, so it's possible to have failures that aren't related to Balrog code or your changes when running directly with tox.


=== Frontend ===
=== Frontend ===
To run the unit tests use:
To run the unit tests use:
<pre>
cd ui
lineman spec-ci
lineman spec-ci
</pre>
 
More options can be found in [https://github.com/mozbhearsum/balrog-ui/blob/master/README.md ui/README.md]


= Getting Involved =
= Getting Involved =
Confirmed users
4,293

edits

Navigation menu