Optional tests (on by default) and better load order to reduce build time
This commit is contained in:
parent
492dcf4781
commit
6754131350
1 changed files with 14 additions and 6 deletions
20
Dockerfile
20
Dockerfile
|
@ -13,6 +13,7 @@ RUN apt-get install -y git python-virtualenv python-dev libjpeg8 libjpeg62 libjp
|
|||
|
||||
# Build the python dependencies
|
||||
ADD requirements.txt requirements.txt
|
||||
ADD external_libraries.py external_libraries.py
|
||||
RUN virtualenv --distribute venv
|
||||
RUN venv/bin/pip install -r requirements.txt # 01MAR2016
|
||||
RUN venv/bin/pip freeze
|
||||
|
@ -29,10 +30,8 @@ RUN npm install -g grunt-cli
|
|||
ADD grunt grunt
|
||||
RUN cd grunt && npm install
|
||||
|
||||
# Add all of the files!
|
||||
ADD . .
|
||||
|
||||
# Run grunt
|
||||
ADD static static
|
||||
RUN cd grunt && grunt
|
||||
|
||||
RUN apt-get remove -y --auto-remove python-dev g++ libjpeg62-dev libevent-dev libldap2-dev libsasl2-dev libpq-dev libffi-dev libgpgme11-dev nodejs npm
|
||||
|
@ -57,12 +56,21 @@ RUN venv/bin/python -m external_libraries
|
|||
RUN mkdir /usr/local/nginx/logs/
|
||||
|
||||
# TODO(ssewell): only works on a detached head, make work with ref
|
||||
RUN cat .git/HEAD > GIT_HEAD
|
||||
ADD .git/HEAD GIT_HEAD
|
||||
|
||||
# Add all of the files!
|
||||
ADD . .
|
||||
|
||||
# Run the tests
|
||||
RUN TEST=true venv/bin/python -m unittest discover -f
|
||||
RUN TEST=true venv/bin/python -m test.registry_tests -f
|
||||
ARG RUN_TESTS=true
|
||||
ENV RUN_TESTS ${RUN_TESTS}
|
||||
|
||||
RUN if [ "$RUN_TESTS" = true ]; then \
|
||||
TEST=true venv/bin/python -m unittest discover -f; \
|
||||
fi
|
||||
RUN if [ "$RUN_TESTS" = true ]; then \
|
||||
TEST=true venv/bin/python -m test.registry_tests -f; \
|
||||
fi
|
||||
RUN PYTHONPATH=. venv/bin/alembic heads | grep -E '^[0-9a-f]+ \(head\)$' > ALEMBIC_HEAD
|
||||
|
||||
VOLUME ["/conf/stack", "/var/log", "/datastorage", "/tmp", "/conf/etcd"]
|
||||
|
|
Reference in a new issue