apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: woodpecker
  namespace: argocd
  finalizers:
    - resources-finalizer.argocd.argoproj.io
spec:
  sources:
    - path: apps/woodpecker
      repoURL: https://git.tbrnt.ch/tobru/gitops-zurrli.git
      targetRevision: HEAD
    - chart: woodpecker-server
      repoURL: https://woodpecker-ci.org/
      targetRevision: 0.15.6
      helm:
        values: |
          env:
            WOODPECKER_HOST: https://ci.tbrnt.ch
            WOODPECKER_GITEA: true
            WOODPECKER_GITEA_URL: https://git.tbrnt.ch/
            WOODPECKER_GITHUB: false
            WOODPECKER_OPEN: true
          extraSecretNamesForEnvFrom:
            - woodpecker-secret
          persistentVolume:
            storageClass: local-path
          ingress:
            enabled: true
            annotations:
              cert-manager.io/cluster-issuer: letsencrypt-prod
              traefik.ingress.kubernetes.io/router.middlewares: kube-system-redirect-https@kubernetescrd
            hosts:
              - host: ci.tbrnt.ch
                paths:
                  - path: /
            tls:
              - secretName: ingress-tls
                hosts:
                  - ci.tbrnt.ch
    - chart: woodpecker-agent
      repoURL: https://woodpecker-ci.org/
      targetRevision: 0.15.6
      helm:
        values: |
          image:
            tag: next-alpine
          env:
            WOODPECKER_SERVER: woodpecker-woodpecker-server:9000
            WOODPECKER_BACKEND: kubernetes
            WOODPECKER_BACKEND_K8S_NAMESPACE: woodpecker
            WOODPECKER_BACKEND_K8S_STORAGE_CLASS: local-path
  destination:
    namespace: woodpecker
    server: https://kubernetes.default.svc
  project: apps
  syncPolicy:
    syncOptions:
      - CreateNamespace=true
