Skip to content
Snippets Groups Projects
Commit 9544aeb6 authored by Lukas Malte Monnerjahn's avatar Lukas Malte Monnerjahn
Browse files

add gitlab pipeline

parent c139111f
No related branches found
No related tags found
No related merge requests found
Pipeline #1412 passed
image: maven:3.9.9-eclipse-temurin-21-alpine
variables:
MAVEN_DEPLOY_CLI_OPTS: "--no-transfer-progress -DskipTests"
MAVEN_CLI_OPTS: >-
-s .m2/ci_settings.xml --batch-mode
-Dmaven.plugin.validation=brief
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
DOCKER_DRIVER: overlay2
services:
- docker:dind
cache:
paths:
- .m2/repository/
- target/
stages:
- build
- test
- publish
build:
stage: build
script:
- mvn clean compile $MAVEN_CLI_OPTS
artifacts:
paths:
- target/*.jar
test:
stage: test
script:
- mvn test $MAVEN_CLI_OPTS
verify:
stage: test
script:
- mvn verify $MAVEN_CLI_OPTS
push-snapshot-image-gitlab:
stage: publish
script:
- mvn deploy -Pgitlab-deploy $MAVEN_DEPLOY_CLI_OPTS $MAVEN_CLI_OPTS
only:
- main
push-snapshot-image-nexus:
stage: publish
script:
- mvn deploy -Pnexus-deploy $MAVEN_DEPLOY_CLI_OPTS $MAVEN_CLI_OPTS
only:
- main
push-release-image-gitlab:
stage: publish
script:
- mvn versions:set -DnewVersion=${CI_COMMIT_TAG}
- mvn deploy -Pgitlab-deploy $MAVEN_DEPLOY_CLI_OPTS $MAVEN_CLI_OPTS
rules:
- if: $CI_COMMIT_TAG
push-release-image-nexus:
stage: publish
script:
- mvn versions:set -DnewVersion=${CI_COMMIT_TAG}
- mvn mvn deploy -Pnexus-deploy $MAVEN_DEPLOY_CLI_OPTS $MAVEN_CLI_OPTS
rules:
- if: $CI_COMMIT_TAG
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 http://maven.apache.org/xsd/settings-1.2.0.xsd"
xmlns="http://maven.apache.org/SETTINGS/1.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<localRepository>.m2/repository</localRepository>
<servers>
<server>
<id>ozg-nexus</id>
<username>${env.NEXUS_USER}</username>
<password>${env.NEXUS_PASSWORD}</password>
</server>
<server>
<id>ozg-snapshots-nexus</id>
<username>${env.NEXUS_USER}</username>
<password>${env.NEXUS_PASSWORD}</password>
</server>
<server>
<id>codesh-gitlab-maven</id>
<configuration>
<httpHeaders>
<property>
<name>Job-Token</name>
<value>${CI_JOB_TOKEN}</value>
</property>
</httpHeaders>
</configuration>
</server>
</servers>
<profiles>
<profile>
<id>ci-default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>codesh-gitlab-maven</id>
<url>${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/maven</url>
</repository>
<repository>
<id>ozg-nexus</id>
<name>ozg-releases</name>
<url>https://nexus.ozg-sh.de/repository/ozg-releases/</url>
</repository>
<repository>
<id>ozg-snapshots-nexus</id>
<name>ozg-snapshots</name>
<url>https://nexus.ozg-sh.de/repository/ozg-snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
</settings>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment