Use unprivileged docker image.

This commit is contained in:
s3lph 2018-06-19 22:54:07 +02:00
parent b06c54e782
commit 17fe381402
2 changed files with 12 additions and 10 deletions

View file

@ -1,5 +1,5 @@
--- ---
image: debian:buster image: s3lph/matemat:20180619-01
stages: stages:
- test - test
@ -8,21 +8,13 @@ stages:
test: test:
stage: test stage: test
script: script:
- useradd matemat
- chmod o+rw -R .
- apt-get update -qy
- apt-get install -y --no-install-recommends python3-dev python3-pip python3-coverage python3-setuptools build-essential
- pip3 install wheel
- pip3 install -r requirements.txt - pip3 install -r requirements.txt
- su - matemat -c 'python3-coverage run --branch -m unittest discover matemat' - python3-coverage run --branch -m unittest discover matemat
- python3-coverage report -m --include 'matemat/*' --omit '*/test_*.py' - python3-coverage report -m --include 'matemat/*' --omit '*/test_*.py'
codestyle: codestyle:
stage: codestyle stage: codestyle
script: script:
- apt-get update -qy
- apt-get install -y --no-install-recommends python3-dev python3-pip python3-coverage python3-setuptools build-essential
- pip3 install wheel pycodestyle mypy
- pip3 install -r requirements.txt - pip3 install -r requirements.txt
- pycodestyle matemat - pycodestyle matemat
# - mypy --ignore-missing-imports --strict -p matemat # - mypy --ignore-missing-imports --strict -p matemat

10
Dockerfile Normal file
View file

@ -0,0 +1,10 @@
FROM debian:buster
RUN useradd -d /home/matemat -m matemat
RUN apt-get update -qy
RUN apt-get install -y --no-install-recommends python3-dev python3-pip python3-coverage python3-setuptools build-essential
RUN pip3 install wheel pycodestyle mypy
WORKDIR /home/matemat
USER matemat