Skip to content

Commit

Permalink
Release: add Gitlab pipeline for pushing helm charts to NGC
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
  • Loading branch information
ArangoGutierrez committed Sep 20, 2024
1 parent ae2681e commit bb0d820
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .nvidia-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ release:ngc:
- unzip ngccli_linux.zip
- chmod u+x ngc-cli/ngc

.helmcli-setup:
before_script:
- curl -sSLo helm.tar.gz https://get.helm.sh/helm-v3.15.4-linux-amd64.tar.gz
- tar -xvf helm.tar.gz
- mv linux-amd64/helm /usr/local/bin/helm
- chmod +x /usr/local/bin/helm

# .sign forms the base of the deployment jobs which signs images in the CI registry.
# This is extended with the image name and version to be deployed.
.sign:ngc:
Expand All @@ -164,6 +171,28 @@ release:ngc:
- 'echo "Signing the image ${IMAGE_NAME}:${IMAGE_TAG}"'
- ngc-cli/ngc registry image publish --source ${IMAGE_NAME}:${IMAGE_TAG} ${IMAGE_NAME}:${IMAGE_TAG} --public --discoverable --allow-guest --sign --org nvidia

helm:ngc:
image: ubuntu:latest
stage: release
needs:
- sign:ngc
rules:
- if: $CI_COMMIT_TAG
variables:
NGC_CLI_API_KEY: "${NGC_REGISTRY_TOKEN}"
retry:
max: 2
before_script:
- !reference [.ngccli-setup, before_script]
- !reference [.helmcli-setup, before_script]
- apt-get update && apt-get install -y make
script:
- 'echo "Pushing the helm chart to NGC"'
- helm lint deployments/helm/*
- make helm-chart
- export VERSION=$(awk -F= '/^VERSION/ { print $2 }' versions.mk | tr -d '[:space:]')
- ngc-cli/ngc registry chart push --source k8s-nim-operator-${VERSION}.tgz --org nvidia --team no-team nvidia/k8s-nim-operator:${VERSION}

sign:ngc-short-tag:
extends:
- .sign:ngc
Expand Down

0 comments on commit bb0d820

Please sign in to comment.