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

OZG-8085 Maven Deploy CI Component for nexus

parent ac1ac135
No related branches found
No related tags found
1 merge request!7Draft: Ozg 8085 ci components poc
Pipeline #2615 waiting for manual action
......@@ -8,6 +8,7 @@ variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
DOCKER_DRIVER: overlay2
NEXUS_IMAGE_REGISTRY_URL: docker.ozg-sh.de
services:
- docker:24.0.5-dind
......@@ -34,6 +35,17 @@ include:
-Dmaven.plugin.validation=brief
maven_profile: "-Pgitlab-deploy"
image_registry: $CI_REGISTRY_IMAGE
# Maven Deploy for MR, Snapshot and Release to Nexus
- component: $CI_SERVER_FQDN/ozg-cloud/devops/ci-components/maven_deploy@main
inputs:
job_prefix: nexus
stage: publish
maven_cli_options: >-
-s .m2/ci_settings.xml --batch-mode
-Dmaven.plugin.validation=brief
maven_profile: "-Pnexus-deploy"
image_registry: $NEXUS_IMAGE_REGISTRY_URL
append_artifact_id_to_registry: true
.helm:
before_script:
......@@ -58,17 +70,7 @@ test-helm:
- export MERGE_REQUEST_TAG="${PROJECT_VERSION}-MR-${CI_MERGE_REQUEST_IID}"
- export SNAPSHOT_TAG="${PROJECT_VERSION}-${CI_COMMIT_BRANCH}"
push-merge-request-image-nexus:
stage: publish
extends: .get-version
script:
- export PRIMARY_IMAGE_TAG=${MERGE_REQUEST_TAG}
- export IMAGE_TAGS="${NEXUS_IMAGE_PREFIX}:${MERGE_REQUEST_TAG},${NEXUS_IMAGE_PREFIX}:${MERGE_REQUEST_TAG}-${CI_COMMIT_SHORT_SHA}"
- mvn deploy -Pnexus-deploy $MAVEN_DEPLOY_CLI_OPTS $MAVEN_CLI_OPTS
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
when: manual
# Merge request jobs
push-merge-request-helm-nexus:
stage: publish
variables:
......@@ -101,16 +103,6 @@ push-keystore-assembler-image-nexus:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
# Snapshot jobs
push-snapshot-image-nexus:
stage: publish
extends: .get-version
script:
- export PRIMARY_IMAGE_TAG=${SNAPSHOT_TAG}
- export IMAGE_TAGS="${NEXUS_IMAGE_PREFIX}:${SNAPSHOT_TAG},${NEXUS_IMAGE_PREFIX}:${SNAPSHOT_TAG}-${CI_COMMIT_SHORT_SHA},${NEXUS_IMAGE_PREFIX}:snapshot-latest"
- mvn deploy -Pnexus-deploy $MAVEN_DEPLOY_CLI_OPTS $MAVEN_CLI_OPTS
only:
- main
push-snapshot-helm-nexus:
stage: publish
variables:
......@@ -130,17 +122,6 @@ push-snapshot-helm-nexus:
- "*.tgz"
# Release jobs
push-release-image-nexus:
stage: publish
extends: .get-version
script:
- mvn versions:set -DnewVersion=${CI_COMMIT_TAG} $MAVEN_CLI_OPTS
- export PRIMARY_IMAGE_TAG=${CI_COMMIT_TAG}
- export IMAGE_TAGS="${NEXUS_IMAGE_PREFIX}:${CI_COMMIT_TAG},${NEXUS_IMAGE_PREFIX}:${CI_COMMIT_TAG}-release,${NEXUS_IMAGE_PREFIX}:latest"
- mvn deploy -Pnexus-deploy $MAVEN_DEPLOY_CLI_OPTS $MAVEN_CLI_OPTS
rules:
- if: $CI_COMMIT_TAG
push-release-helm-nexus:
stage: publish
variables:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment