Skip to content
Snippets Groups Projects
Commit e1ef3b41 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-4792 fixed the buildtag refernece in Jenkinsfile and removed DoubleTagTest

parent ae0196d4
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,7 @@ pipeline { ...@@ -12,6 +12,7 @@ pipeline {
SH_SUCCESS_STATUS_CODE = 0 SH_SUCCESS_STATUS_CODE = 0
IMAGE_TAG = generateImageTag() IMAGE_TAG = generateImageTag()
HELM_CHART_VERSION = generateHelmChartVersion() HELM_CHART_VERSION = generateHelmChartVersion()
BUILD_TAG = generateBuildTag()
} }
options { options {
...@@ -73,12 +74,11 @@ pipeline { ...@@ -73,12 +74,11 @@ pipeline {
steps { steps {
script { script {
FAILED_STAGE=env.STAGE_NAME FAILED_STAGE=env.STAGE_NAME
env.BUILD_TAG = generateBuildTag()
} }
configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) { configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) {
withCredentials([usernamePassword(credentialsId: 'jenkins-nexus-login', usernameVariable: 'USER', passwordVariable: 'PASSWORD')]) { withCredentials([usernamePassword(credentialsId: 'jenkins-nexus-login', usernameVariable: 'USER', passwordVariable: 'PASSWORD')]) {
sh 'mvn -s $MAVEN_SETTINGS spring-boot:build-image -DskipTests -Dmaven.wagon.http.retryHandler.count=3 -Dimagetag=$IMAGE_TAG -Dbuildtag=${env.BUILD_TAG} -Dspring-boot.build-image.publish=true -Duser=${USER} -Dpassword=${PASSWORD}' sh 'mvn -s $MAVEN_SETTINGS spring-boot:build-image -DskipTests -Dmaven.wagon.http.retryHandler.count=3 -Dimagetag=$IMAGE_TAG -Dbuildtag=$BUILD_TAG -Dspring-boot.build-image.publish=true -Duser=${USER} -Dpassword=${PASSWORD}'
} }
} }
} }
...@@ -161,14 +161,12 @@ String generateImageTag() { ...@@ -161,14 +161,12 @@ String generateImageTag() {
String generateBuildTag() { String generateBuildTag() {
def buildName = "docker.ozg-sh.de/administration" def buildName = "docker.ozg-sh.de/administration"
def buildTag = buildName+":"+IMAGE_TAG def buildTag = buildName+":"+generateImageTag()
if (isMasterBranch()) { if (isMasterBranch()) {
buildTag += ","+buildName+":snapshot-latest" buildTag += ","+buildName+":snapshot-latest"
} else if (isReleaseBranch()) { } else if (isReleaseBranch()) {
buildTag += ","+buildName+":latest" buildTag += ","+buildName+":latest"
} else if (env.BRANCH_NAME == 'OZG-4792-FixMasterBranchTagging') {
buildTag += ","+buildName+":doubleTagTest"
} }
return buildTag return buildTag
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment