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

KOP-2330 KOP-2331 Deployment auf Artifactory und Nexus

parent 49206403
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,9 @@ target/ ...@@ -3,6 +3,9 @@ target/
.project .project
.settings .settings
.gitlab-ci-local .gitlab-ci-local
.m2/
!.m2/settings.xml
.mvn/
# IDE # IDE
.settings/ .settings/
......
...@@ -2,6 +2,7 @@ image: dimage-base-release.repo-ex.zcdi.dataport.de/sdks/maven:3.9.2-java-21 ...@@ -2,6 +2,7 @@ image: dimage-base-release.repo-ex.zcdi.dataport.de/sdks/maven:3.9.2-java-21
variables: variables:
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode" MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
MAVEN_DEPLOY_CLI_OPTS: "--no-transfer-progress"
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository" MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
cache: cache:
...@@ -13,9 +14,26 @@ cache: ...@@ -13,9 +14,26 @@ cache:
package: package:
stage: build stage: build
script: script:
- export DATAPORT_PROXY=$DATAPORT_PROXY - export DATAPORT_PROXY_CLI=$DATAPORT_PROXY
- mvn $MAVEN_CLI_OPTS package - mvn $MAVEN_CLI_OPTS package
artifacts: artifacts:
paths: paths:
- target/*.jar - target/*.jar
rules:
- if: $CI_COMMIT_BRANCH != "main"
deploy_to_artifactory:
stage: deploy
script:
- export DATAPORT_PROXY_CLI=$DATAPORT_PROXY
- mvn -P artifactory-deploy $MAVEN_DEPLOY_CLI_OPTS $MAVEN_CLI_OPTS deploy
only:
- main
deploy_to_nexus:
stage: deploy
script:
- export DATAPORT_PROXY_CLI=$DATAPORT_PROXY
- mvn -P nexus-deploy $MAVEN_DEPLOY_CLI_OPTS $MAVEN_CLI_OPTS deploy
only:
- main
...@@ -12,6 +12,16 @@ ...@@ -12,6 +12,16 @@
<username>${env.Artifactory_REPO_USER}</username> <username>${env.Artifactory_REPO_USER}</username>
<password>${env.Artifactory_REPO_PASS}</password> <password>${env.Artifactory_REPO_PASS}</password>
</server> </server>
<server>
<id>ozg-nexus</id>
<username>${env.Nexus_REPO_USER}</username>
<password>${env.Nexus_REPO_PASS}</password>
</server>
<server>
<id>ozg-snapshots-nexus</id>
<username>${env.Nexus_REPO_USER}</username>
<password>${env.Nexus_REPO_PASS}</password>
</server>
</servers> </servers>
<profiles> <profiles>
<profile> <profile>
......
...@@ -13,5 +13,44 @@ ...@@ -13,5 +13,44 @@
<maven.compiler.target>21</maven.compiler.target> <maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> </properties>
<profiles>
<!-- Deployment Profiles -->
<profile>
<id>artifactory-deploy</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<distributionManagement>
<repository>
<id>artifactory</id>
<name>artifactory</name>
<url>${env.DATAPORT_ARTIFACTORY_URL}</url>
</repository>
<snapshotRepository>
<id>artifactory-snapshots</id>
<name>artifactory-snapshots</name>
<url>${env.DATAPORT_ARTIFACTORY_URL}</url>
</snapshotRepository>
</distributionManagement>
</profile>
<profile>
<id>nexus-deploy</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<distributionManagement>
<repository>
<id>ozg-nexus</id>
<name>ozg-releases</name>
<url>https://nexus.ozg-sh.de/repository/ozg-releases/</url>
</repository>
<snapshotRepository>
<id>ozg-snapshots-nexus</id>
<name>ozg-snapshots</name>
<url>https://nexus.ozg-sh.de/repository/ozg-snapshots/</url>
</snapshotRepository>
</distributionManagement>
</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