Stop and delete docke containers before running
testing/ogcore-api/pipeline/head There was a failure building this commit Details

pull/13/head
Nicolas Arenas 2024-11-20 18:04:41 +01:00
parent 38eb3775f1
commit 1e998c9a3a
1 changed files with 10 additions and 1 deletions

11
Jenkinsfile vendored
View File

@ -22,8 +22,17 @@ pipeline {
}
stage('Build Environment') {
steps {
sh """
if [ -z "$(docker ps -q)" ]; then
echo "Docker is not running"
else
echo "Docker is running"
fi
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
"""
script {
docker.build("${DOCKER_IDENTITY}", '-f docker/Dockerfile-jenkins-php .')
docker.build("${DOCKER_IDENTITY_NGINX}", '-f docker/Dockerfile-nginx .')
}