From 5639ed42573b1b16fb66a48ba77c5cf9fdc3c2e9 Mon Sep 17 00:00:00 2001 From: chris Date: Thu, 28 May 2020 18:21:23 +0200 Subject: [PATCH] tag with date --- Jenkinsfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 9d14ee6..a94e8af 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,13 +15,16 @@ pipeline { withDockerRegistry([ credentialsId: registry_credentials, url: "https://"+registry ]) { script { def customImage = docker.build(registry+'/'+repo+'/'+project, "--build-arg DATE=$timeStamp --pull .") + customImage.push(timeStamp) customImage.push() registry_credentials = "3deeee3d-6fce-4430-98dd-9b4db56f43f7" withDockerRegistry([ credentialsId: registry_credentials ]) { def official_image = repo+'/'+project sh "docker image tag " + registry+'/'+repo+'/'+project + ' ' + official_image + sh "docker image tag " + registry+'/'+repo+'/'+project + ' ' + official_image+':'+timeStamp sh "docker push " + official_image + sh "docker push " + official_image+':'+timeStamp } } }