bases:
 - ../envs/environments.yaml.gotmpl

# repositories:
# - name: oceanbox
#   url: "git+https://git:{{ requiredEnv "HELM_GIT_ACCESS_TOKEN" }}@gitlab.com/oceanbox/manifests@charts?ref=main"

commonLabels:
  tier: oceanbox

releases:
- name: {{ .Environment.Name }}-atlantis
  namespace: {{ .Environment.Name }}-atlantis
  chart: ../charts/atlantis
  condition: atlantis.enabled
  values:
  - ../values/atlantis/values/values.yaml.gotmpl
  - ../values/atlantis/values/values-{{ .Environment.Name }}.yaml.gotmpl
  postRenderer: ../bin/kustomizer
  postRendererArgs:
  - ../values/atlantis/kustomize/{{ .Environment.Name }}
  missingFileHandler: Info
- name: manifests
  namespace: {{ .Environment.Name }}-atlantis
  chart: manifests
  condition: atlantis.enabled
  missingFileHandler: Info
  values:
  - ../values/env.yaml
  - ../values/env-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml
  - ../values/atlantis/env.yaml.gotmpl
  - ../values/atlantis/env-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml.gotmpl
  hooks:
  - events: [ prepare, cleanup ]
    showlogs: true
    command: ../bin/helmify
    args:
    - '{{`{{ if eq .Event.Name "prepare" }}build{{ else }}clean{{ end }}`}}'
    - '{{`{{ .Release.Chart }}`}}'
    - '{{`{{ .Environment.Name }}`}}'
    - ../values/atlantis/manifests
    - manifests
