From c4b78aeddba0147e856b1efad63b5a57e38de17d Mon Sep 17 00:00:00 2001 From: Ewout Prangsma Date: Tue, 13 Mar 2018 15:53:39 +0100 Subject: [PATCH] Use single image tag to prevent polluting the docker hub --- Jenkinsfile.groovy | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index ae30d8a46..f0c2e5019 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -24,18 +24,16 @@ def kubeConfigRoot = "/home/jenkins/.kube" def buildTestSteps(String kubeConfigRoot, String kubeconfig) { return { timestamps { - lock("${kubeconfig}-${params.TESTNAMESPACE}-${env.GIT_COMMIT}") { - withCredentials([string(credentialsId: 'ENTERPRISEIMAGE', variable: 'DEFAULTENTERPRISEIMAGE')]) { - withEnv([ - "DEPLOYMENTNAMESPACE=${params.TESTNAMESPACE}-${env.GIT_COMMIT}", - "DOCKERNAMESPACE=${params.DOCKERNAMESPACE}", - "ENTERPRISEIMAGE=${params.ENTERPRISEIMAGE}", - "IMAGETAG=${env.GIT_COMMIT}", - "KUBECONFIG=${kubeConfigRoot}/${kubeconfig}", - "LONG=${params.LONG ? 1 : 0}", - ]) { - sh "make run-tests" - } + withCredentials([string(credentialsId: 'ENTERPRISEIMAGE', variable: 'DEFAULTENTERPRISEIMAGE')]) { + withEnv([ + "DEPLOYMENTNAMESPACE=${params.TESTNAMESPACE}-${env.GIT_COMMIT}", + "DOCKERNAMESPACE=${params.DOCKERNAMESPACE}", + "ENTERPRISEIMAGE=${params.ENTERPRISEIMAGE}", + "IMAGETAG=jenkins-test", + "KUBECONFIG=${kubeConfigRoot}/${kubeconfig}", + "LONG=${params.LONG ? 1 : 0}", + ]) { + sh "make run-tests" } } } @@ -59,6 +57,7 @@ def buildCleanupSteps(String kubeConfigRoot, String kubeconfig) { pipeline { options { buildDiscarder(logRotator(daysToKeepStr: '7', numToKeepStr: '10')) + lock resource: 'k8s-operator' } agent any parameters { @@ -75,7 +74,7 @@ pipeline { withEnv([ "DEPLOYMENTNAMESPACE=${params.TESTNAMESPACE}-${env.GIT_COMMIT}", "DOCKERNAMESPACE=${params.DOCKERNAMESPACE}", - "IMAGETAG=${env.GIT_COMMIT}", + "IMAGETAG=jenkins-test", "LONG=${params.LONG ? 1 : 0}", ]) { sh "make"