From 93e4001b8063bb1dc60df44cba09bd3dd69c641f Mon Sep 17 00:00:00 2001 From: Kameron Kenny <1267885+kkenny@users.noreply.github.com> Date: Wed, 15 May 2024 18:55:13 -0400 Subject: [PATCH] this is dumb. --- Jenkinsfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 7e925fd..b31c4d1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,6 +38,8 @@ pipeline { stage('Stop primary container') { steps { script { + def status_p = sh(returnStatus: true, script: 'docker images | grep bind9-primary | grep $(grep image docker-compose.yml | grep primary | awk -F\':\' \'{ print $4 }\')') + if (status_p != 0) { sh 'docker compose down' sh 'sleep 5' @@ -51,6 +53,8 @@ pipeline { stage('Start primary container') { steps { script { + def status_p = sh(returnStatus: true, script: 'docker images | grep bind9-primary | grep $(grep image docker-compose.yml | grep primary | awk -F\':\' \'{ print $4 }\')') + if (status_p != 0) { sh 'docker compose down' sh 'docker compose up -d --no-color primary' @@ -71,6 +75,8 @@ pipeline { stage('Stop secondary container') { steps { script { + def status_s = sh(returnStatus: true, script: 'docker images | grep bind9-secondary | grep $(grep image docker-compose.yml | grep secondary | awk -F\':\' \'{ print $4 }\')') + if (status_s != 0) { sh 'docker --context pi502 compose down' sh 'sleep 5' @@ -84,6 +90,8 @@ pipeline { stage('Start secondary container') { steps { script { + def status_s = sh(returnStatus: true, script: 'docker images | grep bind9-secondary | grep $(grep image docker-compose.yml | grep secondary | awk -F\':\' \'{ print $4 }\')') + if (status_s != 0) { sh 'docker --context pi502 compose up -d --no-color secondary' sh 'docker --context pi502 compose ps'