fix logic.

This commit is contained in:
Kameron Kenny 2024-05-15 19:01:22 -04:00
parent 501f6bf150
commit f724099945
No known key found for this signature in database
GPG Key ID: E5006629839D2276
1 changed files with 4 additions and 4 deletions

8
Jenkinsfile vendored
View File

@ -38,7 +38,7 @@ pipeline {
stage('Stop primary container') { stage('Stop primary container') {
steps { steps {
script { 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 }\')') def status_p = sh(returnStatus: true, script: 'grep $(docker compose images | tail -n1 | awk \'{ print $2 ":" $3 }\') docker-compose.yml')
if (status_p != 0) { if (status_p != 0) {
sh 'docker compose down' sh 'docker compose down'
@ -53,7 +53,7 @@ pipeline {
stage('Start primary container') { stage('Start primary container') {
steps { steps {
script { 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 }\')') def status_p = sh(returnStatus: true, script: 'grep $(docker compose images | tail -n1 | awk \'{ print $2 ":" $3 }\') docker-compose.yml')
if (status_p != 0) { if (status_p != 0) {
sh 'docker compose down' sh 'docker compose down'
@ -75,7 +75,7 @@ pipeline {
stage('Stop secondary container') { stage('Stop secondary container') {
steps { steps {
script { 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 }\')') def status_s = sh(returnStatus: true, script: 'grep $(docker --context pi502 compose images | tail -n1 | awk \'{ print $2 ":" $3 }\') docker-compose.yml')
if (status_s != 0) { if (status_s != 0) {
sh 'docker --context pi502 compose down' sh 'docker --context pi502 compose down'
@ -90,7 +90,7 @@ pipeline {
stage('Start secondary container') { stage('Start secondary container') {
steps { steps {
script { 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 }\')') def status_s = sh(returnStatus: true, script: 'grep $(docker --context pi502 compose images | tail -n1 | awk \'{ print $2 ":" $3 }\') docker-compose.yml')
if (status_s != 0) { if (status_s != 0) {
sh 'docker --context pi502 compose up -d --no-color secondary' sh 'docker --context pi502 compose up -d --no-color secondary'