Files
workavia-mail-front/Jenkinsfile
Rene Cordier 4ea53a99af Fix Jenkins build: run on jdk11 workers
(cherry picked from commit a7d7612466f904f21b27b1287ec306b3496bc7d1)
2023-03-24 19:40:48 +07:00

45 lines
942 B
Groovy

pipeline {
agent {
label 'jdk11'
}
options {
// Configure an overall timeout for the build.
timeout(time: 1, unit: 'HOURS')
disableConcurrentBuilds()
}
stages {
stage('Deliver web Docker image') {
when {
anyOf {
branch 'master'
branch 'release'
buildingTag()
}
}
steps {
script {
env.DOCKER_TAG = 'master'
if (env.BRANCH_NAME == 'release') {
env.DOCKER_TAG = 'release'
}
if (env.TAG_NAME) {
env.DOCKER_TAG = env.TAG_NAME
}
echo "Docker tag: ${env.DOCKER_TAG}"
// Build image
sh "docker build -t linagora/tmail-web:${env.DOCKER_TAG} ."
def webImage = docker.image "linagora/tmail-web:${env.DOCKER_TAG}"
docker.withRegistry('', 'dockerHub') {
webImage.push()
}
}
}
}
}
}