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

This commit is contained in:
moilanik
2026-06-22 09:55:25 +03:00
parent db9d6daebb
commit bcac84f2fd
8 changed files with 200 additions and 103 deletions
+1
View File
@@ -4,3 +4,4 @@ DOCKER_REGISTRY=gitea.app.keskikuja.site/niko
DOCKER_IMAGE_NAME=gitea-ci-library-test-image
DOCKER_UI_URL=https://gitea.app.keskikuja.site/niko/-/packages/container
#DOCKERFILE=Dockerfile.platform
+14 -89
View File
@@ -3,6 +3,7 @@ on:
push:
branches:
- main
- feature/gitops
workflow_dispatch:
jobs:
@@ -59,104 +60,28 @@ jobs:
env_json: ${{ needs.load-config.outputs.env_json }}
version: ${{ needs.check-version.outputs.version }}
gitops-chart:
name: GitOps — helm version
needs: [helm-build-push]
if: success()
runs-on: ubuntu-latest
outputs:
chart_commit: ${{ steps.update.outputs.chart_commit }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: niko/gitea-ci-library
path: .ci
- name: Update Chart.yaml version
id: update
run: |
INPUTS=$(jq -nc \
--arg file "dev/Chart.yaml" \
--arg yq_tpl '(.dependencies[] | select(.name == "git-pages") | .version) = "{{VERSION}}"' \
--arg version "${{ needs.check-version.outputs.version }}" \
--arg source_repo "${{ github.repository }}" \
--arg source_commit "${{ github.sha }}" \
--arg git_tag_prefix "helm" \
'{file: $file, yq_tpl: $yq_tpl, version: $version, source_repo: $source_repo, source_commit: $source_commit, git_tag_prefix: $git_tag_prefix}')
OUTPUT=$(bash .ci/scripts/dispatch-workflow.sh \
"niko/gitea-ci-gitops-tests" "gitops-service.yaml" "main" \
"$INPUTS" "${{ fromJson(needs.load-config.outputs.env_json).GITEA_API_URL }}" \
"${{ secrets.GITOPS_DISPATCH_TOKEN }}" "30")
echo "$OUTPUT"
CHART_REPO=$(echo "$OUTPUT" | grep '^GITOPS_COMMIT=' | cut -d= -f2)
echo "chart_commit=$CHART_REPO" >> "$GITHUB_OUTPUT"
gitops-values:
name: GitOps — docker tag
docker-gitops:
name: Update docker
needs: [docker-build-push]
if: success()
runs-on: ubuntu-latest
outputs:
values_commit: ${{ steps.update.outputs.values_commit }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: niko/gitea-ci-library
path: .ci
- name: Update values.yaml tag
id: update
run: |
INPUTS=$(jq -nc \
--arg file "dev/values.yaml" \
--arg yq_tpl '.service.tag = "{{VERSION}}"' \
--arg version "${{ needs.check-version.outputs.version }}" \
--arg source_repo "${{ github.repository }}" \
--arg source_commit "${{ github.sha }}" \
--arg git_tag_prefix "docker" \
'{file: $file, yq_tpl: $yq_tpl, version: $version, source_repo: $source_repo, source_commit: $source_commit, git_tag_prefix: $git_tag_prefix}')
OUTPUT=$(bash .ci/scripts/dispatch-workflow.sh \
"niko/gitea-ci-gitops-tests" "gitops-service.yaml" "main" \
"$INPUTS" "${{ fromJson(needs.load-config.outputs.env_json).GITEA_API_URL }}" \
"${{ secrets.GITOPS_DISPATCH_TOKEN }}" "30")
echo "$OUTPUT"
VALUES_REPO=$(echo "$OUTPUT" | grep '^GITOPS_COMMIT=' | cut -d= -f2)
echo "values_commit=$VALUES_REPO" >> "$GITHUB_OUTPUT"
uses: niko/gitea-ci-library/.gitea/workflows/gitops-dispatch.yml@main
secrets: inherit
with:
env_json: ${{ needs.load-config.outputs.env_json }}
version: ${{ needs.check-version.outputs.version }}
GITOPS_FILE: dev/values.yaml
GITOPS_YQ_TPL: '.service.tag = "{{VERSION}}"'
GITOPS_REPO: niko/gitea-ci-gitops-tests
report-summary:
name: Report Summary
needs: [load-config, docker-build-push, helm-build-push]
needs: [load-config, check-version, docker-build-push, docker-gitops]
if: always()
uses: niko/gitea-ci-library/.gitea/workflows/report-summary.yml@main
with:
env_json: ${{ needs.load-config.outputs.env_json }}
suites: bats cucumber
gitops-summary:
name: GitOps Summary
needs: [load-config, check-version, gitops-chart, gitops-values]
if: always()
runs-on: ubuntu-latest
steps:
- name: Write GitOps summary
run: |
GITEA_URL="${{ fromJson(needs.load-config.outputs.env_json).GITEA_API_URL }}"
CHART_COMMIT="${{ needs.gitops-chart.outputs.chart_commit }}"
VALUES_COMMIT="${{ needs.gitops-values.outputs.values_commit }}"
CHART_LINK="${GITEA_URL}/niko/gitea-ci-gitops-tests/commit/${CHART_COMMIT}"
VALUES_LINK="${GITEA_URL}/niko/gitea-ci-gitops-tests/commit/${VALUES_COMMIT}"
cat >> "$GITHUB_STEP_SUMMARY" << 'GITOPS'
## GitOps updates
| Component | Version | Status | GitOps commit |
|-----------|---------|--------|--------------|
GITOPS
{
echo "| helm | ${{ needs.check-version.outputs.version }} | ${{ needs.gitops-chart.result }} | [link](${CHART_LINK}) |"
echo "| docker | ${{ needs.check-version.outputs.version }} | ${{ needs.gitops-values.result }} | [link](${VALUES_LINK}) |"
} >> "$GITHUB_STEP_SUMMARY"
gitops: |
${{ needs.docker-gitops.outputs.summary }}
tag-maintenance:
name: Move provider version tag
+15 -2
View File
@@ -5,7 +5,6 @@ on:
- main
paths:
- git-pages/**
- .gitea/workflows/helm-build-push.yml
- .gitea/workflows/git-pages.*
workflow_dispatch:
@@ -36,11 +35,25 @@ jobs:
version: ${{ needs.check-version.outputs.version }}
chart_path: git-pages
chart-gitops:
name: Update chart to the cluster
needs: [helm-push]
uses: niko/gitea-ci-library/.gitea/workflows/gitops-dispatch.yml
secrets: inherit
with:
env_json: ${{ needs.load-config.outputs.env_json }}
version: ${{ needs.check-version.outputs.version }}
GITOPS_FILE: dev/Chart.yaml
GITOPS_YQ_TPL: '(.dependencies[] | select(.name == "git-pages") | .version) = "{{VERSION}}"'
GITOPS_REPO: niko/gitea-ci-gitops-tests
report-summary:
name: Report Summary
needs: [load-config, helm-push]
needs: [load-config, helm-push, chart-gitops]
if: always()
uses: niko/gitea-ci-library/.gitea/workflows/report-summary.yml@main
with:
env_json: ${{ needs.load-config.outputs.env_json }}
suites: ""
gitops: |
${{ needs.chart-gitops.outputs.summary }}
@@ -3,3 +3,4 @@ HELM_REGISTRY=gitea.app.keskikuja.site/niko
HELM_UI_URL=https://gitea.app.keskikuja.site/niko/-/packages/container
GIT_TAG_PREFIX=git-pages/
VERSION_FILE=git-pages/Chart.yaml
+58
View File
@@ -0,0 +1,58 @@
name: GitOps Dispatch
on:
workflow_call:
inputs:
env_json:
required: true
type: string
version:
required: true
type: string
GITOPS_FILE:
required: true
type: string
GITOPS_YQ_TPL:
required: true
type: string
GITOPS_REPO:
required: true
type: string
secrets:
GITOPS_DISPATCH_TOKEN:
required: true
outputs:
summary:
description: 'Pipe-format: component|version|status|commit_sha|repo'
value: ${{ jobs.dispatch.outputs.summary }}
env:
GITOPS_VERSION: ${{ inputs.version }}
GITOPS_FILE: ${{ inputs.GITOPS_FILE }}
GITOPS_YQ_TPL: ${{ inputs.GITOPS_YQ_TPL }}
GITOPS_REPO: ${{ inputs.GITOPS_REPO }}
GITOPS_SOURCE_REPO: ${{ github.repository }}
GITOPS_SOURCE_COMMIT: ${{ github.sha }}
GITEA_API_URL: ${{ fromJson(inputs.env_json).GITEA_API_URL }}
GITOPS_TAG_PREFIX: ${{ fromJson(inputs.env_json).GIT_TAG_PREFIX || '' }}
GITOPS_WORKFLOW: gitops-service.yaml
jobs:
dispatch:
runs-on: ubuntu-latest
outputs:
summary: ${{ steps.run.outputs.GITOPS_SUMMARY }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: niko/gitea-ci-library
path: .ci
- name: Run gitops dispatch
id: run
env:
GITEA_TOKEN: ${{ secrets.GITOPS_DISPATCH_TOKEN }}
run: |
OUTPUT=$(bash .ci/scripts/gitops-dispatch.sh)
echo "$OUTPUT"
SUMMARY=$(awk -F= '/^GITOPS_SUMMARY=/ {print $2}' <<<"$OUTPUT")
echo "GITOPS_SUMMARY=$SUMMARY" >> "$GITHUB_OUTPUT"
+23
View File
@@ -9,6 +9,10 @@ on:
required: true
type: string
description: Space-separated suite names published to git-pages
gitops:
required: false
type: string
description: 'Pipe-separated rows: component|version|status|commit_sha|repo'
env:
GIT_PAGES_URL: ${{ fromJson(inputs.env_json).GIT_PAGES_URL }}
@@ -32,3 +36,22 @@ jobs:
echo "| ${suite} | [View report](${BASE}/${suite}/) |"
done
} >> "${GITHUB_STEP_SUMMARY}"
if [ -n "${{ inputs.gitops }}" ]; then
GITEA_URL="${{ fromJson(inputs.env_json).GITEA_API_URL }}"
{
echo ""
echo "## GitOps updates"
echo ""
echo "| Component | Version | Status | GitOps commit |"
echo "|-----------|---------|--------|--------------|"
echo '${{ inputs.gitops }}' | while IFS='|' read -r comp ver status sha repo; do
[ -z "$comp" ] && continue
if [ -n "$sha" ]; then
echo "| $comp | $ver | $status | [link]($GITEA_URL/$repo/commit/$sha) |"
else
echo "| $comp | $ver | $status | — |"
fi
done
} >> "${GITHUB_STEP_SUMMARY}"
fi