From ee0ba116776b29eb62d50c5d1696402caf5a0e18 Mon Sep 17 00:00:00 2001 From: Kameron Kenny - pi501 Date: Fri, 27 Dec 2024 10:23:04 -0500 Subject: [PATCH] jenkins --- Jenkinsfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d7150c3..6a26333 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,7 +19,7 @@ pipeline { script { def status = sh(returnStatus: true, script: 'docker images | grep nagios | grep $(grep image docker-compose.yml | awk -F\':\' \'{ print $4 }\')') - if (status_p != 0) { + if (status != 0) { sh 'docker compose build --push' } else { echo "Primary Image version already exists, no need to rebuild." @@ -37,9 +37,9 @@ pipeline { stage('Stop container') { steps { script { - def status_s = sh(returnStatus: true, script: 'grep $(docker --context pi503 compose ps | tail -n1 | awk \'{ print $2 }\') docker-compose.yml') + def status = sh(returnStatus: true, script: 'grep $(docker --context pi503 compose ps | tail -n1 | awk \'{ print $2 }\') docker-compose.yml') - if (status_s != 0) { + if (status != 0) { sh 'docker --context pi503 compose down' sh 'sleep 5' } else { @@ -52,9 +52,9 @@ pipeline { stage('Start container') { steps { script { - def status_s = sh(returnStatus: true, script: 'grep $(docker --context pi503 compose ps | tail -n1 | awk \'{ print $2 }\') docker-compose.yml') + def status = sh(returnStatus: true, script: 'grep $(docker --context pi503 compose ps | tail -n1 | awk \'{ print $2 }\') docker-compose.yml') - if (status_s != 0) { + if (status != 0) { sh 'docker --context pi503 compose up -d' sh 'docker --context pi503 compose ps' } else {