apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: peikarband-staging
  namespace: argocd
  annotations:
    notifications.argoproj.io/subscribe.on-deployed.telegram: ""
    notifications.argoproj.io/subscribe.on-sync-failed.telegram: ""
  finalizers:
    - resources-finalizer.argocd.argoproj.io
  labels:
    app: peikarband
    environment: staging
spec:
  project: default
  
  source:
    repoURL: https://git.peikarband.ir/ehsan-minadd/peikarband.git
    targetRevision: develop
    path: helm/peikarband
    helm:
      releaseName: peikarband-staging
      valueFiles:
        - values-staging.yaml
      parameters:
        - name: image.repository
          value: harbor.peikarband.ir/peikarband/landing
        - name: image.tag
          value: develop
  
  destination:
    server: https://kubernetes.default.svc
    namespace: peikarband-staging
  
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
      allowEmpty: false
    syncOptions:
      - CreateNamespace=true
      - PrunePropagationPolicy=foreground
      - PruneLast=true
    retry:
      limit: 5
      backoff:
        duration: 5s
        factor: 2
        maxDuration: 3m
  
  revisionHistoryLimit: 10
  
  ignoreDifferences:
    - group: apps
      kind: Deployment
      jsonPointers:
        - /spec/replicas

