Skip to content
Snippets Groups Projects
Verified Commit e7778513 authored by Sebastian Bergandy's avatar Sebastian Bergandy :keyboard:
Browse files

OZG-8252 add gitlab pipeline

parent d4c4201c
No related branches found
No related tags found
No related merge requests found
stages:
- download
- build
- test
- deploy
- publish
include:
- component: $CI_SERVER_FQDN/sh/zit/ozg-cloud/devops/ci-components/maven@main
\ No newline at end of file
...@@ -102,7 +102,7 @@ pipeline { ...@@ -102,7 +102,7 @@ pipeline {
} }
configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) { configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) {
sh 'mvn --no-transfer-progress -s $MAVEN_SETTINGS clean install -Dmaven.wagon.http.retryHandler.count=3 -DelasticTests.disabled=true' sh 'mvn --no-transfer-progress -s $MAVEN_SETTINGS -Pjenkins,!gitlab clean install -Dmaven.wagon.http.retryHandler.count=3 -DelasticTests.disabled=true'
} }
} }
} }
...@@ -113,7 +113,7 @@ pipeline { ...@@ -113,7 +113,7 @@ pipeline {
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 --no-transfer-progress -s $MAVEN_SETTINGS -DskipTests deploy -Dmaven.wagon.http.retryHandler.count=3' sh 'mvn --no-transfer-progress -s $MAVEN_SETTINGS -Pjenkins,!gitlab -DskipTests deploy -Dmaven.wagon.http.retryHandler.count=3'
} }
} }
} }
...@@ -123,7 +123,7 @@ pipeline { ...@@ -123,7 +123,7 @@ pipeline {
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 --no-transfer-progress -s $MAVEN_SETTINGS spring-boot:build-image -DskipTests -Dmaven.wagon.http.retryHandler.count=3 -pl aggregation-manager-job,aggregation-manager-server' sh 'mvn --no-transfer-progress -s $MAVEN_SETTINGS -Pjenkins,!gitlab spring-boot:build-image -DskipTests -Dmaven.wagon.http.retryHandler.count=3 -pl aggregation-manager-job,aggregation-manager-server'
sh "mvn -s $MAVEN_SETTINGS versions:revert" sh "mvn -s $MAVEN_SETTINGS versions:revert"
} }
} }
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
<properties> <properties>
<spring-boot.build-image.imageName>docker.ozg-sh.de/aggregation-manager-job:build-latest</spring-boot.build-image.imageName> <spring-boot.build-image.imageName>docker.ozg-sh.de/aggregation-manager-job:build-latest</spring-boot.build-image.imageName>
<spring-boot.build-image.imageTags>${project.version}</spring-boot.build-image.imageTags>
</properties> </properties>
<dependencies> <dependencies>
<!-- Own projects --> <!-- Own projects -->
...@@ -104,19 +105,6 @@ ...@@ -104,19 +105,6 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
</plugin> </plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>de.ozgcloud.aggregation.AggregationManagerApplication</mainClass>
<image>
<env>
<BPE_DELIM_JAVA_TOOL_OPTIONS xml:space="preserve"> </BPE_DELIM_JAVA_TOOL_OPTIONS>
<BPE_APPEND_JAVA_TOOL_OPTIONS>-Dfile.encoding=UTF-8</BPE_APPEND_JAVA_TOOL_OPTIONS>
</env>
</image>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.jacoco</groupId> <groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId> <artifactId>jacoco-maven-plugin</artifactId>
...@@ -135,4 +123,77 @@ ...@@ -135,4 +123,77 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<profiles>
<profile>
<id>jenkins</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>de.ozgcloud.aggregation.AggregationManagerApplication</mainClass>
<image>
<env>
<BPE_DELIM_JAVA_TOOL_OPTIONS xml:space="preserve"> </BPE_DELIM_JAVA_TOOL_OPTIONS>
<BPE_APPEND_JAVA_TOOL_OPTIONS>-Dfile.encoding=UTF-8</BPE_APPEND_JAVA_TOOL_OPTIONS>
</env>
</image>
<profiles>
<profile>local</profile>
</profiles>
<docker>
<publishRegistry>
<username>${docker-username}</username>
<password>${docker-password}</password>
<url>${docker-url}</url>
</publishRegistry>
</docker>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>gitlab</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>de.ozgcloud.aggregation.AggregationManagerApplication</mainClass>
<image>
<env>
<BPE_DELIM_JAVA_TOOL_OPTIONS xml:space="preserve"> </BPE_DELIM_JAVA_TOOL_OPTIONS>
<BPE_APPEND_JAVA_TOOL_OPTIONS>-Dfile.encoding=UTF-8</BPE_APPEND_JAVA_TOOL_OPTIONS>
</env>
<tags>${spring-boot.build-image.imageTags}</tags>
<publish>true</publish>
</image>
<profiles>
<profile>local</profile>
</profiles>
</configuration>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>build-image-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project> </project>
\ No newline at end of file
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
<properties> <properties>
<spring-boot.build-image.imageName>docker.ozg-sh.de/aggregation-manager-server:build-latest</spring-boot.build-image.imageName> <spring-boot.build-image.imageName>docker.ozg-sh.de/aggregation-manager-server:build-latest</spring-boot.build-image.imageName>
<spring-boot.build-image.imageTags>${project.version}</spring-boot.build-image.imageTags>
</properties> </properties>
<dependencies> <dependencies>
...@@ -90,19 +91,6 @@ ...@@ -90,19 +91,6 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
</plugin> </plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>de.ozgcloud.aggregation.AggregationManagerApplication</mainClass>
<image>
<env>
<BPE_DELIM_JAVA_TOOL_OPTIONS xml:space="preserve"> </BPE_DELIM_JAVA_TOOL_OPTIONS>
<BPE_APPEND_JAVA_TOOL_OPTIONS>-Dfile.encoding=UTF-8</BPE_APPEND_JAVA_TOOL_OPTIONS>
</env>
</image>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.jacoco</groupId> <groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId> <artifactId>jacoco-maven-plugin</artifactId>
...@@ -121,4 +109,76 @@ ...@@ -121,4 +109,76 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<profiles>
<profile>
<id>jenkins</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>de.ozgcloud.aggregation.AggregationManagerApplication</mainClass>
<image>
<env>
<BPE_DELIM_JAVA_TOOL_OPTIONS xml:space="preserve"> </BPE_DELIM_JAVA_TOOL_OPTIONS>
<BPE_APPEND_JAVA_TOOL_OPTIONS>-Dfile.encoding=UTF-8</BPE_APPEND_JAVA_TOOL_OPTIONS>
</env>
</image>
<profiles>
<profile>local</profile>
</profiles>
<docker>
<publishRegistry>
<username>${docker-username}</username>
<password>${docker-password}</password>
<url>${docker-url}</url>
</publishRegistry>
</docker>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>gitlab</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<env>
<BPE_DELIM_JAVA_TOOL_OPTIONS xml:space="preserve"> </BPE_DELIM_JAVA_TOOL_OPTIONS>
<BPE_APPEND_JAVA_TOOL_OPTIONS>-Dfile.encoding=UTF-8</BPE_APPEND_JAVA_TOOL_OPTIONS>
</env>
<tags>${spring-boot.build-image.imageTags}</tags>
<publish>true</publish>
</image>
<profiles>
<profile>local</profile>
</profiles>
</configuration>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>build-image-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</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