Skip to content
Snippets Groups Projects

Test Helm chart in CI pipeline

+ 41
2
@@ -10,6 +10,7 @@ stages:
@@ -10,6 +10,7 @@ stages:
- test
- test
- check
- check
- deploy
- deploy
 
- post-deploy
default:
default:
tags:
tags:
@@ -20,9 +21,9 @@ default:
@@ -20,9 +21,9 @@ default:
- exec-dind
- exec-dind
# see https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-enabled
# see https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-enabled
# for image usage and settings for building with TLS and docker in docker
# for image usage and settings for building with TLS and docker in docker
image: docker:19.03.1
image: docker:20.10.12
services:
services:
- docker:19.03.1-dind
- docker:20.10.12-dind
variables:
variables:
DOCKER_TLS_CERTDIR: "/certs"
DOCKER_TLS_CERTDIR: "/certs"
@@ -51,6 +52,44 @@ lint-helm:
@@ -51,6 +52,44 @@ lint-helm:
entrypoint: [""]
entrypoint: [""]
script: helm lint helm/
script: helm lint helm/
 
test-helm:
 
stage: post-deploy
 
extends: .dind
 
needs:
 
- lint-helm
 
# - deploy-theodolite
 
variables:
 
KUBECTL: v1.21.3
 
CLUSTERNAME: "$CI_PROJECT_NAME-$CI_PIPELINE_ID"
 
cache:
 
paths:
 
- helm/charts
 
before_script:
 
- apk add -U wget bash openssl
 
# install kubectl
 
- wget -q -O /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${KUBECTL}/bin/linux/amd64/kubectl
 
- chmod +x /usr/local/bin/kubectl
 
# install k3d
 
- wget -q -O - https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash
 
- wget -q -O - https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
 
- k3d help
 
- k3d version
 
#- k3d cluster create testgitlabci --agents 1 --wait -p "30000:30000@agent[0]"
 
- k3d cluster create $CLUSTERNAME --agents 1 --wait -p "30000:30000@agent:0" # k3d 5.0
 
# show cluster info
 
- kubectl cluster-info
 
- helm version
 
script:
 
# Display initial pods, etc.
 
- cd helm
 
- helm dependencies update .
 
- helm install theodolite . -f preconfigs/minimal.yaml --wait
 
- kubectl get nodes -o wide
 
- kubectl get pods --all-namespaces -o wide
 
- kubectl get services --all-namespaces -o wide
 
after_script:
 
- k3d cluster delete $CLUSTERNAME
 
# Theodolite Benchmarks
# Theodolite Benchmarks
Loading