Update jenkinsfile

This commit is contained in:
2025-11-28 13:17:10 +00:00
parent f44ca08f6a
commit dd0478970b

View File

@@ -51,18 +51,19 @@ pipeline {
} }
} }
stage('Deployment') { stage('Deployment') {
steps { steps {
withEnv(["DOCKER_HOST=unix:///var/run/docker.sock"]) {
sh ''' sh '''
CONTAINERS=$(docker ps -a --filter "label=com.docker.compose.project=${COMPOSE_PROJECT}" -q || true) cd gameovergne-app2 # si ton repo est dans ce dossier
if [ -n "$CONTAINERS" ]; then
docker rm -f $CONTAINERS echo "=== Nettoyage de l'ancienne stack ==="
fi docker-compose down -v || true
echo "=== (Re)création de la stack MySQL + Spring + Angular ===" echo "=== (Re)création de la stack MySQL + Spring + Angular ==="
docker-compose up -d mysql spring angular docker-compose up -d mysql spring angular
''' '''
} }
} }
} }
} }