check version testit
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 26s
CI Git-Pages Main / Load git-pages.gitea-env.conf to pipeline env (push) Successful in 21s
CI Git-Pages Main / Check existing artifact (push) Failing after 16s
unit-tests Bats test report
CI Feature / Bats tests (push) Failing after 1m52s
CI Git-Pages Main / Build & Push Helm chart (push) Has been skipped
CI Git-Pages Main / Report Summary (push) Successful in 5s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Successful in 1m0s
CI Feature / Report Summary (push) Successful in 5s

This commit is contained in:
moilanik
2026-06-19 07:55:30 +03:00
parent ca569e280f
commit a40a7703f0
8 changed files with 194 additions and 8 deletions
+8 -7
View File
@@ -4,12 +4,13 @@ set -e
RAW_VERSION=""
if [ -n "${VERSION_FILE}" ] && [ -f "${VERSION_FILE}" ]; then
if echo "${VERSION_FILE}" | grep -q -E '\.json$'; then
RAW_VERSION=$(jq -r '.version' "${VERSION_FILE}")
elif echo "${VERSION_FILE}" | grep -q -E '\.(ya?ml)$'; then
RAW_VERSION=$(grep -oP '^version:\s*\K\S+' "${VERSION_FILE}")
else
RAW_VERSION=$(cat "${VERSION_FILE}" | tr -d '[:space:]')
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:]')
fi
fi
fi
@@ -21,7 +22,7 @@ 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=$(grep -oP '^version:\s*\K\S+' Chart.yaml)
RAW_VERSION=$(sed -n 's/^version:[[:space:]]*\([^[:space:]]*\).*/\1/p' Chart.yaml)
else
echo "ERROR: No version source found (VERSION_FILE, VERSION, package.json, pom.xml, Chart.yaml)" >&2
exit 1