Jenkins: Build image inside empty directoy

This commit is contained in:
Tobias Gruetzmacher 2020-11-26 23:57:15 +01:00
parent ceb2641231
commit d0cc889a44

View file

@ -3,13 +3,15 @@
def prepareDocker () {
def img
stage('Prepare environment') {
def uid = sh returnStdout: true, script: 'id -u'
writeFile file: 'Dockerfile', text: """
FROM python:3.8-buster
RUN pip install pytest-cov PySocks && \\
useradd -m -u ${uid.trim()} jenkins
"""
img = docker.build('local:test-all-comics')
dir('.imagebuild') {
def uid = sh returnStdout: true, script: 'id -u'
writeFile file: 'Dockerfile', text: """
FROM python:3.8-buster
RUN pip install pytest-cov PySocks && \\
useradd -m -u ${uid.trim()} jenkins
"""
img = docker.build('local:test-all-comics')
}
}
return img
}