-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocal_test.sh
executable file
·31 lines (24 loc) · 1.32 KB
/
local_test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
set -euxo pipefail
# Pull needed images:
docker pull helmunittest/helm-unittest
docker pull quay.io/helmpack/chart-testing:latest
# Run Helm linting:
docker run -it --rm --name ct --volume "$( pwd )":/data quay.io/helmpack/chart-testing:latest sh -c "ct lint --all --debug --chart-dirs data/"
# Run unit tests:
docker run -it --rm --name unittest --volume "$(pwd)":/apps helmunittest/helm-unittest charts/*
docker run -it --rm --name unittest --volume "$(pwd)":/apps helmunittest/helm-unittest charts/dsb-nginx-frontend
# Update snapshots:
# docker run --user 1001:1001 -it --rm --name unittest --volume "$(pwd)":/apps helmunittest/helm-unittest --update-snapshot charts/*
# Create Kubernetes cluster:
kind create cluster --config kind-cluster-config.yaml
# Fetch test application used to test the charts:
az acr login -n dsbacr
docker pull dsbacr.azurecr.io/dsb-norge/test-application:latest
docker pull dsbacr.azurecr.io/dsb-norge/dsb-mssql-server:2019-latest
kind load docker-image dsbacr.azurecr.io/dsb-norge/test-application:latest
kind load docker-image dsbacr.azurecr.io/dsb-norge/dsb-mssql-server:2019-latest
# Run Helm tests:
docker run -it --rm --name ct --volume "$( pwd )":/data quay.io/helmpack/chart-testing:latest sh -c "ct install --all --debug --chart-dirs data/"
# Delete Kubernetes cluster:
kind delete cluster