fix logic.
This commit is contained in:
parent
501f6bf150
commit
f724099945
|
@ -38,7 +38,7 @@ 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 }\')')
|
||||
def status_p = sh(returnStatus: true, script: 'grep $(docker compose images | tail -n1 | awk \'{ print $2 ":" $3 }\') docker-compose.yml')
|
||||
|
||||
if (status_p != 0) {
|
||||
sh 'docker compose down'
|
||||
|
@ -53,7 +53,7 @@ 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 }\')')
|
||||
def status_p = sh(returnStatus: true, script: 'grep $(docker compose images | tail -n1 | awk \'{ print $2 ":" $3 }\') docker-compose.yml')
|
||||
|
||||
if (status_p != 0) {
|
||||
sh 'docker compose down'
|
||||
|
@ -75,7 +75,7 @@ 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 }\')')
|
||||
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) {
|
||||
sh 'docker --context pi502 compose down'
|
||||
|
@ -90,7 +90,7 @@ 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 }\')')
|
||||
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) {
|
||||
sh 'docker --context pi502 compose up -d --no-color secondary'
|
||||
|
|
Loading…
Reference in New Issue