apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: argocd
  namespace: argocd
  labels:
    env: dev
spec:
  project: default
  syncPolicy:
    automated:
      selfHeal: true
    syncOptions:
      - CreateNamespace=true
    retry:
      limit: -1
  destination:
    name: in-cluster
    namespace: argocd
  sources:
    - repoURL: https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/DevFW-CICD/argocd-helm.git
      path: charts/argo-cd
      # TODO: RIRE Can be updated when https://github.com/argoproj/argo-cd/issues/20790 is fixed and merged
      # As logout make problems, it is suggested to switch from path based routing to an own argocd domain,
      # similar to the CNOE amazon reference implementation and in our case, Forgejo
      targetRevision: argo-cd-7.8.14-depends
      helm:
        valueFiles:
          - $values/otc/demo-forgejo.think-ahead.cloud/stacks/core/argocd/values.yaml
    - repoURL: https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/DevFW-CICD/stacks-instances
      targetRevision: HEAD
      ref: values
