initial commit
All checks were successful
Build and Publish TechDocs / build-and-publish (push) Successful in 1m15s

Change-Id: I2e2564a72b6be9af536235fc3795fd788fd9257b
This commit is contained in:
Scaffolder
2026-04-15 15:41:22 +00:00
commit b6460c4ea3
180 changed files with 12299 additions and 0 deletions

126
.circleci/install_charts.sh Executable file
View File

@@ -0,0 +1,126 @@
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
readonly CT_VERSION=latest
readonly KIND_VERSION=v0.31.0
readonly CLUSTER_NAME=chart-testing
readonly REPO_ROOT="${REPO_ROOT:-$(git rev-parse --show-toplevel)}"
readonly KEDA_VERSION=2.19.0
find_latest_tag() {
if ! git describe --tags --abbrev=0 2>/dev/null; then
git rev-list --max-parents=0 --first-parent HEAD
fi
}
create_ct_container() {
echo "Starting Chart Testing container"
docker run --rm --interactive --detach --network host --name ct \
--volume "$(pwd)/.circleci/ct.yaml:/etc/ct/ct.yaml" \
--volume "$(pwd):/workdir" \
--workdir /workdir \
"quay.io/helmpack/chart-testing:${CT_VERSION}" \
cat
}
cleanup() {
echo "Removing ct container"
docker kill ct >/dev/null 2>&1 || true
}
docker_exec() {
docker exec --interactive --tty ct "$@"
}
create_kind_cluster() {
echo "Installing kind"
curl -sSLo kind "https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-linux-amd64"
chmod +x kind
sudo mv kind /usr/local/bin/kind
echo "Creating cluster"
kind create cluster --name "${CLUSTER_NAME}" --wait 5m -q
echo "Copying kubeconfig to container"
local kubeconfig
kubeconfig="$(pwd)/kube-config"
kind get kubeconfig --name "${CLUSTER_NAME}" | tee "${kubeconfig}"
docker_exec mkdir -p /root/.kube
docker cp "${kubeconfig}" ct:/root/.kube/config
docker_exec kubectl cluster-info
docker_exec kubectl get nodes
}
install_local_path_provisioner() {
docker_exec kubectl delete storageclass standard
docker_exec kubectl apply -f "https://raw.githubusercontent.com/rancher/local-path-provisioner/master/deploy/local-path-storage.yaml"
}
install_keda() {
docker_exec kubectl apply -f "https://github.com/kedacore/keda/releases/download/v${KEDA_VERSION}/keda-${KEDA_VERSION}-core.yaml" || true
}
install_charts() {
docker_exec ct install --all
echo
}
main() {
pushd "${REPO_ROOT}" >/dev/null
echo "Fetching tags"
git fetch --tags
local latest_tag
latest_tag=$(find_latest_tag)
local latest_tag_rev
latest_tag_rev=$(git rev-parse --verify "${latest_tag}")
echo "${latest_tag_rev} ${latest_tag} (latest tag)"
local head_rev
head_rev=$(git rev-parse --verify HEAD)
echo "${head_rev} HEAD"
if [[ "${latest_tag_rev}" == "${head_rev}" ]]; then
echo "No code changes. Nothing to release."
exit
fi
echo "Identifying changed charts since tag ${latest_tag}"
local changed_charts=()
readarray -t changed_charts <<< "$(git diff --find-renames --name-only "${latest_tag_rev}" | grep '\.yaml$' | cut -d '/' -f 1 | sort -u)"
if [[ -n "${changed_charts[*]}" ]]; then
local changes_pending=no
for chart in "${changed_charts[@]}"; do
if [[ -f "${chart}/Chart.yaml" ]]; then
changes_pending=yes
break
fi
done
if [[ "${changes_pending}" == "yes" ]]; then
create_ct_container
trap cleanup EXIT
create_kind_cluster
install_local_path_provisioner
install_keda
install_charts
else
echo "Nothing to do. No chart changes detected."
fi
else
echo "Nothing to do. No chart changes detected."
fi
popd >/dev/null
}
main