Skip to content

Instantly share code, notes, and snippets.

@krsna1729
Created October 8, 2018 16:14
Show Gist options
  • Save krsna1729/60a53c7c17d70dec25c88aeb34a4c7a8 to your computer and use it in GitHub Desktop.
Save krsna1729/60a53c7c17d70dec25c88aeb34a4c7a8 to your computer and use it in GitHub Desktop.

The below script iterates through all the helm charts available in the stable and incubator repos. It installs, runs any registered tests and deletes the deployment.

install-test-delete () {
    name=$(echo $1 | tr '/' '-')
    helm install $1 --name $name --namespace helm-testing --wait --timeout 60
    helm test $name --timeout 60
    helm delete --purge $name --timeout 60
}

repo () {
    [[ ! -z "$2" ]] && helm repo add $1 $2
    for i in `helm search $1 | awk 'FNR>1 {print $1}'`; do
    echo "Install Test Delete Helm Chart $i"
    install-test-delete $i
    done
}

repo stable
repo incubator https://kubernetes-charts-incubator.storage.googleapis.com/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment