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