bump version, create 3 containers on different contexts.
This commit is contained in:
parent
f04b253449
commit
6bebb77cb5
|
@ -1,3 +1,4 @@
|
||||||
|
.DS_Store
|
||||||
_site
|
_site
|
||||||
.sass-cache
|
.sass-cache
|
||||||
.jekyll-metadata
|
.jekyll-metadata
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
FROM docker-registry1.in.thelinuxpro.net:5000/tlp/tlp_jekyll:0.0.1
|
FROM docker-registry1.in.thelinuxpro.net:5000/tlp/tlp_jekyll:0.0.1
|
||||||
|
|
||||||
LABEL version="0.0.4"
|
LABEL version="0.0.5"
|
||||||
LABEL image.author.name="Kameron Kenny"
|
LABEL image.author.name="Kameron Kenny"
|
||||||
LABEL image.author.email="kameron@localhost"
|
LABEL image.author.email="kameron@localhost"
|
||||||
LABEL description="A Jekyll site for kameronkenny.com."
|
LABEL description="A Jekyll site for kameronkenny.com."
|
||||||
|
|
|
@ -17,7 +17,7 @@ pipeline {
|
||||||
stage("Build Containers and push to registry") {
|
stage("Build Containers and push to registry") {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
sh 'docker build -t docker-registry1.in.thelinuxpro.net:5000/sites/kameronkenny.com:0.0.4 . --push'
|
sh 'docker build -t docker-registry1.in.thelinuxpro.net:5000/sites/kameronkenny.com:0.0.5 . --push'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ pipeline {
|
||||||
stage("Tag image as latest") {
|
stage("Tag image as latest") {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
sh 'docker tag docker-registry1.in.thelinuxpro.net:5000/sites/kameronkenny.com:0.0.4 docker-registry1.in.thelinuxpro.net:5000/sites/kameronkenny.com:latest'
|
sh 'docker tag docker-registry1.in.thelinuxpro.net:5000/sites/kameronkenny.com:0.0.5 docker-registry1.in.thelinuxpro.net:5000/sites/kameronkenny.com:latest'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,9 +37,101 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage("Start web1 container") {
|
|
||||||
|
stage("Create Contexts") {
|
||||||
steps {
|
steps {
|
||||||
sh 'docker compose up -d --no-color'
|
sh 'docker context ls | grep pi502 || docker context create pi502 --docker "host=ssh://pi502.in.thelinuxpro.net"'
|
||||||
|
sh 'docker context ls | grep pi503 || docker context create pi503 --docker "host=ssh://pi503.in.thelinuxpro.net"'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage("Stop pi501 web1 container") {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
def status = sh(returnStatus: true, script: 'grep $(docker compose ps | grep kameronkenny.com_web1 | teail -n1 | awk \'{ print $2 }\') docker-compose.yml')
|
||||||
|
|
||||||
|
if (status == 0) {
|
||||||
|
sh 'docker compose down'
|
||||||
|
sh 'sleep 5'
|
||||||
|
} else {
|
||||||
|
echo 'skip'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage("Start pi501 web1 container") {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
def status = sh(returnStatus: true, script: 'grep $(docker compose ps | grep kameronkenny.com_web1 | teail -n1 | awk \'{ print $2 }\') docker-compose.yml')
|
||||||
|
|
||||||
|
if (status != 0) {
|
||||||
|
sh 'docker compose up -d'
|
||||||
|
sh 'docker ps'
|
||||||
|
} else {
|
||||||
|
echo 'skip'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage("Stop pi502 web1 container") {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
def status = sh(returnStatus: true, script: 'grep $(docker --context pi502 compose ps | grep kameronkenny.com_web1 | teail -n1 | awk \'{ print $2 }\') docker-compose.yml')
|
||||||
|
|
||||||
|
if (status == 0) {
|
||||||
|
sh 'docker --context pi502 compose down'
|
||||||
|
sh 'sleep 5'
|
||||||
|
} else {
|
||||||
|
echo 'skip'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage("Start pi502 web1 container") {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
def status = sh(returnStatus: true, script: 'grep $(docker --context pi502 compose ps | grep kameronkenny.com_web1 | teail -n1 | awk \'{ print $2 }\') docker-compose.yml')
|
||||||
|
|
||||||
|
if (status != 0) {
|
||||||
|
sh 'docker --context pi502 compose up -d'
|
||||||
|
sh 'docker --context pi502 ps
|
||||||
|
} else {
|
||||||
|
echo 'skip'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage("Stop pi503 web1 container") {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
def status = sh(returnStatus: true, script: 'grep $(docker --context pi503 compose ps | grep kameronkenny.com_web1 | teail -n1 | awk \'{ print $2 }\') docker-compose.yml')
|
||||||
|
|
||||||
|
if (status == 0) {
|
||||||
|
sh 'docker --context pi503 compose down'
|
||||||
|
sh 'sleep 5'
|
||||||
|
} else {
|
||||||
|
echo 'skip'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage("Start pi503 web1 container") {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
def status = sh(returnStatus: true, script: 'grep $(docker --context pi503 compose ps | grep kameronkenny.com_web1 | teail -n1 | awk \'{ print $2 }\') docker-compose.yml')
|
||||||
|
|
||||||
|
if (status != 0) {
|
||||||
|
sh 'docker --context pi503 compose up -d'
|
||||||
|
sh 'docker --context pi503 ps
|
||||||
|
} else {
|
||||||
|
echo 'skip'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue