$schema: "pipeline.schema.v1"
serviceGroup: Microsoft.Azure.ARO.HCP.RP.HypershiftOperator
rolloutName: RP HypershiftOperator 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: hypershift.image.registry
    - name: REPOSITORY
      configRef: hypershift.image.repository
    - name: DIGEST
      configRef: hypershift.image.digest
    - name: PULL_SECRET_KV
      configRef: global.keyVault.name
    - name: PULL_SECRET
      configRef: imageSync.componentSync.pullSecretName
- name: '{{ .mgmt.rg  }}'
  subscription: '{{ .mgmt.subscription  }}'
  aksCluster: '{{ .mgmt.aks.name  }}'
  steps:
  - name: deploy
    action: Shell
    command: make deploy
    dryRun:
      variables:
      - name: DRY_RUN
        value: "true"
    dependsOn:
    - mirror-image
    variables:
    - name: ARO_HCP_SVC_ACR
      configRef: acr.svc.name
    - name: ARO_HCP_OCP_ACR
      configRef: acr.ocp.name
    - name: HO_IMAGE_DIGEST
      configRef: hypershift.image.digest
    - name: HO_IMAGE_REPOSITORY
      configRef: hypershift.image.repository
    - name: RESOURCEGROUP
      configRef: mgmt.rg
    - name: AKS_NAME
      configRef: mgmt.aks.name
    - name: HYPERSHIFT_NAMESPACE
      configRef: hypershift.namespace
    - name: HO_ADDITIONAL_INSTALL_ARG
      configRef: hypershift.additionalInstallArg
