---
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
  name: prop
  namespace: flux-system
spec:
  interval: 1m
  url: https://git.mcintire.me/graham/prop.git
  ref:
    branch: main
  secretRef:
    name: forgejo-git-credentials
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
  name: prop-app
  namespace: flux-system
spec:
  interval: 5m
  sourceRef:
    kind: GitRepository
    name: prop
  path: ./k8s
  prune: true
  targetNamespace: prop
---
apiVersion: image.toolkit.fluxcd.io/v1
kind: ImageRepository
metadata:
  name: prop
  namespace: flux-system
spec:
  image: git.mcintire.me/graham/prop
  interval: 1m
  provider: generic
  secretRef:
    name: forgejo-registry
---
apiVersion: image.toolkit.fluxcd.io/v1
kind: ImagePolicy
metadata:
  name: prop
  namespace: flux-system
spec:
  imageRepositoryRef:
    name: prop
  policy:
    numerical:
      order: asc
  filterTags:
    pattern: ^main-(?P<ts>[0-9]+)-[a-f0-9]+$
    extract: $ts
---
apiVersion: image.toolkit.fluxcd.io/v1
kind: ImageUpdateAutomation
metadata:
  name: prop
  namespace: flux-system
spec:
  interval: 1m
  sourceRef:
    kind: GitRepository
    name: prop
  git:
    checkout:
      ref:
        branch: main
    commit:
      author:
        name: FluxCD
        email: fluxcd@w5isp.com
      messageTemplate: 'chore: update prop image to {{range .Changed.Changes}}{{.NewValue}}{{end}} [skip ci]'
    push:
      branch: main
  update:
    path: ./k8s
    strategy: Setters
