From 747a4cb108324cf61008bc19546384967eea7a5a Mon Sep 17 00:00:00 2001 From: Tracewebstudio Dev Date: Tue, 14 Apr 2026 14:34:00 +0200 Subject: [PATCH] ci: add gitops update step while keeping original registry config --- .woodpecker.yml | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 833d879..4efea65 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,9 +1,3 @@ -# Woodpecker CI - Build all services + update GitOps with image digests -# -# Secrets required in Woodpecker: -# - REGISTRY_HOSTPORT, REGISTRY_USERNAME, REGISTRY_PASSWORD (existing) -# - GITOPS_REPO_URL, GITOPS_BRANCH, GITOPS_TOKEN, GITOPS_USERNAME, GITOPS_EMAIL - when: branch: [main, high-performance] event: push @@ -38,7 +32,8 @@ steps: - name: build-and-push image: woodpeckerci/plugin-kaniko:2.1.1 settings: - registry: registry.nxtgauge.com:5000 + registry: + from_secret: REGISTRY_HOSTPORT repo: nxtgauge-rust-${SERVICE} dockerfile: Dockerfile.simple build_args: @@ -62,23 +57,16 @@ steps: commands: - | set -e - echo "Updating GitOps for ${SERVICE}" - - # Clone gitops repo using cloned source from Woodpecker git clone https://github.com/Traceworks2023/nxtgauge-gitops.git /tmp/gitops cd /tmp/gitops git checkout main - - # Update backend overlay BACKEND_OVERLAY="apps/nxtgauge-backend-rust/overlays/prod" if [ -f "${BACKEND_OVERLAY}/kustomization.yaml" ]; then sed -i "s|image: registry.nxtgauge.com:5000/nxtgauge-rust-${SERVICE}:.*|image: registry.nxtgauge.com:5000/nxtgauge-rust-${SERVICE}:${CI_COMMIT_SHA}|" \ ${BACKEND_OVERLAY}/kustomization.yaml echo "Updated ${SERVICE} in ${BACKEND_OVERLAY}/kustomization.yaml" fi - - # Commit and push if ! git diff --quiet; then git config user.name "Woodpecker CI" git config user.email "woodpecker@nxtgauge.com" @@ -93,7 +81,6 @@ steps: status: success --- -# Database migrations pipeline when: branch: [main, high-performance] event: push @@ -102,7 +89,8 @@ steps: - name: build-and-push-migrate image: woodpeckerci/plugin-kaniko:2.1.1 settings: - registry: registry.nxtgauge.com:5000 + registry: + from_secret: REGISTRY_HOSTPORT repo: nxtgauge-db-migrate dockerfile: Dockerfile.migrate context: .