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

OZG-4786 OZG-4792 Push docker file when build with jenkins

parent 01849e4b
Branches
Tags
No related merge requests found
...@@ -69,35 +69,35 @@ pipeline { ...@@ -69,35 +69,35 @@ pipeline {
} }
} }
stage('Build Docker image') { stage('Build and publish Docker image') {
steps { steps {
script { script {
FAILED_STAGE=env.STAGE_NAME FAILED_STAGE=env.STAGE_NAME
} }
configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) { configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) {
sh 'mvn -s $MAVEN_SETTINGS spring-boot:build-image -DskipTests -Dmaven.wagon.http.retryHandler.count=3 -Dbuildtag=$IMAGE_TAG' sh 'mvn -s $MAVEN_SETTINGS spring-boot:build-image -DskipTests -Dmaven.wagon.http.retryHandler.count=3 -Dbuildtag=$IMAGE_TAG -Dspring-boot.build-image.publish=true'
} }
} }
} }
stage('Tag and Push Docker image') { // stage('Tag and Push Docker image') {
steps { // steps {
script { // script {
FAILED_STAGE=env.STAGE_NAME // FAILED_STAGE=env.STAGE_NAME
if (env.BRANCH_NAME == 'master') { // if (env.BRANCH_NAME == 'master') {
reTagAndPushDockerImage('snapshot-latest') // reTagAndPushDockerImage('snapshot-latest')
} // }
else if (env.BRANCH_NAME == 'release') { // else if (env.BRANCH_NAME == 'release') {
reTagAndPushDockerImage('latest') // reTagAndPushDockerImage('latest')
} // }
else { // else {
pushDockerImage() // pushDockerImage()
} // }
} // }
} // }
} // }
stage('Sonar Checks') { stage('Sonar Checks') {
// when { // when {
......
...@@ -65,7 +65,14 @@ ...@@ -65,7 +65,14 @@
<configuration> <configuration>
<image> <image>
<name>docker.ozg-sh.de/administration:${buildtag}</name> <name>docker.ozg-sh.de/administration:${buildtag}</name>
<publish>true</publish>
</image> </image>
<docker>
<publishRegistry>
<username>USER</username>
<password>PASSWORD</password>
</publishRegistry>
</docker>
<excludes> <excludes>
<exclude> <exclude>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment