From 9dcf25b6b95c118ab40391883f0d9a5d3d6e5830 Mon Sep 17 00:00:00 2001 From: Christoph Schabert Date: Fri, 2 Jun 2023 15:45:42 +0200 Subject: [PATCH] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d646b01..5f70f9d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -65,12 +65,15 @@ Nexus Upload: - if: $PIPELINE == "release" image: registry.knecon.com/knecon/devops/build-image:latest script: + - VERSION=$(cat Chart.yaml | grep "^version:" | sed 's/^version:\s\(.*\)$/\1/g') + - tagList=$( git tag -l "${VERSION}-*" ) + - latestVersion="$( semver $(echo $tagList) | tail -n1)" + - BUILDVERSION="$( semver $latestVersion -p -i prerelease )" + - echo "BUILDVERSION=$(echo $BUILDVERSION)" >> variables.env - |- - export VERSION=$(cat Chart.yaml | grep "^version:" | sed 's/^version: \(.*\)$/\1/g') - sed -s "s/^version: .*$/version: $VERSION/g" -i Chart.yaml + sed -s "s/^version:.*$/version: $BUILDVERSION/g" -i Chart.yaml - uploadFile=$( helm package . | awk 'NF>1{print q $NF}' ) -# - curl -s -u "${CI_NEXUS_USER}:${CI_NEXUS_PASSWORD}" "${CI_NEXUS_ADDRESS}:443/repository/red-dev/" --upload-file $uploadFile - - echo "TAG=v$(echo $VERSION)" >> variables.env + - curl -s -u "${CI_NEXUS_USER}:${CI_NEXUS_PASSWORD}" "${CI_NEXUS_ADDRESS}:443/repository/red-dev/" --upload-file $uploadFile - echo "FILE=$(echo $uploadFile)" >> variables.env artifacts: reports: