From c4d5115711ad9e76ac1762dd0bb5bdb3e67c2183 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Sun, 19 May 2024 22:49:21 +0200 Subject: [PATCH] Update CI related stuff --- .gitignore | 1 + .woodpecker/.helm-workflow.yml | 6 ++---- scripts/lint.sh | 11 +++++++++++ scripts/test.sh | 16 ++++++++++++++++ 4 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 .gitignore create mode 100755 scripts/lint.sh create mode 100755 scripts/test.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ba077a4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +bin diff --git a/.woodpecker/.helm-workflow.yml b/.woodpecker/.helm-workflow.yml index 6818352..c31285b 100644 --- a/.woodpecker/.helm-workflow.yml +++ b/.woodpecker/.helm-workflow.yml @@ -29,7 +29,7 @@ steps: - helm repo add badhouseplants-lib-testing https://git.badhouseplants.net/api/packages/badhouseplants/helm - | if [ -s .changed ]; then - ct lint --target-branch main --validate-maintainers=false + ./scripts/lint.sh fi test: @@ -47,10 +47,8 @@ steps: echo "nameserver 8.8.8.8" > /etc/resolv.conf k3d cluster create test --api-port 16443 --k3s-arg="kubelet-args=\"--allowed-unsafe-sysctls=net.ipv4.ip_forward\""@all sed -i -E -e 's/localhost|0\.0\.0\.0/docker/g' ~/.kube/config - kubectl get storageclass git fetch origin - ct install --target-branch main - ct install --target-branch main --upgrade + ./scripts/test.sh fi release: diff --git a/scripts/lint.sh b/scripts/lint.sh new file mode 100755 index 0000000..6f52997 --- /dev/null +++ b/scripts/lint.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +CHANGED_CHARTS=$(ct list-changed) +CURRENT_DIR=$(pwd) + +for CHART in $CHANGED_CHARTS; do + cd "${CHART}" + helm dependency update + ct lint --target-branch main --validate-maintainers=false + cd "${CURRENT_DIR}" +done diff --git a/scripts/test.sh b/scripts/test.sh new file mode 100755 index 0000000..d415d3a --- /dev/null +++ b/scripts/test.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +CHANGED_CHARTS=$(ct list-changed) +CURRENT_DIR=$(pwd) + +for CHART in $CHANGED_CHARTS; do + cd "${CHART}" + helm dependency update + if [[ "$(helm show chart . | yq '.annotations.skip_tests')" != "true" ]]; then + ct install --target-branch main + ct install --target-branch main --upgrade + else + echo "skipping chart because of the skip_test annotation" + fi + cd "${CURRENT_DIR}" +done