This commit is contained in:
Kameron Kenny - pi501 2024-12-27 10:23:04 -05:00
parent 1349822ff7
commit ee0ba11677
1 changed files with 5 additions and 5 deletions

10
Jenkinsfile vendored
View File

@ -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 {