add Jenkinsfile for dkregistry.

we also want to stop having the registry as part of the services stack.
This commit is contained in:
2020-11-22 08:50:53 -05:00
parent 77af2eecd0
commit ebdcbc1208
2 changed files with 64 additions and 1 deletions

View File

@@ -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'

View 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
"""
}
}
}
}
}
}