jos jo haluttu versio - ei commit
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 24s
POC GitOps E2E / e2e (push) Failing after 49s
unit-tests Bats test report
CI Feature / Bats tests (push) Failing after 1m44s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Failing after 1m48s
CI Feature / Report Summary (push) Successful in 7s

This commit is contained in:
moilanik
2026-06-22 05:43:00 +03:00
parent ec22d49039
commit 7f53e2c303
+24
View File
@@ -53,6 +53,22 @@ _gitops_success() {
"${context}" "" "${SOURCE_URL}" "${context}" "" "${SOURCE_URL}"
} }
_gitops_nochange() {
local env repo context
env=$(dirname "${INPUT_FILE}")
repo=$(basename "${SOURCE_REPO}")
context="${repo}"
[ -n "${GIT_TAG_PREFIX:-}" ] && context="${repo}/${GIT_TAG_PREFIX}"
local SOURCE_URL="${GITEA_API_URL}/${SOURCE_REPO}/commit/${SOURCE_COMMIT}"
ROOT_REPO="${GITOPS_REPO}" ROOT_COMMIT="${SOURCE_COMMIT}" \
GITEA_API_URL="${GITEA_API_URL}" GITEA_TOKEN="${GITEA_TOKEN}" \
bash "${SCRIPT_DIR}/report-status.sh" success \
"Install to ${env} ${VERSION} — no change" \
"${context}" "" "${SOURCE_URL}"
}
_gitops_substitute() { _gitops_substitute() {
echo "$1" | sed "s/{{VERSION}}/$2/g" echo "$1" | sed "s/{{VERSION}}/$2/g"
} }
@@ -69,6 +85,14 @@ _gitops_update() {
cd "${CLONE_DIR}" || _gitops_fail "Failed to enter clone directory" cd "${CLONE_DIR}" || _gitops_fail "Failed to enter clone directory"
yq eval -i "${YQ_EXPR}" "${INPUT_FILE}" || _gitops_fail "Failed to update ${INPUT_FILE}" yq eval -i "${YQ_EXPR}" "${INPUT_FILE}" || _gitops_fail "Failed to update ${INPUT_FILE}"
git add "${INPUT_FILE}" || _gitops_fail "Failed to stage ${INPUT_FILE}" git add "${INPUT_FILE}" || _gitops_fail "Failed to stage ${INPUT_FILE}"
if git diff --cached --quiet; then
echo "No changes — ${INPUT_FILE} already at ${VERSION}"
GITOPS_SHA="$(git rev-parse HEAD)"
_gitops_nochange
exit 0
fi
git -c user.name="gitea-ci-bot" \ git -c user.name="gitea-ci-bot" \
-c user.email="ci@keskikuja.site" \ -c user.email="ci@keskikuja.site" \
commit -m "[skip ci] gitops: update version to ${VERSION}" || _gitops_fail "Failed to commit" commit -m "[skip ci] gitops: update version to ${VERSION}" || _gitops_fail "Failed to commit"