Files
provisioning/dockerfiles/services/sslproxy/Jenkinsfile

66 lines
2.0 KiB
Groovy

pipeline {
environment {
DOCKERFILE = 'Dockerfile'
APP_NAME = 'sslproxy'
APP_PORT = '80'
WORKDIR = 'dockerfiles/services/sslproxy'
DOCKER_HOST = 'dkhost:2376'
}
agent { label 'docker' }
options {
buildDiscarder(logRotator(numToKeepStr: '2'))
}
triggers {
cron('@weekly')
}
stages {
stage('prepare') {
steps {
checkout scm
// git credentialsId: 'f1f58215-c789-44a2-9b72-50e4425cb061', url: 'ssh://git@git.xai-corp.net:10022/xai-corp.net/provisioning.git'
sh 'ls'
}
}
stage('build') {
steps {
dir(WORKDIR) {
withDockerRegistry(credentialsId: 'b11d7f1a-81ac-4daf-8842-56afc0d2370e', url: 'http://dkregistry.xai-corp.net:5000') {
// script {
// docker.withRegistry('http://dkregistry.xai-corp.net:5000', 'b11d7f1a-81ac-4daf-8842-56afc0d2370e') {
// def customImage = docker.build("dkregistry.xai-corp.net:5000/sslproxy:2.1", "-f ${DOCKERFILE} .")
// customImage.push()
// }
// }
sh "pwd"
sh "xai build"
}
}
}
}
stage('deploy') {
steps {
dir(WORKDIR) {
withDockerRegistry(credentialsId: 'b11d7f1a-81ac-4daf-8842-56afc0d2370e', url: 'http://dkregistry.xai-corp.net:5000') {
sh "xai deploy"
}
}
}
post {
failure {
dir(WORKDIR) {
withDockerRegistry(credentialsId: 'b11d7f1a-81ac-4daf-8842-56afc0d2370e', url: 'http://dkregistry.xai-corp.net:5000') {
sh "xai rollback"
}
}
}
}
}
}
}