Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run chart install test only if it is needed #1229

Merged
merged 1 commit into from May 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions .circleci/config.yml
Expand Up @@ -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:
Expand Down
31 changes: 25 additions & 6 deletions test/e2e-kind.sh
Expand Up @@ -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 \
Expand Down Expand Up @@ -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