From 0a783938e75c0b611a2d88ee95ab0b05b8c9db9d Mon Sep 17 00:00:00 2001 From: Francia Csaba Date: Thu, 11 Jan 2024 12:59:35 +0100 Subject: [PATCH] #13 Test running commands inside container --- Jenkinsfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 7104ffa..78b0b0a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,6 +20,20 @@ pipeline { } } } + stage('Run tests on image'){ + steps{ + docker.image("${OWNER}/${IMAGE_NAME}:${TAG}").inside( + '--rm --name amarillo -p 8000:80 -e MODULE_NAME=amarillo.app.main -e MAX_WORKERS=1 -e ADMIN_TOKEN=test -e RIDE2GO_TOKEN=test -e METRICS_USER=test -e METRICS_PASSWORD=test -e TZ=Europe/Berlin -v $(pwd)/data:/app/data' + ){ + // TODO: wait until the API is up + c -> sh script: """ + sleep 10 + echo Testing... + pytest + """ + } + } + } stage('Push image to container registry') { steps { echo 'Pushing image to registry'