bump version, create 3 containers on different contexts.

This commit is contained in:
Kameron Kenny 2025-08-08 13:19:51 -04:00
parent f04b253449
commit 6bebb77cb5
3 changed files with 98 additions and 5 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
.DS_Store
_site
.sass-cache
.jekyll-metadata

View File

@ -1,6 +1,6 @@
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.email="kameron@localhost"
LABEL description="A Jekyll site for kameronkenny.com."

100
Jenkinsfile vendored
View File

@ -17,7 +17,7 @@ pipeline {
stage("Build Containers and push to registry") {
steps {
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") {
steps {
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 {
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'
}
}
}
}
}