Compare commits
2 Commits
0a2d7314b6
...
a0f1f49ffb
Author | SHA1 | Date |
---|---|---|
|
a0f1f49ffb | |
|
e79ea8040e |
|
@ -1,34 +1,41 @@
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent {
|
||||||
|
label 'agent1-pi501'
|
||||||
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Build') {
|
stage("verify tooling") {
|
||||||
steps {
|
steps {
|
||||||
echo 'Building from Docker Compose...'
|
sh '''
|
||||||
step(
|
docker version
|
||||||
[
|
docker info
|
||||||
$class: 'DockerBuilderPublisher',
|
docker compose version
|
||||||
cleanImages: false,
|
'''
|
||||||
cleanupWithJenkinsJobDelete: false,
|
}
|
||||||
cloud: '',
|
}
|
||||||
dockerFileDirectory: '',
|
|
||||||
fromRegistry: [url: 'docker-registry1.in.thelinuxpro.net:5000'],
|
stage("Build Containers and push to registry") {
|
||||||
pushCredentialsId: '',
|
sh 'docker compose build --push'
|
||||||
pushOnSuccess: false,
|
}
|
||||||
tagsString: ''
|
|
||||||
]
|
stage('Start primary container') {
|
||||||
)
|
steps {
|
||||||
}
|
sh '''
|
||||||
}
|
if [[ $(docker compose ps | wc -l) -eq 1 ]]; then
|
||||||
stage('Push to Registry') {
|
docker compose up -d --no-color primary
|
||||||
steps {
|
else
|
||||||
echo('docker push [disabled]')
|
docker compose down primary
|
||||||
}
|
docker compose up -d --no-color primary
|
||||||
}
|
fi
|
||||||
stage('Deploy') {
|
'''
|
||||||
steps {
|
sh 'docker compose ps'
|
||||||
echo 'Deploying....'
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
stage('Run tests against the container') {
|
||||||
|
steps {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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:240420.10
|
image: docker-registry1.in.thelinuxpro.net:5000/tlp/bind9-primary:240421.1
|
||||||
restart: always
|
restart: always
|
||||||
user: root
|
user: root
|
||||||
environment:
|
environment:
|
||||||
|
@ -41,7 +41,7 @@ services:
|
||||||
container_name: ns2
|
container_name: ns2
|
||||||
build:
|
build:
|
||||||
dockerfile: Dockerfile.secondary
|
dockerfile: Dockerfile.secondary
|
||||||
image: docker-registry1.in.thelinuxpro.net:5000/tlp/bind9-secondary:240420.07
|
image: docker-registry1.in.thelinuxpro.net:5000/tlp/bind9-secondary:240421.1
|
||||||
restart: always
|
restart: always
|
||||||
user: root
|
user: root
|
||||||
environment:
|
environment:
|
||||||
|
|
Loading…
Reference in New Issue