Skip to content

Commit cadc42f

Browse files
authored
ci: generate release info section for unreleased chart versions (#5039)
1 parent 6644024 commit cadc42f

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

scripts/generate-version-matrix.sh

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,29 @@ get_chart_images () {
4747
test -d "${CHART_DIR}" || CHART_DIR="$(ls -d1 charts/camunda-platform-8* | tail -n1)"
4848
test -f "${version_matrix_file}" || echo '[]' > "${version_matrix_file}"
4949

50+
# Check if version is released; if not, use local chart directory
51+
is_local_chart=false
5052
if [ ! -f "../released-charts.json" ]; then
5153
export RELEASED_CHARTS="$(helm search repo "${CHART_SOURCE}" --versions --output json)"
5254
echo $RELEASED_CHARTS > ../released-charts.json
5355
fi
5456
if ! $(cat ../released-charts.json | jq "any(.version == \"${chart_version}\")"); then
5557
export CHART_SOURCE="charts/camunda-platform-${major_minor}"
58+
is_local_chart=true
5659
fi
5760

5861
# Check if the chart data already in version-matrix.json and add it if needed.
5962
if ! $(jq "any(.chart_version == \"${chart_version}\")" ${version_matrix_file}); then
60-
# Generateing the chart version data.
63+
# Generating the chart version data.
6164
helm repo update > /dev/null
65+
# Note: --version flag only works for remote charts, not local directories
66+
if [[ "${is_local_chart}" == "true" ]]; then
67+
helm_version_arg=""
68+
else
69+
helm_version_arg="--version ${chart_version}"
70+
fi
6271
chart_images="$(
63-
helm template --skip-tests camunda "${CHART_SOURCE}" --version "${chart_version}" \
72+
helm template --skip-tests camunda "${CHART_SOURCE}" ${helm_version_arg} \
6473
--values "${CHART_DIR}/test/integration/scenarios/chart-full-setup/values-integration-test-ingress-keycloak.yaml" 2> /dev/null |
6574
tr -d "\"'" | awk '/image:/{gsub(/^(camunda|bitnami)/, "docker.io/&", $2); printf "%s\n", $2}' |
6675
sort | uniq;
@@ -76,10 +85,15 @@ get_chart_images () {
7685
}
7786

7887
# Get Helm CLI version based on the asdf .tool-versions file.
88+
# Falls back to HEAD if the specified git ref doesn't exist (e.g., unreleased version tags).
7989
get_helm_cli_version () {
8090
chart_ref_name="${CHART_REF_NAME:-$1}"
81-
(git show ${chart_ref_name}:.tool-versions 2> /dev/null | awk '/helm /{printf $2}') ||
82-
echo -n ''
91+
# Try the specified ref first, fall back to HEAD if it doesn't exist
92+
version=$(git show ${chart_ref_name}:.tool-versions 2>/dev/null | awk '/helm /{printf $2}' || true)
93+
if [[ -z "${version}" ]]; then
94+
version=$(git show HEAD:.tool-versions 2>/dev/null | awk '/helm /{printf $2}' || true)
95+
fi
96+
echo -n "${version}"
8397
}
8498

8599
# Generate version matrix index for all Camunda versions with corresponding charts.

0 commit comments

Comments
 (0)