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
No related branches found
No related tags found
No related merge requests found
......@@ -69,35 +69,35 @@ pipeline {
}
}
stage('Build Docker image') {
stage('Build and publish Docker image') {
steps {
script {
FAILED_STAGE=env.STAGE_NAME
}
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') {
steps {
script {
FAILED_STAGE=env.STAGE_NAME
// stage('Tag and Push Docker image') {
// steps {
// script {
// FAILED_STAGE=env.STAGE_NAME
if (env.BRANCH_NAME == 'master') {
reTagAndPushDockerImage('snapshot-latest')
}
else if (env.BRANCH_NAME == 'release') {
reTagAndPushDockerImage('latest')
}
else {
pushDockerImage()
}
}
}
}
// if (env.BRANCH_NAME == 'master') {
// reTagAndPushDockerImage('snapshot-latest')
// }
// else if (env.BRANCH_NAME == 'release') {
// reTagAndPushDockerImage('latest')
// }
// else {
// pushDockerImage()
// }
// }
// }
// }
stage('Sonar Checks') {
// when {
......
......@@ -65,7 +65,14 @@
<configuration>
<image>
<name>docker.ozg-sh.de/administration:${buildtag}</name>
<publish>true</publish>
</image>
<docker>
<publishRegistry>
<username>USER</username>
<password>PASSWORD</password>
</publishRegistry>
</docker>
<excludes>
<exclude>
<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