75 lines
2.6 KiB
YAML
75 lines
2.6 KiB
YAML
# Build + push the cms-plugins container image.
|
|
# Triggered on push to develop / staging / production. Each push publishes
|
|
# three refs: 0.1.<pipeline> (immutable, audit), <branch> (the floating
|
|
# pointer Flux's ImagePolicy tracks → digest rewritten into the fleet
|
|
# repo → pod rolls), and <branch>-latest (same image; chart image.tag
|
|
# fallback). Only staging/production have an ImagePolicy, so only those
|
|
# move pods.
|
|
#
|
|
# Thin wrapper (cluster #196, emmett#44): this is an Astro/emdash WEB app
|
|
# whose image is built by npm/astro against an upstream lockfile and can NOT
|
|
# be expressed as Nix on emmett/amd64, so it stays on `docker buildx`. CI
|
|
# runs the SAME ci/local.sh a developer runs — the only CI-specific bits are
|
|
# env overrides (BUILDKIT_ADDR -> in-cluster native-arch remote, PUBLISH=1).
|
|
# All the tag/registry semantics live in ci/local.sh so CI and local can't
|
|
# drift.
|
|
|
|
labels:
|
|
# kotkan (the deploy target) is an arm64 host, so we build natively on
|
|
# arm64 — no cross-compile needed.
|
|
arch: arm64
|
|
|
|
when:
|
|
- event: push
|
|
branch: [develop, staging, production]
|
|
|
|
clone:
|
|
- name: clone
|
|
image: woodpeckerci/plugin-git
|
|
environment:
|
|
CI_NETRC_MACHINE: git.oleks.space
|
|
CI_NETRC_USERNAME: oleks
|
|
CI_NETRC_PASSWORD:
|
|
from_secret: gitea_clone_token
|
|
PLUGIN_TAGS: "false"
|
|
PLUGIN_DEPTH: "1"
|
|
|
|
steps:
|
|
- name: build-and-push
|
|
image: git.oleks.space/oleks/nix-ci:latest-arm64
|
|
environment:
|
|
REGISTRY_TOKEN:
|
|
from_secret: registry_token
|
|
# In-cluster native arm64 buildkit (kotkan's arch). ci/local.sh treats
|
|
# this as a native remote builder and skips qemu emulation.
|
|
BUILDKIT_ADDR: "tcp://buildkit-arm64.infra.svc.cluster.local:1234"
|
|
PUBLISH: "1"
|
|
commands:
|
|
- echo "▸ arch=$(uname -m)"
|
|
# Wait for the in-cluster buildkit to be reachable (it can be cold).
|
|
- |
|
|
BUILDER_HOST="buildkit-arm64.infra.svc.cluster.local"
|
|
BUILDER_PORT="1234"
|
|
echo "Waiting for buildkit at $BUILDER_HOST:$BUILDER_PORT..."
|
|
for i in $(seq 1 30); do
|
|
if echo >/dev/tcp/$BUILDER_HOST/$BUILDER_PORT 2>/dev/null; then
|
|
echo "Builder ready"; break
|
|
fi
|
|
[ "$i" -eq 30 ] && echo "Builder not available" && exit 1
|
|
sleep 10
|
|
done
|
|
- ci/local.sh --arch arm64
|
|
backend_options:
|
|
kubernetes:
|
|
nodeSelector:
|
|
kubernetes.io/arch: arm64
|
|
resources:
|
|
requests:
|
|
memory: 4Gi
|
|
limits:
|
|
memory: 4Gi
|
|
labels:
|
|
commit-branch: "${CI_COMMIT_BRANCH}"
|
|
commit-sha: "${CI_COMMIT_SHA}"
|
|
pipeline-number: "${CI_PIPELINE_NUMBER}"
|