From 597cbd40f81827f1677fdac54040c3f2746bf6dd Mon Sep 17 00:00:00 2001 From: migatu Date: Mon, 3 Aug 2026 20:12:29 +0200 Subject: [PATCH] conjurer: deploy bot on its own [deploy]-gated image channel The production bot now tracks conjurer-bot-deploy instead of conjurer-bot, so it updates only when the conjurer CI promotes a build (commit message contains [deploy]). Adds the image-updater 'deploy-bot' alias and the kustomization images entry for it; DEPLOY-BOT.md documents the channel and the one-time bootstrap. Test bot + librarian keep tracking every build. Pairs with conjurer#20 (the CI promotion step). Co-Authored-By: Claude Opus 4.8 --- conjurer/DEPLOY-BOT.md | 25 +++++++++++++++++++++++++ conjurer/conjurer-imageupdater.yaml | 7 +++++-- conjurer/deploy-bot.yaml | 6 +++++- conjurer/kustomization.yaml | 6 ++++++ 4 files changed, 41 insertions(+), 3 deletions(-) diff --git a/conjurer/DEPLOY-BOT.md b/conjurer/DEPLOY-BOT.md index 026ae7a..8c9917b 100644 --- a/conjurer/DEPLOY-BOT.md +++ b/conjurer/DEPLOY-BOT.md @@ -12,6 +12,31 @@ namespace, sharing the same librarian / musician / radio and the shared Files: `deploy-bot.yaml` (Deployment + Service), `deploy-bot-backup.yaml` (daily backup CronJob). Both are wired into `kustomization.yaml`. +## Update channel — only on `[deploy]` + +Unlike the test bot (which tracks every build), the production bot updates **only +when you promote a version**. It runs a **separate image**, +`conjurer-bot-deploy`, which the conjurer CI tags **only when the commit message +contains `[deploy]`** (it re-tags the already-built `conjurer-bot:` — same +bytes). The image-updater's `deploy-bot` alias then bumps this bot's tag. + +So: normal commits update the test bot + librarian; a commit with `[deploy]` in +its message is the one that also rolls the production bot. + +**Already bootstrapped:** the channel was seeded by the first `[deploy]` commit +(the merge of conjurer#20), which promoted `conjurer-bot-deploy:fbd1ec9f` — the +tag pinned in `kustomization.yaml`. From here the image-updater keeps it current +on each future `[deploy]` commit. Note the librarian is shared and still tracks +latest, so mind large bot⇄librarian version skews. + +If you ever need to seed a tag by hand: +```bash +docker pull gitea.czernobog.pl/gitea/conjurer-bot: +docker tag gitea.czernobog.pl/gitea/conjurer-bot: \ + gitea.czernobog.pl/gitea/conjurer-bot-deploy: +docker push gitea.czernobog.pl/gitea/conjurer-bot-deploy: +``` + ## One-time setup 1. **Secret** — already exists as `deploy-conjurer-netrc` (a netrc carrying the diff --git a/conjurer/conjurer-imageupdater.yaml b/conjurer/conjurer-imageupdater.yaml index 9401123..9561234 100644 --- a/conjurer/conjurer-imageupdater.yaml +++ b/conjurer/conjurer-imageupdater.yaml @@ -15,5 +15,8 @@ spec: applicationRefs: - namePattern: "conjurer" images: - - { alias: "librarian", imageName: "gitea.czernobog.pl/gitea/conjurer-librarian" } - - { alias: "bot", imageName: "gitea.czernobog.pl/gitea/conjurer-bot" } \ No newline at end of file + - { alias: "librarian", imageName: "gitea.czernobog.pl/gitea/conjurer-librarian" } + - { alias: "bot", imageName: "gitea.czernobog.pl/gitea/conjurer-bot" } + # Production bot tracks its own image, which only gets new tags on + # [deploy] commits (conjurer CI) - so it updates only on promoted builds. + - { alias: "deploy-bot", imageName: "gitea.czernobog.pl/gitea/conjurer-bot-deploy" } \ No newline at end of file diff --git a/conjurer/deploy-bot.yaml b/conjurer/deploy-bot.yaml index ed87bb6..a604a50 100644 --- a/conjurer/deploy-bot.yaml +++ b/conjurer/deploy-bot.yaml @@ -30,7 +30,11 @@ spec: imagePullSecrets: [{ name: gitea-registry }] containers: - name: bot - image: gitea.czernobog.pl/gitea/conjurer-bot:c8aae106 + # SEPARATE image from the test bot: conjurer-bot-deploy only gets a new + # tag when a commit message contains [deploy] (see the conjurer CI), so + # this bot updates only on versions you explicitly promote. Tag is + # managed by the image-updater (kustomization images:). + image: gitea.czernobog.pl/gitea/conjurer-bot-deploy:c8aae106 ports: [{ containerPort: 5000 }] env: - { name: CONJURER_DATA_DIR, value: "/data" } diff --git a/conjurer/kustomization.yaml b/conjurer/kustomization.yaml index 9a446eb..016e45e 100644 --- a/conjurer/kustomization.yaml +++ b/conjurer/kustomization.yaml @@ -11,3 +11,9 @@ images: newTag: fbd1ec9f - name: gitea.czernobog.pl/gitea/conjurer-bot newTag: fbd1ec9f + # Production bot channel - only bumped when a [deploy]-tagged build appears. + # Bootstrapped to fbd1ec9f: that's the image the first [deploy] build (merge + # of conjurer#20) promoted to conjurer-bot-deploy. From here the image-updater + # keeps it current across future [deploy] commits. + - name: gitea.czernobog.pl/gitea/conjurer-bot-deploy + newTag: fbd1ec9f