fragine test fix
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 18s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Successful in 1m18s
unit-tests Bats test report
CI Feature / Bats tests (push) Successful in 2m2s
CI Feature / Report Summary (push) Successful in 5s
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 18s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Successful in 1m18s
unit-tests Bats test report
CI Feature / Bats tests (push) Successful in 2m2s
CI Feature / Report Summary (push) Successful in 5s
This commit is contained in:
@@ -4,15 +4,13 @@ set -e
|
||||
RAW_VERSION=""
|
||||
|
||||
if [ -n "${VERSION_FILE-}" ] && [ -f "${VERSION_FILE-}" ]; then
|
||||
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')
|
||||
RAW_VERSION=$(tr -d "$(printf '\xef\xbb\xbf')" < "${VERSION_FILE}" | sed -n 's/^version:[[:space:]]*\([^[:space:]]*\).*/\1/p')
|
||||
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
|
||||
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
|
||||
|
||||
@@ -24,10 +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=$(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
|
||||
RAW_VERSION=$(tr -d "$(printf '\xef\xbb\xbf')" < Chart.yaml | sed -n 's/^version:[[:space:]]*\([^[:space:]]*\).*/\1/p')
|
||||
else
|
||||
echo "ERROR: No version source found (VERSION_FILE, VERSION, package.json, pom.xml, Chart.yaml)" >&2
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user