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: