@@ -157,21 +157,22 @@ void runSecurityScan() {
157157void publishToInternalRegistry () {
158158 withCredentials([usernamePassword(credentialsId : ' builder-credentials-artifactory' , passwordVariable : ' docker_password' , usernameVariable : ' docker_user' )]) {
159159 timeStamp = new Date (). format(' yyyyMMdd' )
160+ branchNameTag = env. BRANCH_NAME . replaceAll(' /' , ' -' )
160161 sh """
161162 # make sure to logout first to avoid issues with cached credentials
162163 docker logout ${ operatorRegistry}
163164 echo "${ docker_password} " | docker login --username ${ docker_user} --password-stdin ${ operatorRegistry}
164165
165166 # Create tags
166167 docker tag ${ operatorRepo} :${ VERSION} ${ operatorRegistry} /${ operatorRepo} :${ VERSION}
167- docker tag ${ operatorRepo} :${ VERSION} ${ operatorRegistry} /${ operatorRepo} :${ VERSION} -${ env.BRANCH_NAME//\//- }
168- docker tag ${ operatorRepo} :${ VERSION} ${ operatorRegistry} /${ operatorRepo} :${ VERSION} -${ env.BRANCH_NAME//\//- } -${ timeStamp}
168+ docker tag ${ operatorRepo} :${ VERSION} ${ operatorRegistry} /${ operatorRepo} :${ VERSION} -${ branchNameTag }
169+ docker tag ${ operatorRepo} :${ VERSION} ${ operatorRegistry} /${ operatorRepo} :${ VERSION} -${ branchNameTag } -${ timeStamp}
169170 docker tag ${ operatorRepo} :${ VERSION} ${ operatorRegistry} /latest
170171
171172 # Push images to internal registry
172173 docker push ${ operatorRegistry} /${ operatorRepo} :${ VERSION}
173- docker push ${ operatorRegistry} /${ operatorRepo} :${ VERSION} -${ env.BRANCH_NAME//\//- }
174- docker push ${ operatorRegistry} /${ operatorRepo} :${ VERSION} -${ env.BRANCH_NAME//\//- } -${ timeStamp}
174+ docker push ${ operatorRegistry} /${ operatorRepo} :${ VERSION} -${ branchNameTag }
175+ docker push ${ operatorRegistry} /${ operatorRepo} :${ VERSION} -${ branchNameTag } -${ timeStamp}
175176 docker push ${ operatorRegistry} /latest
176177 """
177178 }
0 commit comments