diff --git a/.circleci/config.yml b/.circleci/config.yml index 991a1fce..835074ca 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,9 +14,8 @@ jobs: environment: CHART_TESTING_IMAGE: quay.io/helmpack/chart-testing CHART_TESTING_TAG: v2.3.3 - CHARTS_REPO: https://github.com/rimusz/charts - K8S_VERSION: v1.13.4 - KIND_VERSION: 0.2.1 + K8S_VERSION: v1.14.2 + KIND_VERSION: v0.3.0 steps: - checkout - run: diff --git a/test/e2e-kind.sh b/test/e2e-kind.sh index 96675387..99fc3e0f 100755 --- a/test/e2e-kind.sh +++ b/test/e2e-kind.sh @@ -6,6 +6,24 @@ set -o pipefail readonly CLUSTER_NAME=chart-testing +lint_charts() { + echo + echo "Starting charts linting..." + mkdir -p tmp + docker run --rm -v "$(pwd):/workdir" --workdir /workdir "$CHART_TESTING_IMAGE:$CHART_TESTING_TAG" ct lint --config /workdir/test/ct.yaml | tee tmp/lint.log || true + echo "Done Charts Linting!" + + if grep -q "No chart changes detected" tmp/lint.log > /dev/null; then + echo "No chart changes detected, stopping pipeline!" + exit 0 + elif grep -q "Error linting charts" tmp/lint.log > /dev/null; then + echo "Error linting charts stopping pipeline!" + exit 1 + else + install_charts + fi +} + run_ct_container() { echo 'Running ct container...' docker run --rm --interactive --detach --network host --name ct \ @@ -82,18 +100,19 @@ install_tiller() { } install_charts() { - docker_exec ct lint-and-install --config /workdir/test/ct.yaml - echo -} - -main() { + echo "Starting charts install testing..." run_ct_container trap cleanup EXIT create_kind_cluster install_local-path-provisioner install_tiller - install_charts + docker_exec ct install --config /workdir/test/ct.yaml + echo +} + +main() { + lint_charts } main