$schema: "pipeline.schema.v1"
serviceGroup: Microsoft.Azure.ARO.HCP.RP.Frontend
rolloutName: RP Frontend Rollout
resourceGroups:
- name: '{{ .global.rg }}'
  subscription: '{{ .global.subscription }}'
  steps:
  - name: mirror-image
    action: Shell
    command: ../image-sync/on-demand/sync.sh
    dryRun:
      variables:
      - name: DRY_RUN
        value: "true"
    variables:
    - name: TARGET_ACR
      configRef: acr.svc.name
    - name: SOURCE_REGISTRY
      configRef: frontend.image.registry
    - name: REPOSITORY
      configRef: frontend.image.repository
    - name: DIGEST
      configRef: frontend.image.digest
    - name: PULL_SECRET_KV
      configRef: global.keyVault.name
    - name: PULL_SECRET
      configRef: imageSync.componentSync.pullSecretName
- name: '{{ .svc.rg  }}'
  subscription: '{{ .svc.subscription  }}'
  aksCluster: '{{ .svc.aks.name  }}'
  steps:
  - name: deploy
    action: Shell
    command: make deploy
    dryRun:
      variables:
      - name: DRY_RUN
        value: "true"
    dependsOn:
    - mirror-image
    variables:
    - name: ARO_HCP_IMAGE_ACR
      configRef: acr.svc.name
    - name: LOCATION
      configRef: region
    - name: RESOURCEGROUP
      configRef: svc.rg
    - name: AKS_NAME
      configRef: svc.aks.name
    - name: DB_NAME
      configRef: frontend.cosmosDB.name
    - name: IMAGE_DIGEST
      configRef: frontend.image.digest
    - name: ARO_HCP_IMAGE_REPOSITORY
      configRef: frontend.image.repository
    - name: SERVICE_KEY_VAULT
      configRef: serviceKeyVault.name
    - name: CERTIFICATE_NAME
      configRef: frontend.cert.name
    - name: ISTO_TAG
      configRef: svc.istio.tag
    - name: CS_NAMESPACE
      configRef: clustersService.k8s.namespace
    - name: CS_SERVICE_ACCOUNT_NAME
      configRef: clustersService.k8s.serviceAccountName
    - name: DEPLOY_MISE
      configRef: mise.deploy
    - name: MISE_TENANT_ID
      configRef: mise.tenantId
    - name: MISE_ARM_APP_ID
      configRef: mise.armAppId
    - name: MISE_IMAGE_REPOSITORY
      configRef: mise.image.repository
    - name: MISE_IMAGE_DIGEST
      configRef: mise.image.digest
    - name: MISE_AZURE_AD_INSTANCE
      configRef: mise.azureAdInstance
    - name: MISE_FIRST_PARTY_APP_ID
      configRef: mise.firstPartyAppId
    - name: MISE_ARM_INSTANCE
      configRef: mise.armInstance
    - name: TRACING_ADDRESS
      configRef: frontend.tracing.address
    - name: TRACING_EXPORTER
      configRef: frontend.tracing.exporter
