this is dumb.
This commit is contained in:
parent
0678450906
commit
93e4001b80
|
@ -38,6 +38,8 @@ 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 }\')')
|
||||||
|
|
||||||
if (status_p != 0) {
|
if (status_p != 0) {
|
||||||
sh 'docker compose down'
|
sh 'docker compose down'
|
||||||
sh 'sleep 5'
|
sh 'sleep 5'
|
||||||
|
@ -51,6 +53,8 @@ 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 }\')')
|
||||||
|
|
||||||
if (status_p != 0) {
|
if (status_p != 0) {
|
||||||
sh 'docker compose down'
|
sh 'docker compose down'
|
||||||
sh 'docker compose up -d --no-color primary'
|
sh 'docker compose up -d --no-color primary'
|
||||||
|
@ -71,6 +75,8 @@ 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 }\')')
|
||||||
|
|
||||||
if (status_s != 0) {
|
if (status_s != 0) {
|
||||||
sh 'docker --context pi502 compose down'
|
sh 'docker --context pi502 compose down'
|
||||||
sh 'sleep 5'
|
sh 'sleep 5'
|
||||||
|
@ -84,6 +90,8 @@ 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 }\')')
|
||||||
|
|
||||||
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'
|
||||||
sh 'docker --context pi502 compose ps'
|
sh 'docker --context pi502 compose ps'
|
||||||
|
|
Loading…
Reference in New Issue