Commit 2d9d065f authored by BorjaEst's avatar BorjaEst
Browse files

Run tox inside docker-pipeline

parent 396bc989
......@@ -22,7 +22,7 @@ LABEL maintainer='Borja Esteban'
ARG branch=python
# Which user and group to use
ARG user=worker
ARG user=application
ARG group=standard
# Install system updates and tools
......@@ -43,6 +43,7 @@ RUN git clone --depth 1 -b ${branch} https://github.com/BorjaEst/cicd.git app &&
cd app && \
pip3 install --no-cache-dir -e . && \
pip3 install --no-cache-dir gunicorn && \
pip3 install --no-cache-dir tox && \
# Clean up
rm -rf /root/.cache/pip/* && \
rm -rf /tmp/*
......@@ -57,7 +58,8 @@ EXPOSE 8080
# Change user context and drop root privileges
RUN groupadd -r ${group} && \
useradd --no-log-init -r -g ${group} ${user}
useradd --no-log-init -r -d /app -g ${group} ${user} && \
chown -R ${user} .
USER ${user}
# Start default script
......
......@@ -5,8 +5,7 @@ pipeline {
stage('Unit testing') {
steps {
echo '====================executing unittest================================'
echo 'Edit Jenkinsfile - Install test dependencies'
echo 'Edit Jenkinsfile - Trigger unittesting'
sh 'tox'
}
}
}
......
......@@ -4,7 +4,7 @@
# and then run "tox" from this directory.
[tox]
envlist = py37, py38
envlist = py38
[testenv]
deps =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment