uusia testejä
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 26s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Successful in 1m4s
unit-tests Bats test report
CI Feature / Bats tests (push) Successful in 1m48s
CI Feature / Report Summary (push) Successful in 5s

This commit is contained in:
moilanik
2026-06-19 12:51:18 +03:00
parent d57f56f196
commit 45f939a611
4 changed files with 48 additions and 7 deletions
+12 -7
View File
@@ -4,13 +4,15 @@ set -e
RAW_VERSION=""
if [ -n "${VERSION_FILE-}" ] && [ -f "${VERSION_FILE-}" ]; then
RAW_VERSION=$(sed -n 's/^version:[[:space:]]*\([^[:space:]]*\).*/\1/p' "${VERSION_FILE}")
if [ -z "${RAW_VERSION}" ]; then
if echo "${VERSION_FILE}" | grep -q -E '\.json$'; then
RAW_VERSION=$(jq -r '.version' "${VERSION_FILE}")
else
RAW_VERSION=$(cat "${VERSION_FILE}" | tr -d '[:space:]')
if echo "${VERSION_FILE}" | grep -q -E '\.[Yy][Aa][Mm][Ll]$'; then
RAW_VERSION=$(yq '.version' "${VERSION_FILE}" 2>/dev/null | grep -v '^null$' || true)
if [ -z "${RAW_VERSION}" ]; then
RAW_VERSION=$(sed 's/'$'\xef\xbb\xbf''//g' "${VERSION_FILE}" | sed -n 's/^version:[[:space:]]*\([^[:space:]]*\).*/\1/p')
fi
elif echo "${VERSION_FILE}" | grep -q -E '\.json$'; then
RAW_VERSION=$(jq -r '.version' "${VERSION_FILE}")
else
RAW_VERSION=$(cat "${VERSION_FILE}" | tr -d '[:space:]')
fi
fi
@@ -22,7 +24,10 @@ if [ -z "${RAW_VERSION}" ]; then
elif [ -f pom.xml ]; then
RAW_VERSION=$(grep -oP '<version>\K[^<]+' pom.xml | head -1)
elif [ -f Chart.yaml ]; then
RAW_VERSION=$(sed -n 's/^version:[[:space:]]*\([^[:space:]]*\).*/\1/p' Chart.yaml)
RAW_VERSION=$(yq '.version' Chart.yaml 2>/dev/null | grep -v '^null$' || true)
if [ -z "${RAW_VERSION}" ]; then
RAW_VERSION=$(sed 's/'$'\xef\xbb\xbf''//g' Chart.yaml | sed -n 's/^version:[[:space:]]*\([^[:space:]]*\).*/\1/p')
fi
else
echo "ERROR: No version source found (VERSION_FILE, VERSION, package.json, pom.xml, Chart.yaml)" >&2
exit 1