Compare commits

..

19 Commits

Author SHA1 Message Date
moilanik bcac84f2fd siistimistä, router pipelien clean
CI Main / Load example-gitea-env.conf to pipeline env (push) Successful in 22s
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 24s
CI Feature / Bats tests (push) Successful in 1m26s
CI Feature / Cucumber tests (push) Successful in 1m38s
CI Main / Check existing artifact (push) Successful in 18s
CI Feature / Report Summary (push) Successful in 4s
unit-tests Bats test report
acc-tests Cucumber test report
CI Main / Bats tests (push) Successful in 1m27s
CI Main / Cucumber tests (push) Successful in 1m27s
CI Main / Build & Push Helm (push) Failing after 31s
ci-docker-build-push Docker push 0.2.22
CI Main / Build & Push Docker (push) Successful in 54s
CI Main / Update docker (push) Failing after 1s
CI Main / Move provider version tag (push) Has been skipped
CI Main / Report Summary (push) Successful in 7s
2026-06-22 09:55:25 +03:00
moilanik db9d6daebb fix
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 19s
unit-tests Bats test report
CI Feature / Bats tests (push) Successful in 1m29s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Successful in 1m38s
CI Feature / Report Summary (push) Successful in 5s
2026-06-22 07:53:38 +03:00
moilanik ba16e9e4eb fix
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 23s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Failing after 1m23s
unit-tests Bats test report
CI Feature / Bats tests (push) Successful in 1m29s
CI Feature / Report Summary (push) Successful in 6s
2026-06-22 07:41:32 +03:00
moilanik 6463dad6d7 testi korjaukset
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 20s
unit-tests Bats test report
CI Feature / Bats tests (push) Successful in 1m28s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Failing after 1m35s
CI Feature / Report Summary (push) Successful in 5s
2026-06-22 07:15:38 +03:00
moilanik 21a6ef7ab1 fix
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 20s
unit-tests Bats test report
CI Feature / Bats tests (push) Failing after 1m27s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Failing after 1m37s
CI Feature / Report Summary (push) Successful in 6s
2026-06-22 07:01:05 +03:00
moilanik 84978784fe clean up
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 20s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Failing after 26s
unit-tests Bats test report
CI Feature / Bats tests (push) Failing after 1m25s
CI Feature / Report Summary (push) Successful in 5s
2026-06-22 06:57:09 +03:00
moilanik f58497f5e8 skill & docs
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 23s
POC GitOps E2E / e2e (push) Successful in 53s
unit-tests Bats test report
CI Feature / Bats tests (push) Failing after 1m32s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Failing after 1m45s
CI Feature / Report Summary (push) Successful in 5s
2026-06-22 06:34:37 +03:00
moilanik fa57a152e4 self commit status about gitops
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 23s
acc-tests Cucumber test report
unit-tests Bats test report
CI Feature / Cucumber tests (push) Failing after 1m22s
CI Feature / Bats tests (push) Failing after 1m31s
CI Feature / Report Summary (push) Successful in 5s
POC GitOps E2E / e2e (push) Successful in 29s
2026-06-22 06:03:51 +03:00
moilanik a0cdf377f6 multi commit status support to same commit in gitops repo
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 22s
POC GitOps E2E / e2e (push) Successful in 43s
unit-tests Bats test report
acc-tests Cucumber test report
CI Feature / Bats tests (push) Failing after 1m29s
CI Feature / Cucumber tests (push) Failing after 1m20s
CI Feature / Report Summary (push) Successful in 6s
2026-06-22 05:56:21 +03:00
moilanik 028fd748a6 multi commit status gitops puolelle
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 32s
POC GitOps E2E / e2e (push) Successful in 49s
unit-tests Bats test report
CI Feature / Bats tests (push) Failing after 1m36s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Failing after 1m37s
CI Feature / Report Summary (push) Successful in 6s
2026-06-22 05:47:36 +03:00
moilanik 7f53e2c303 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
2026-06-22 05:43:00 +03:00
moilanik ec22d49039 monorepossa komponetti parametrina
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 22s
POC GitOps E2E / e2e (push) Successful in 52s
unit-tests Bats test report
CI Feature / Bats tests (push) Failing after 1m29s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Failing after 1m40s
CI Feature / Report Summary (push) Successful in 6s
2026-06-22 05:33:11 +03:00
moilanik 13493de7b2 git username & email
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 22s
POC GitOps E2E / e2e (push) Successful in 53s
unit-tests Bats test report
CI Feature / Bats tests (push) Failing after 1m35s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Failing after 1m35s
CI Feature / Report Summary (push) Successful in 6s
2026-06-22 05:09:13 +03:00
moilanik 47df5a8017 poc
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 23s
unit-tests Bats test report
CI Feature / Bats tests (push) Failing after 1m34s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Failing after 1m35s
CI Feature / Report Summary (push) Successful in 5s
POC GitOps E2E / e2e (push) Failing after 35s
2026-06-22 04:55:09 +03:00
moilanik e84e37c9f8 poc
POC GitOps Dispatch / orchestrator (push) Successful in 10s
POC GitOps Dispatch / test (push) Has been skipped
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 31s
unit-tests Bats test report
acc-tests Cucumber test report
CI Feature / Bats tests (push) Successful in 1m33s
CI Feature / Cucumber tests (push) Successful in 1m35s
CI Feature / Report Summary (push) Successful in 4s
2026-06-22 04:25:05 +03:00
moilanik 9105675591 poc
POC GitOps Dispatch / echo (push) Successful in 13s
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 33s
unit-tests Bats test report
CI Feature / Bats tests (push) Successful in 1m34s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Successful in 1m48s
CI Feature / Report Summary (push) Successful in 5s
2026-06-22 04:17:07 +03:00
moilanik 1385afcca6 teet
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 31s
unit-tests Bats test report
CI Feature / Bats tests (push) Successful in 1m34s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Successful in 1m47s
CI Feature / Report Summary (push) Successful in 6s
2026-06-21 17:14:27 +03:00
moilanik 5c9df73a66 cucumber testejä lisää
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 34s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Failing after 45s
unit-tests Bats test report
CI Feature / Bats tests (push) Successful in 1m36s
CI Feature / Report Summary (push) Successful in 5s
2026-06-21 16:10:41 +03:00
moilanik 86e73d87d3 gitops init
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 24s
acc-tests Cucumber test report
CI Feature / Cucumber tests (push) Failing after 1m10s
unit-tests Bats test report
CI Feature / Bats tests (push) Successful in 1m35s
CI Feature / Report Summary (push) Successful in 6s
2026-06-21 15:44:31 +03:00
5 changed files with 35 additions and 154 deletions
+16 -5
View File
@@ -3,18 +3,19 @@ on:
push: push:
branches: branches:
- main - main
- feature/gitops
workflow_dispatch: workflow_dispatch:
jobs: jobs:
load-config: load-config:
name: Config load name: Load example-gitea-env.conf to pipeline env
uses: niko/gitea-ci-library/.gitea/workflows/config-provider.yml@main uses: niko/gitea-ci-library/.gitea/workflows/config-provider.yml@main
secrets: inherit secrets: inherit
with: with:
config_path: .gitea/workflows/example-gitea-env.conf config_path: .gitea/workflows/example-gitea-env.conf
check-version: check-version:
name: Latest versio name: Check existing artifact
needs: [load-config] needs: [load-config]
uses: niko/gitea-ci-library/.gitea/workflows/check-version.yml@main uses: niko/gitea-ci-library/.gitea/workflows/check-version.yml@main
secrets: inherit secrets: inherit
@@ -49,9 +50,19 @@ jobs:
env_json: ${{ needs.load-config.outputs.env_json }} env_json: ${{ needs.load-config.outputs.env_json }}
version: ${{ needs.check-version.outputs.version }} version: ${{ needs.check-version.outputs.version }}
helm-build-push:
name: Build & Push Helm
needs: [load-config, check-version, bats, cucumber]
if: needs.check-version.outputs.artifact_exists != 'true'
uses: niko/gitea-ci-library/.gitea/workflows/helm-build-push.yml@main
secrets: inherit
with:
env_json: ${{ needs.load-config.outputs.env_json }}
version: ${{ needs.check-version.outputs.version }}
docker-gitops: docker-gitops:
name: GitOps name: Update docker
needs: [docker-build-push, load-config, check-version] needs: [docker-build-push]
uses: niko/gitea-ci-library/.gitea/workflows/gitops-dispatch.yml@main uses: niko/gitea-ci-library/.gitea/workflows/gitops-dispatch.yml@main
secrets: inherit secrets: inherit
with: with:
@@ -74,7 +85,7 @@ jobs:
tag-maintenance: tag-maintenance:
name: Move provider version tag name: Move provider version tag
needs: [docker-gitops] needs: [docker-build-push, helm-build-push]
if: success() if: success()
uses: niko/gitea-ci-library/.gitea/workflows/tag-maintenance.yml@main uses: niko/gitea-ci-library/.gitea/workflows/tag-maintenance.yml@main
secrets: inherit secrets: inherit
+6 -6
View File
@@ -10,14 +10,14 @@ on:
jobs: jobs:
load-config: load-config:
name: Config load name: Load git-pages.gitea-env.conf to pipeline env
uses: niko/gitea-ci-library/.gitea/workflows/config-provider.yml@main uses: niko/gitea-ci-library/.gitea/workflows/config-provider.yml@main
secrets: inherit secrets: inherit
with: with:
config_path: .gitea/workflows/git-pages.gitea-env.conf config_path: .gitea/workflows/git-pages.gitea-env.conf
check-version: check-version:
name: Latest version name: Check existing artifact
needs: [load-config] needs: [load-config]
uses: niko/gitea-ci-library/.gitea/workflows/check-version.yml@main uses: niko/gitea-ci-library/.gitea/workflows/check-version.yml@main
secrets: inherit secrets: inherit
@@ -36,9 +36,9 @@ jobs:
chart_path: git-pages chart_path: git-pages
chart-gitops: chart-gitops:
name: GitOps name: Update chart to the cluster
needs: [helm-push, load-config, check-version] needs: [helm-push]
uses: niko/gitea-ci-library/.gitea/workflows/gitops-dispatch.yml@main uses: niko/gitea-ci-library/.gitea/workflows/gitops-dispatch.yml
secrets: inherit secrets: inherit
with: with:
env_json: ${{ needs.load-config.outputs.env_json }} env_json: ${{ needs.load-config.outputs.env_json }}
@@ -49,7 +49,7 @@ jobs:
report-summary: report-summary:
name: Report Summary name: Report Summary
needs: [load-config, check-version, helm-push, chart-gitops] needs: [load-config, helm-push, chart-gitops]
if: always() if: always()
uses: niko/gitea-ci-library/.gitea/workflows/report-summary.yml@main uses: niko/gitea-ci-library/.gitea/workflows/report-summary.yml@main
with: with:
+12 -137
View File
@@ -35,149 +35,24 @@ env:
GITEA_API_URL: ${{ fromJson(inputs.env_json).GITEA_API_URL }} GITEA_API_URL: ${{ fromJson(inputs.env_json).GITEA_API_URL }}
GITOPS_TAG_PREFIX: ${{ fromJson(inputs.env_json).GIT_TAG_PREFIX || '' }} GITOPS_TAG_PREFIX: ${{ fromJson(inputs.env_json).GIT_TAG_PREFIX || '' }}
GITOPS_WORKFLOW: gitops-service.yaml GITOPS_WORKFLOW: gitops-service.yaml
GITOPS_DISPATCH_TIMEOUT: 30
jobs: jobs:
dispatch: dispatch:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
summary: ${{ steps.summary.outputs.GITOPS_SUMMARY }} summary: ${{ steps.run.outputs.GITOPS_SUMMARY }}
steps: steps:
- name: Generate dispatch_id - uses: actions/checkout@v4
id: gen - uses: actions/checkout@v4
run: | with:
ID=$(date +%s | md5sum | head -c 8) repository: niko/gitea-ci-library
echo "dispatch_id=$ID" >> "$GITHUB_OUTPUT" path: .ci
- name: Run gitops dispatch
- name: Dispatch to GitOps repo id: run
env: env:
GITEA_TOKEN: ${{ secrets.GITOPS_DISPATCH_TOKEN }} GITEA_TOKEN: ${{ secrets.GITOPS_DISPATCH_TOKEN }}
run: | run: |
INPUTS=$(jq -nc \ OUTPUT=$(bash .ci/scripts/gitops-dispatch.sh)
--arg dispatch_id "${{ steps.gen.outputs.dispatch_id }}" \ echo "$OUTPUT"
--arg file "$GITOPS_FILE" \ SUMMARY=$(awk -F= '/^GITOPS_SUMMARY=/ {print $2}' <<<"$OUTPUT")
--arg yq_tpl "$GITOPS_YQ_TPL" \ echo "GITOPS_SUMMARY=$SUMMARY" >> "$GITHUB_OUTPUT"
--arg version "$GITOPS_VERSION" \
--arg source_repo "$GITOPS_SOURCE_REPO" \
--arg source_commit "$GITOPS_SOURCE_COMMIT" \
--arg git_tag_prefix "${GITOPS_TAG_PREFIX:-}" \
'{dispatch_id: $dispatch_id, file: $file, yq_tpl: $yq_tpl, version: $version, source_repo: $source_repo, source_commit: $source_commit, git_tag_prefix: $git_tag_prefix}')
curl -s -X POST \
"${GITEA_API_URL}/api/v1/repos/${GITOPS_REPO}/actions/workflows/${GITOPS_WORKFLOW}/dispatches" \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
-d "$(jq -nc --arg ref "main" --argjson inputs "$INPUTS" '{ref: "main", inputs: $inputs}')"
- name: Poll for completion
id: poll
env:
GITEA_TOKEN: ${{ secrets.GITOPS_DISPATCH_TOKEN }}
run: |
ID="${{ steps.gen.outputs.dispatch_id }}"
TIMEOUT_MINUTES="${GITOPS_DISPATCH_TIMEOUT:-30}"
POLL_INTERVAL=10
START_TIME=$(date +%s)
TIMEOUT_SECONDS=$((TIMEOUT_MINUTES * 60))
echo "Polling for run with dispatch_id=$ID"
while [ -z "$RUN_ID" ]; do
NOW=$(date +%s)
ELAPSED=$((NOW - START_TIME))
if [ "$ELAPSED" -ge "$TIMEOUT_SECONDS" ]; then
echo "ERROR: Timeout waiting for run to appear" >&2
exit 124
fi
RUNS_RESP=$(curl -s --connect-timeout 5 --max-time 10 \
"${GITEA_API_URL}/api/v1/repos/${GITOPS_REPO}/actions/runs?event=workflow_dispatch&limit=10" \
-H "Authorization: token $GITEA_TOKEN")
RUN_ID=$(echo "$RUNS_RESP" | jq -r --arg id "$ID" \
'[.workflow_runs[] | select(.display_title | contains($id))] | .[0].id // empty')
[ -z "$RUN_ID" ] && sleep "$POLL_INTERVAL"
done
echo "Run found: id=$RUN_ID"
while true; do
NOW=$(date +%s)
ELAPSED=$((NOW - START_TIME))
if [ "$ELAPSED" -ge "$TIMEOUT_SECONDS" ]; then
echo "ERROR: Timeout waiting for completion" >&2
exit 124
fi
RUN_RESP=$(curl -s --connect-timeout 5 --max-time 10 \
"${GITEA_API_URL}/api/v1/repos/${GITOPS_REPO}/actions/runs/${RUN_ID}" \
-H "Authorization: token $GITEA_TOKEN")
STATUS=$(echo "$RUN_RESP" | jq -r '.status // "running"')
CONCLUSION=$(echo "$RUN_RESP" | jq -r '.conclusion // ""')
echo " status=$STATUS conclusion=$CONCLUSION"
if [ "$STATUS" = "completed" ]; then
if [ "$CONCLUSION" = "success" ]; then
echo "GitOps workflow completed successfully"
# 1. List recent commits from GitOps repo
COMMITS=$(curl -s --connect-timeout 5 --max-time 10 \
"${GITEA_API_URL}/api/v1/repos/${GITOPS_REPO}/commits?sha=main&limit=10" \
-H "Authorization: token $GITEA_TOKEN")
# 2. Find commit by message: "gitops: update version to X.Y.Z"
SEARCH_MSG="gitops: update version to ${GITOPS_VERSION}"
GITOPS_COMMIT=$(echo "$COMMITS" | jq -r \
--arg msg "$SEARCH_MSG" \
'[.[] | select(.commit.message | contains($msg))] | .[0].sha // empty')
# 3. If not found → no change → use HEAD
if [ -z "$GITOPS_COMMIT" ]; then
GITOPS_COMMIT=$(echo "$COMMITS" | jq -r '.[0].sha // empty')
fi
# 4. Set commit status on caller's own commit
PREFIX="${GITOPS_TAG_PREFIX%/}"
if [ -n "$PREFIX" ]; then
CONTEXT="gitops/$(basename "${GITOPS_SOURCE_REPO}")/${PREFIX}"
DESCRIPTION="GitOps: ${PREFIX} ${GITOPS_VERSION}"
else
CONTEXT="gitops/$(basename "${GITOPS_SOURCE_REPO}")"
DESCRIPTION="GitOps: ${GITOPS_VERSION}"
fi
STATUS_URL="${GITEA_API_URL}/api/v1/repos/${GITOPS_SOURCE_REPO}/statuses/${GITOPS_SOURCE_COMMIT}"
STATUS_BODY=$(jq -nc \
--arg state "success" \
--arg description "$DESCRIPTION" \
--arg context "$CONTEXT" \
--arg target_url "${GITEA_API_URL}/${GITOPS_REPO}/commit/${GITOPS_COMMIT}" \
'{state: $state, target_url: $target_url, description: $description, context: $context}')
curl -s -X POST "$STATUS_URL" \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
-d "$STATUS_BODY" || true
echo "GITOPS_COMMIT=$GITOPS_COMMIT" >> "$GITHUB_OUTPUT"
echo "$GITOPS_COMMIT" > /tmp/gitops-commit
exit 0
else
echo "ERROR: GitOps workflow failed with conclusion=$CONCLUSION" >&2
exit 1
fi
fi
sleep "$POLL_INTERVAL"
done
- name: GitOps summary
id: summary
if: always()
run: |
STATUS="failure"
GITOPS_SHA=""
if [ -f /tmp/gitops-commit ]; then
STATUS="success"
GITOPS_SHA=$(cat /tmp/gitops-commit)
fi
COMPONENT="${GITOPS_TAG_PREFIX:-${GITOPS_FILE}}"
echo "GITOPS_SUMMARY=${COMPONENT}|${GITOPS_VERSION}|${STATUS}|${GITOPS_SHA}|${GITOPS_REPO}" >> "$GITHUB_OUTPUT"
-5
View File
@@ -1,7 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
echo "gitops-dispatch: validating env vars..."
: "${GITOPS_FILE:?}" : "${GITOPS_FILE:?}"
: "${GITOPS_YQ_TPL:?}" : "${GITOPS_YQ_TPL:?}"
: "${GITOPS_VERSION:?}" : "${GITOPS_VERSION:?}"
@@ -14,7 +13,6 @@ echo "gitops-dispatch: validating env vars..."
TIMEOUT="${GITOPS_DISPATCH_TIMEOUT:-30}" TIMEOUT="${GITOPS_DISPATCH_TIMEOUT:-30}"
echo "gitops-dispatch: constructing inputs..."
INPUTS=$(jq -nc \ INPUTS=$(jq -nc \
--arg file "$GITOPS_FILE" \ --arg file "$GITOPS_FILE" \
--arg yq_tpl "$GITOPS_YQ_TPL" \ --arg yq_tpl "$GITOPS_YQ_TPL" \
@@ -25,7 +23,6 @@ INPUTS=$(jq -nc \
'{file: $file, yq_tpl: $yq_tpl, version: $version, source_repo: $source_repo, source_commit: $source_commit, git_tag_prefix: $git_tag_prefix}') '{file: $file, yq_tpl: $yq_tpl, version: $version, source_repo: $source_repo, source_commit: $source_commit, git_tag_prefix: $git_tag_prefix}')
DIR="$(cd "$(dirname "$0")" && pwd)" DIR="$(cd "$(dirname "$0")" && pwd)"
echo "gitops-dispatch: dispatching to $GITOPS_REPO/$GITOPS_WORKFLOW..."
set +e set +e
OUTPUT=$(bash "$DIR/dispatch-workflow.sh" \ OUTPUT=$(bash "$DIR/dispatch-workflow.sh" \
"$GITOPS_REPO" "$GITOPS_WORKFLOW" "main" \ "$GITOPS_REPO" "$GITOPS_WORKFLOW" "main" \
@@ -33,9 +30,7 @@ OUTPUT=$(bash "$DIR/dispatch-workflow.sh" \
EXIT=$? EXIT=$?
set -e set -e
echo "=== DISPATCH OUTPUT (exit=$EXIT) ==="
echo "$OUTPUT" echo "$OUTPUT"
echo "=== END DISPATCH ==="
STATUS="failure" STATUS="failure"
GITOPS_SHA="" GITOPS_SHA=""