# Flux image automation: watches the Forgejo registry for new hello-app # tags, and rewrites deployment.yaml's image tag + commits back to this repo # when one shows up. Requires clusters/homelab/flux-system to have write # access to the Forgejo repo (flux bootstrap sets this up). apiVersion: image.toolkit.fluxcd.io/v1 kind: ImageRepository metadata: name: hello-app namespace: hello-app spec: image: git.boglabob.com/codegit/hello-app interval: 1m # Uncomment + create the secret if the package is private. # secretRef: # name: forgejo-registry --- apiVersion: image.toolkit.fluxcd.io/v1 kind: ImagePolicy metadata: name: hello-app namespace: hello-app spec: imageRepositoryRef: name: hello-app policy: numerical: order: asc filterTags: pattern: '^main-[a-f0-9]+-(?P\d+)$' extract: '$ts' --- apiVersion: image.toolkit.fluxcd.io/v1 kind: ImageUpdateAutomation metadata: name: hello-app namespace: flux-system spec: interval: 1m sourceRef: kind: GitRepository name: flux-system git: checkout: ref: branch: main commit: author: email: flux@boglabob.com name: fluxcdbot messageTemplate: | chore(hello-app): auto-update image to {{range .Updated.Images}}{{println .}}{{end}} push: branch: main update: path: ./ strategy: Setters