nxtgauge-admin-solid/.woodpecker.yml
2026-04-14 18:31:56 +02:00

58 lines
1.8 KiB
YAML

when:
branch: [main, high-performance]
event: push
steps:
- name: build-and-push
image: woodpeckerci/plugin-kaniko:2.1.1
settings:
registry:
from_secret: REGISTRY_HOSTPORT
repo: nxtgauge-admin-solid
dockerfile: Dockerfile.simple
tags:
- ${CI_COMMIT_SHA}
- latest
- high-performance-latest
username:
from_secret: REGISTRY_USERNAME
password:
from_secret: REGISTRY_PASSWORD
insecure: true
insecure_pull: true
skip_tls_verify: true
platforms: linux/amd64
cache: false
- name: update-gitops
image: alpine/git:latest
environment:
GHCR_TOKEN:
from_secret: GHCR_TOKEN
GHCR_USERNAME:
from_secret: GHCR_USERNAME
commands:
- |
set -e
echo "Updating GitOps for nxtgauge-admin-solid"
git clone https://${GHCR_USERNAME}:${GHCR_TOKEN}@github.com/Traceworks2023/nxtgauge-gitops.git /tmp/gitops
cd /tmp/gitops
git checkout main
ADMIN_OVERLAY="apps/nxtgauge-admin-solid/overlays/prod"
if [ -f "${ADMIN_OVERLAY}/kustomization.yaml" ]; then
sed -i "s|image: registry.nxtgauge.com:5000/nxtgauge-admin-solid:.*|image: registry.nxtgauge.com:5000/nxtgauge-admin-solid:${CI_COMMIT_SHA}|" \
${ADMIN_OVERLAY}/kustomization.yaml
echo "Updated admin image to ${CI_COMMIT_SHA}"
fi
if ! git diff --quiet; then
git config user.name "Woodpecker CI"
git config user.email "woodpecker@nxtgauge.com"
git add -A
git commit -m "ci: update nxtgauge-admin-solid to ${CI_COMMIT_SHA:0:8}"
git push origin main
echo "Pushed GitOps update"
else
echo "No changes to push"
fi
when:
status: success