add Jenkinsfile for dkregistry.
we also want to stop having the registry as part of the services stack.
This commit is contained in:
@@ -25,7 +25,7 @@ services:
|
||||
delay: 2s
|
||||
order: start-first
|
||||
labels:
|
||||
net.xai-corp.sslproxy.description: proxy ssl calls to non ssl containers
|
||||
net.xai-corp.gitea.description: Self hosted github clone
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.5'
|
||||
|
||||
63
dockerfiles/services/services/dkregistry/Jenkinsfile
vendored
Normal file
63
dockerfiles/services/services/dkregistry/Jenkinsfile
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
pipeline {
|
||||
environment {
|
||||
WORKDIR = 'dockerfiles/services/services/registry'
|
||||
DOCKER_HOST = 'dkhost:2376'
|
||||
}
|
||||
|
||||
agent { label 'docker' }
|
||||
options {
|
||||
buildDiscarder(logRotator(numToKeepStr: '2'))
|
||||
}
|
||||
triggers {
|
||||
cron('@weekly')
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('prepare') {
|
||||
steps {
|
||||
checkout scm
|
||||
sh 'ls'
|
||||
}
|
||||
}
|
||||
|
||||
stage('build') {
|
||||
steps {
|
||||
dir(WORKDIR) {
|
||||
sh "DOCKER_HOST=${DOCKER_HOST} docker-compose -f docker-compose.yml pull"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('deploy') {
|
||||
steps {
|
||||
dir(WORKDIR) {
|
||||
sh """
|
||||
export DOCKER_HOST=${DOCKER_HOST}
|
||||
docker stack deploy --with-registry-auth --prune -c docker-compose.yml dkregistry
|
||||
(cd ../ && chmod +x ./scaleout.sh && ./scaleout.sh dkregistry_registry 180)
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('smoke tests') {
|
||||
steps {
|
||||
dir(WORKDIR) {
|
||||
sleep 60
|
||||
sh "curl -If http://dkhost:5000"
|
||||
}
|
||||
}
|
||||
post {
|
||||
failure {
|
||||
dir(WORKDIR) {
|
||||
sh """
|
||||
export DOCKER_HOST=${DOCKER_HOST}
|
||||
docker service rollback dkregistry_registry
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user