Skip to content
This repository was archived by the owner on Apr 17, 2019. It is now read-only.

Commit 2fa19c1

Browse files
committed
Add docker image tag push
Signed-off-by: Nikolay Yushkevich <[email protected]>
1 parent 2849c13 commit 2fa19c1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.jenkinsci/release-build.groovy

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,24 @@ def doReleaseBuild() {
124124
}
125125
}
126126
}
127+
else if (GIT_LOCAL_BRANCH == 'shapshot-2849c1' && checkTag == 0) {
128+
def tag = sh(script: 'git describe --tags --exact-match ${GIT_COMMIT}', returnStdout: true).trim().replaceAll('-','_')
129+
docker.withRegistry('https://registry.hub.docker.com', 'docker-hub-credentials') {
130+
iCRelease.push("${platform}-${tag}")
131+
}
132+
if (manifest.manifestSupportEnabled()) {
133+
manifest.manifestCreate("${DOCKER_REGISTRY_BASENAME}:${tag}",
134+
["${DOCKER_REGISTRY_BASENAME}:x86_64-${tag}"])
135+
manifest.manifestAnnotate("${DOCKER_REGISTRY_BASENAME}:${tag}",
136+
[
137+
[manifest: "${DOCKER_REGISTRY_BASENAME}:x86_64-${tag}",
138+
arch: 'amd64', os: 'linux', osfeatures: [], variant: '']
139+
])
140+
withCredentials([usernamePassword(credentialsId: 'docker-hub-credentials', usernameVariable: 'login', passwordVariable: 'password')]) {
141+
manifest.manifestPush("${DOCKER_REGISTRY_BASENAME}:${tag}", login, password)
142+
}
143+
}
144+
}
127145
sh "docker rmi ${iCRelease.id}"
128146
}
129147
return this

0 commit comments

Comments
 (0)