Compare commits
No commits in common. "6c98db347369c3ddf9232da22c44a71156a64884" and "8f3d69ef5671480d8f685e3b2934f47739a49fef" have entirely different histories.
6c98db3473
...
8f3d69ef56
|
@ -1,115 +1,84 @@
|
||||||
pipeline {
|
pipeline {
|
||||||
agent {
|
agent {
|
||||||
label 'pi501.in.thelinuxpro.net'
|
label 'pi501.in.thelinuxpro.net'
|
||||||
}
|
|
||||||
|
|
||||||
stages {
|
|
||||||
stage("verify tooling") {
|
|
||||||
steps {
|
|
||||||
sh '''
|
|
||||||
docker version
|
|
||||||
docker info
|
|
||||||
docker compose version
|
|
||||||
'''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage("Build Containers and push to registry") {
|
|
||||||
steps {
|
|
||||||
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 }\')')
|
|
||||||
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_p != 0) {
|
|
||||||
sh 'docker compose build primary --push'
|
|
||||||
} else {
|
|
||||||
echo "Primary Image version already exists, no need to rebuild."
|
|
||||||
}
|
|
||||||
|
|
||||||
if (status_s != 0) {
|
|
||||||
sh 'docker compose build secondary --push'
|
|
||||||
} else {
|
|
||||||
echo "Secondary Image version already exists, no need to rebuild."
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Stop primary container') {
|
stages {
|
||||||
steps {
|
stage("verify tooling") {
|
||||||
script {
|
steps {
|
||||||
if (status_p != 0) {
|
sh '''
|
||||||
sh 'docker compose down'
|
docker version
|
||||||
sh 'sleep 5'
|
docker info
|
||||||
}
|
docker compose version
|
||||||
}
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Start primary container') {
|
stage("Build Containers and push to registry") {
|
||||||
steps {
|
steps {
|
||||||
script {
|
sh 'docker compose build --push'
|
||||||
if (status_p != 0) {
|
}
|
||||||
sh 'docker compose down'
|
}
|
||||||
sh 'docker compose up -d --no-color primary'
|
|
||||||
sh 'docker compose ps'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Create contexts') {
|
stage('Stop primary container') {
|
||||||
steps {
|
steps {
|
||||||
sh 'docker context ls | grep pi502 || docker context create pi502 --docker "host=ssh://pi502.in.thelinuxpro.net"'
|
sh 'docker compose down'
|
||||||
}
|
sh 'sleep 5'
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
stage('Stop secondary container') {
|
stage('Start primary container') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
sh 'docker compose down'
|
||||||
if (status_s != 0) {
|
sh 'docker compose up -d --no-color primary'
|
||||||
sh 'docker --context pi502 compose down'
|
sh 'docker compose ps'
|
||||||
sh 'sleep 5'
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Start secondary container') {
|
stage('Create contexts') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
sh 'docker context ls | grep pi502 || docker context create pi502 --docker "host=ssh://pi502.in.thelinuxpro.net"'
|
||||||
if (status_s != 0) {
|
}
|
||||||
sh 'docker --context pi502 compose up -d --no-color secondary'
|
}
|
||||||
sh 'docker --context pi502 compose ps'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('test primary dns') {
|
stage('Stop secondary container') {
|
||||||
steps {
|
steps {
|
||||||
sh 'dig ns1.thelinuxpro.net ANY @204.8.15.80'
|
sh 'docker --context pi502 compose down'
|
||||||
sh 'dig ns1.in.thelinuxpro.net ANY @10.99.153.241'
|
sh 'sleep 5'
|
||||||
sh 'dig ns1.thelinuxpro.net ANY @204.8.15.81'
|
}
|
||||||
sh 'dig ns1.in.thelinuxpro.net ANY @10.99.153.242'
|
}
|
||||||
sh 'dig kameronkenny.com @204.8.15.80 a'
|
|
||||||
sh 'dig kameronkenny.com @10.99.153.241 a'
|
|
||||||
sh 'dig kameronkenny.com @204.8.15.81 a'
|
|
||||||
sh 'dig kameronkenny.com @10.99.153.242 a'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('verify SOA serial') {
|
stage('Start secondary container') {
|
||||||
steps {
|
steps {
|
||||||
sh 'dig +multi ns1.thelinuxpro.net ANY @204.8.15.80 soa'
|
sh 'docker --context pi502 compose up -d --no-color secondary'
|
||||||
sh 'dig +multi ns1.in.thelinuxpro.net ANY @10.99.153.241 soa'
|
sh 'docker --context pi502 compose ps'
|
||||||
sh 'dig +multi ns1.thelinuxpro.net ANY @204.8.15.81 soa'
|
}
|
||||||
sh 'dig +multi ns1.in.thelinuxpro.net ANY @10.99.153.242 soa'
|
}
|
||||||
sh 'dig +multi kameronkenny.com @204.8.15.80 soa'
|
|
||||||
sh 'dig +multi kameronkenny.com @10.99.153.241 soa'
|
stage('test primary dns') {
|
||||||
sh 'dig +multi kameronkenny.com @204.8.15.81 soa'
|
steps {
|
||||||
sh 'dig +multi kameronkenny.com @10.99.153.242 soa'
|
sh 'dig ns1.thelinuxpro.net ANY @204.8.15.80'
|
||||||
}
|
sh 'dig ns1.in.thelinuxpro.net ANY @10.99.153.241'
|
||||||
}
|
sh 'dig ns1.thelinuxpro.net ANY @204.8.15.81'
|
||||||
}
|
sh 'dig ns1.in.thelinuxpro.net ANY @10.99.153.242'
|
||||||
|
sh 'dig kameronkenny.com @204.8.15.80 a'
|
||||||
|
sh 'dig kameronkenny.com @10.99.153.241 a'
|
||||||
|
sh 'dig kameronkenny.com @204.8.15.81 a'
|
||||||
|
sh 'dig kameronkenny.com @10.99.153.242 a'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('verify SOA serial') {
|
||||||
|
steps {
|
||||||
|
sh 'dig +multi ns1.thelinuxpro.net ANY @204.8.15.80 soa'
|
||||||
|
sh 'dig +multi ns1.in.thelinuxpro.net ANY @10.99.153.241 soa'
|
||||||
|
sh 'dig +multi ns1.thelinuxpro.net ANY @204.8.15.81 soa'
|
||||||
|
sh 'dig +multi ns1.in.thelinuxpro.net ANY @10.99.153.242 soa'
|
||||||
|
sh 'dig +multi kameronkenny.com @204.8.15.80 soa'
|
||||||
|
sh 'dig +multi kameronkenny.com @10.99.153.241 soa'
|
||||||
|
sh 'dig +multi kameronkenny.com @204.8.15.81 soa'
|
||||||
|
sh 'dig +multi kameronkenny.com @10.99.153.242 soa'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ services:
|
||||||
container_name: ns1
|
container_name: ns1
|
||||||
build:
|
build:
|
||||||
dockerfile: Dockerfile.primary
|
dockerfile: Dockerfile.primary
|
||||||
image: docker-registry1.in.thelinuxpro.net:5000/tlp/bind9-primary:240515.2.2
|
image: docker-registry1.in.thelinuxpro.net:5000/tlp/bind9-primary:240515.2.1
|
||||||
restart: always
|
restart: always
|
||||||
user: root
|
user: root
|
||||||
environment:
|
environment:
|
||||||
|
|
|
@ -1,19 +1,16 @@
|
||||||
$ORIGIN net.
|
|
||||||
$TTL 2m
|
$TTL 2m
|
||||||
|
|
||||||
thelinuxpro IN SOA ns1.thelinuxpro.net. root.thelinuxpro.net. (
|
@ IN SOA thelinuxpro.net. root.thelinuxpro.net. (
|
||||||
24051502 ; serial number YYMMDDNN
|
24051501 ; serial number YYMMDDNN
|
||||||
1h ; Refresh
|
1h ; Refresh
|
||||||
15m ; Retry
|
15m ; Retry
|
||||||
10d ; Expire
|
10d ; Expire
|
||||||
1d ; Min TTL
|
1d ; Min TTL
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
IN NS ns1.thelinuxpro.net.
|
NS ns1.thelinuxpro.net.
|
||||||
IN NS ns2.thelinuxpro.net.
|
NS ns2.thelinuxpro.net.
|
||||||
IN TXT "The Linux Pro Net"
|
TXT "The Linux Pro Net"
|
||||||
;
|
|
||||||
$ORIGIN thelinuxpro.net.
|
|
||||||
;
|
;
|
||||||
ns1 IN A 204.8.15.80
|
ns1 IN A 204.8.15.80
|
||||||
ns2 IN A 204.8.15.81
|
ns2 IN A 204.8.15.81
|
||||||
|
|
Loading…
Reference in New Issue