Remove docker instructions and build:docker helper command

The docker instructions and build:docker helper command were put in
place when we first started working on this stack to try to reduce the
burden on people from the new toolchain. However, build:docker results
in root-owned files in zuul/web/static, and in general is complex and
fragile for not very much benefit now that nodeenv is in place for tox
runs.

The docker instructions in the docs, as well as the instructions for
people with old npm are similarly removed, as nodeenv handles these
cases as well.

In general, we should be encouraging people to get familiar with the
tools rather than hiding them.

Change-Id: I931d1101e025ba1236f4abc1d5e088ba5d113a5a
This commit is contained in:
Monty Taylor 2018-04-10 12:28:34 -05:00
parent 6f6c3e870f
commit b6d99e4416
2 changed files with 4 additions and 35 deletions

View File

@ -15,46 +15,16 @@ For the impatient who don't want deal with javascript toolchains
tl;dr - You have to build stuff with javascript tools.
The best thing would be to get familiar with the tools, there are a lot of
good features available. But, if you don't want to know anything about the
Javascript toolchains a few helpers have been provided.
good features available. If you're going to hack on the Javascript, you should
get to know them.
tox
~~~
If you don't want to hack on Javascript and just want to run Zuul's tests,
``tox`` has been set up to handle it for you.
If you do not have `yarn`_ installed, ``tox`` will use `nodeenv`_ to install
node into the active python virtualenv, and then will install `yarn`_ into
that virtualenv as well.
npm + docker
~~~~~~~~~~~~
.. We should remove the build:docker command. If you have npm, you can
npm install yarn.
If you have npm and docker installed and don't want to install newer nodejs
or a bunch of javascript libraries, you can run:
.. code-block:: bash
npm run build:docker
docker
~~~~~~
If you have docker but do not have npm or nodejs installed, you can build
the web app with:
.. code-block:: bash
docker run -it --rm -v ${PWD}:/usr/src/app:z -w /usr/src/app node:alpine \
npm run build:dist-with-depends
Both do the same thing. Both versions will result in the built files being
put into ``zuul/web/static``.
.. note:: Because the user inside of the Docker container is root, the files
that it emits into zuul/web/static will be owned by root.
yarn dependency management
--------------------------

View File

@ -22,7 +22,6 @@
"build": "npm run build:dist",
"build:dev": "webpack --env=dev",
"build:dist": "webpack --env=prod",
"build:docker": "docker run -it --rm -v $(pwd):/usr/src/app:z -w /usr/src/app node:alpine npm run build:dist-with-depends",
"build:dist-with-depends": "yarn install && npm run build:dist",
"format": "eslint --fix web/*.js",
"lint": "webpack --env=lint",