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

OZG-4389 remove docker build

parent 9e11dc0b
Branches
Tags
No related merge requests found
...@@ -68,36 +68,6 @@ pipeline { ...@@ -68,36 +68,6 @@ pipeline {
} }
} }
stage('Build 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'
}
}
}
stage('Tag and Push Docker image') {
steps {
script {
FAILED_STAGE=env.STAGE_NAME
IMAGE_TAG = generateImageTag()
tagAndPushDockerImage(IMAGE_TAG)
if (env.BRANCH_NAME == 'master') {
tagAndPushDockerImage('snapshot-latest')
}
else if (env.BRANCH_NAME == 'release') {
tagAndPushDockerImage('latest')
}
}
}
}
stage('Sonar Checks') { stage('Sonar Checks') {
when { when {
branch 'master' branch 'master'
...@@ -129,27 +99,8 @@ pipeline { ...@@ -129,27 +99,8 @@ pipeline {
Void tagAndPushDockerImage(String newTag){
withCredentials([usernamePassword(credentialsId: 'jenkins-nexus-login', usernameVariable: 'USER', passwordVariable: 'PASSWORD')]) {
sh 'docker login docker.ozg-sh.de -u ${USER} -p ${PASSWORD}'
sh "docker tag docker.ozg-sh.de/ozgcloud-processor-manager:build-latest docker.ozg-sh.de/ozgcloud-processor-manager:${newTag}"
sh "docker push docker.ozg-sh.de/ozgcloud-processor-manager:${newTag}"
}
}
String getPomVersion(String pomFile){ String getPomVersion(String pomFile){
def pom = readMavenPom file: pomFile def pom = readMavenPom file: pomFile
return pom.version return pom.version
} }
\ No newline at end of file
String generateImageTag() {
def imageTag = "${env.BRANCH_NAME}-${getPomVersion('pom.xml')}"
if (env.BRANCH_NAME == 'master') {
imageTag += "-${env.GIT_COMMIT.take(7)}"
}
return imageTag
}
\ No newline at end of file
...@@ -16,10 +16,6 @@ ...@@ -16,10 +16,6 @@
<name>ozgcloud-processor-manager</name> <name>ozgcloud-processor-manager</name>
<description>OZG-Cloud Processor Manager</description> <description>OZG-Cloud Processor Manager</description>
<properties>
<spring-boot.build-image.imageName>docker.ozg-sh.de/ozgcloud-processor-manager:build-latest</spring-boot.build-image.imageName>
</properties>
<dependencies> <dependencies>
<!-- OZG-Cloud --> <!-- OZG-Cloud -->
<dependency> <dependency>
...@@ -65,13 +61,6 @@ ...@@ -65,13 +61,6 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
</plugin> </plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>de.ozgcloud.processor.ProcessorTestApplication</mainClass>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>
</project> </project>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment