environments:
  {{ .Environment.Name }}:
---
helmDefaults:
  timeout: 600
  kubeContext: k8s-dev
  wait: true
  recreatePods: false

repositories:
  - name: blockscout-ci-cd
    url: https://blockscout.github.io/blockscout-ci-cd
  - name: bedag
    url: https://bedag.github.io/helm-charts

releases:
  # Deploy front-main
  - name: bs-stack
    chart: blockscout-ci-cd/blockscout-stack
    namespace: front-main
    labels:
      app: front
    values:
    - values/main/values.yaml
    - global:
        env: "main"
  # Deploy l2-optimism-goerli
  - name: bs-stack
    chart: blockscout-ci-cd/blockscout-stack
    namespace: l2-optimism-goerli
    labels:
      app: l2-optimism-goerli
    values:
    - values/l2-optimism-goerli/values.yaml
    - global:
        env: "optimism-goerli"
  # Deploy review L2
  - name: reg-secret
    chart: bedag/raw
    namespace: review-l2-{{ requiredEnv "GITHUB_REF_NAME_SLUG" }}
    labels:
      app: review-l2-{{ requiredEnv "GITHUB_REF_NAME_SLUG" }}
    values:
      - resources:
        - apiVersion: v1
          data:
            .dockerconfigjson: ref+vault://deployment-values/blockscout/common?token_env=VAULT_TOKEN&address=https://vault.k8s.blockscout.com#/dockerRegistryCreds
          kind: Secret
          metadata:
            name: regcred
          type: kubernetes.io/dockerconfigjson
  - name: bs-stack
    chart: blockscout-ci-cd/blockscout-stack
    namespace: review-l2-{{ requiredEnv "GITHUB_REF_NAME_SLUG" }}
    labels:
      app: review-l2-{{ requiredEnv "GITHUB_REF_NAME_SLUG" }}
    values:
    - values/review-l2/values.yaml.gotmpl
    - global:
        env: "review"
  # Deploy review
  - name: reg-secret
    chart: bedag/raw
    namespace: review-{{ requiredEnv "GITHUB_REF_NAME_SLUG" }}
    labels:
      app: review-{{ requiredEnv "GITHUB_REF_NAME_SLUG" }}
    values:
      - resources:
        - apiVersion: v1
          data:
            .dockerconfigjson: ref+vault://deployment-values/blockscout/common?token_env=VAULT_TOKEN&address=https://vault.k8s.blockscout.com#/dockerRegistryCreds
          kind: Secret
          metadata:
            name: regcred
          type: kubernetes.io/dockerconfigjson
  - name: bs-stack
    chart: blockscout-ci-cd/blockscout-stack
    namespace: review-{{ requiredEnv "GITHUB_REF_NAME_SLUG" }}
    labels:
      app: review-{{ requiredEnv "GITHUB_REF_NAME_SLUG" }}
    values:
    - values/review/values.yaml.gotmpl
    - global:
        env: "review"