diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..18f80f7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,2 @@ +FROM python:3.7 +RUN pip3 install --no-cache-dir pytest diff --git a/Jenkinsfile b/Jenkinsfile index f286073..2647595 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,26 +1,15 @@ pipeline { agent { - docker { - image 'python:3.7' - } - } - - environment { - HOME = "$WORKSPACE" + dockerfile true } stages { - stage('install dependencies') { - steps { - sh 'pip3 install --user pytest' - } - } stage('run tests') { steps { - sh '$HOME/.local/bin/pytest code/test.py' + sh 'pytest code/test.py' } } } }