1
0
Fork 0
mirror of https://github.com/parrazam/radicale-docker.git synced 2024-11-22 00:43:25 +01:00

Removed 386 image from Jenkinsfile

This commit is contained in:
Parra 2022-02-27 20:29:33 +01:00
parent 5839145583
commit 3f692d3530

29
Jenkinsfile vendored
View file

@ -35,7 +35,7 @@ pipeline {
axes { axes {
axis { axis {
name 'PLATFORM' name 'PLATFORM'
values 'linux/amd64', 'linux/arm64', 'linux/arm', 'linux/386' values 'linux/amd64', 'linux/arm64', 'linux/arm'
} }
} }
stages { stages {
@ -48,10 +48,10 @@ pipeline {
script { script {
stage("Build ${PLATFORM}") { stage("Build ${PLATFORM}") {
script { script {
SOURCE_IMAGE = SOURCE+':'+PLATFORM.tokenize('/')[1] SOURCE_IMAGE = SOURCE
TARGET_IMAGE = TARGET+':'+PLATFORM.tokenize('/')[1] TARGET_IMAGE = TARGET+':'+PLATFORM.tokenize('/')[1]
if (env.BRANCH_NAME.startsWith('release/')) { if (env.BRANCH_NAME.startsWith('release/')) {
SOURCE_IMAGE += "." + VERSION SOURCE_IMAGE += ":" + VERSION
TARGET_IMAGE += "." + VERSION TARGET_IMAGE += "." + VERSION
} else { } else {
TARGET_IMAGE += VERSION TARGET_IMAGE += VERSION
@ -68,20 +68,6 @@ pipeline {
} }
} }
stage('Publish images to Docker Hub') { stage('Publish images to Docker Hub') {
when {
anyOf {
branch "${MASTER_BRANCH}"
branch "${RELEASE_BRANCH}"
}
}
steps {
withCredentials([usernamePassword(credentialsId: 'dockerHub', passwordVariable: 'dockerHubPassword', usernameVariable: 'dockerHubUser')]) {
sh "echo ${env.dockerHubPassword} | docker login -u ${env.dockerHubUser} --password-stdin"
sh "docker image push --all-tags ${TARGET}"
}
}
}
stage('Tagging with common version') {
environment { environment {
GROUPED_VERSION = "${VERSION}" GROUPED_VERSION = "${VERSION}"
} }
@ -100,13 +86,16 @@ pipeline {
VERSION = '.' + (env.BRANCH_NAME).tokenize('/')[1] VERSION = '.' + (env.BRANCH_NAME).tokenize('/')[1]
} }
IMAGES = '' IMAGES = ''
for (ARCH in ['linux/amd64', 'linux/arm64', 'linux/arm', 'linux/386']) { for (ARCH in ['linux/amd64', 'linux/arm64', 'linux/arm']) {
IMAGES += ' -a ' + TARGET + ':' + ARCH.tokenize('/')[1] + VERSION IMAGES += ' -a ' + TARGET + ':' + ARCH.tokenize('/')[1] + VERSION
} }
} }
echo "${IMAGES}" echo "${IMAGES}"
sh "docker manifest create ${TARGET}:${GROUPED_VERSION} ${IMAGES}" withCredentials([usernamePassword(credentialsId: 'dockerHub', passwordVariable: 'dockerHubPassword', usernameVariable: 'dockerHubUser')]) {
sh "docker manifest push ${TARGET}:${GROUPED_VERSION}" sh "echo ${env.dockerHubPassword} | docker login -u ${env.dockerHubUser} --password-stdin"
sh "docker manifest create ${TARGET}:${GROUPED_VERSION} ${IMAGES}"
sh "docker manifest push ${TARGET}:${GROUPED_VERSION}"
}
} }
} }
} }