name: Deploy the configuration overwriter trigger: branches: include: - main paths: include: - site-config/sitedefault.yaml variables: - template: /deployment/config/input_vars.yaml pool: devopsagentspool stages: - stage: ConfigOverwriter displayName: Create the Config Overwrite cronjob jobs: - job: ConfigOverwriter displayName: Create the Config Overwrite cronjob steps: - script: if [ -e /usr/bin/az ]; then echo "Azure CLI already installed"; else curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash; fi displayName: Install Azure CLI - task: DownloadGitHubRelease@0 displayName: Download yq inputs: connection: 'github-endpoint' userRepository: 'mikefarah/yq' defaultVersionType: 'specificTag' version: '$(yq_version)' itemPattern: 'yq_linux_amd64' downloadPath: '$(System.ArtifactsDirectory)' - script: chmod u+x $(System.ArtifactsDirectory)/yq_linux_amd64 displayName: Make yq executable - task: KubectlInstaller@0 displayName: Install kubectl inputs: kubectlVersion: $(kubectl_version) - script: | $(System.ArtifactsDirectory)/yq_linux_amd64 site-config/sitedefault.yaml -o json > sitedefault.json displayName: Convert sitedefault YAML to JSON - script: | kubectl create configmap sitedefault \ --from-file sitedefault.json \ --dry-run=client -o yaml > sitedefault_cm.yaml displayName: Create the sitedefault configmap YAML - task: Kubernetes@1 displayName: Create the sitedefault configmap inputs: connectionType: 'Azure Resource Manager' azureSubscriptionEndpoint: '$(subscription)' azureResourceGroup: $(resource_group) kubernetesCluster: $(cluster_name) namespace: $(viya_namespace) command: 'apply' arguments: '-f sitedefault_cm.yaml' versionSpec: '$(kubectl_version)' - script: sed -i 's|a_fqdn|$(fqdn)|g' postconfig/configuration-overwriter.yaml displayName: Set the fqdn name - script: sed -i 's|a_acr_name|$(acr_name)|g' postconfig/configuration-overwriter.yaml displayName: Set the ACR name - task: Kubernetes@1 displayName: Create the Configuration Overwriter cronjob inputs: connectionType: 'Azure Resource Manager' azureSubscriptionEndpoint: '$(subscription)' azureResourceGroup: $(resource_group) kubernetesCluster: $(cluster_name) namespace: $(viya_namespace) command: 'apply' arguments: '-f postconfig/configuration-overwriter.yaml' versionSpec: '$(kubectl_version)'