Update .gitlab-ci.yml file

This commit is contained in:
Christoph Schabert 2023-06-02 15:45:42 +02:00
parent 48773356c0
commit 9dcf25b6b9

View File

@ -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: