fix logic?

This commit is contained in:
Kameron Kenny 2024-05-15 21:15:05 -04:00
parent f724099945
commit c66df27299
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') {
steps {
script {
def status_p = sh(returnStatus: true, script: 'grep $(docker compose images | tail -n1 | awk \'{ print $2 ":" $3 }\') docker-compose.yml')
def status_p = sh(returnStatus: true, script: 'grep $(docker compose ps | tail -n1 | awk \'{ print $2 }\') 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: 'grep $(docker compose images | tail -n1 | awk \'{ print $2 ":" $3 }\') docker-compose.yml')
def status_p = sh(returnStatus: true, script: 'grep $(docker compose ps | tail -n1 | awk \'{ print $2 }\') 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: 'grep $(docker --context pi502 compose images | tail -n1 | awk \'{ print $2 ":" $3 }\') docker-compose.yml')
def status_s = sh(returnStatus: true, script: 'grep $(docker --context pi502 compose ps | tail -n1 | awk \'{ print $2 }\') 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: 'grep $(docker --context pi502 compose images | tail -n1 | awk \'{ print $2 ":" $3 }\') docker-compose.yml')
def status_s = sh(returnStatus: true, script: 'grep $(docker --context pi502 compose ps | tail -n1 | awk \'{ print $2 }\') docker-compose.yml')
if (status_s != 0) {
sh 'docker --context pi502 compose up -d --no-color secondary'