From 2fa19c1964802a493f061cee3e93c09edd54ba8f Mon Sep 17 00:00:00 2001 From: Nikolay Yushkevich Date: Tue, 27 Nov 2018 18:54:14 +0300 Subject: [PATCH] Add docker image tag push Signed-off-by: Nikolay Yushkevich --- .jenkinsci/release-build.groovy | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.jenkinsci/release-build.groovy b/.jenkinsci/release-build.groovy index 0e958196ba..3190c438c4 100644 --- a/.jenkinsci/release-build.groovy +++ b/.jenkinsci/release-build.groovy @@ -124,6 +124,24 @@ def doReleaseBuild() { } } } + else if (GIT_LOCAL_BRANCH == 'shapshot-2849c1' && checkTag == 0) { + def tag = sh(script: 'git describe --tags --exact-match ${GIT_COMMIT}', returnStdout: true).trim().replaceAll('-','_') + docker.withRegistry('https://registry.hub.docker.com', 'docker-hub-credentials') { + iCRelease.push("${platform}-${tag}") + } + if (manifest.manifestSupportEnabled()) { + manifest.manifestCreate("${DOCKER_REGISTRY_BASENAME}:${tag}", + ["${DOCKER_REGISTRY_BASENAME}:x86_64-${tag}"]) + manifest.manifestAnnotate("${DOCKER_REGISTRY_BASENAME}:${tag}", + [ + [manifest: "${DOCKER_REGISTRY_BASENAME}:x86_64-${tag}", + arch: 'amd64', os: 'linux', osfeatures: [], variant: ''] + ]) + withCredentials([usernamePassword(credentialsId: 'docker-hub-credentials', usernameVariable: 'login', passwordVariable: 'password')]) { + manifest.manifestPush("${DOCKER_REGISTRY_BASENAME}:${tag}", login, password) + } + } + } sh "docker rmi ${iCRelease.id}" } return this