|
| 1 | +# Orchestrating pipeline: Deploy all demo apps and teardown after demo |
| 2 | +# Manually triggered - deploys all 6 apps in parallel, then tears down with approval |
| 3 | +trigger: none |
| 4 | + |
| 5 | +resources: |
| 6 | + repositories: |
| 7 | + - repository: app001 |
| 8 | + type: git |
| 9 | + name: a11y-demo-app-001 |
| 10 | + - repository: app002 |
| 11 | + type: git |
| 12 | + name: a11y-demo-app-002 |
| 13 | + - repository: app003 |
| 14 | + type: git |
| 15 | + name: a11y-demo-app-003 |
| 16 | + - repository: app004 |
| 17 | + type: git |
| 18 | + name: a11y-demo-app-004 |
| 19 | + - repository: app005 |
| 20 | + type: git |
| 21 | + name: a11y-demo-app-005 |
| 22 | + |
| 23 | +pool: |
| 24 | + vmImage: 'ubuntu-latest' |
| 25 | + |
| 26 | +variables: |
| 27 | + serviceConnection: 'AODA-svc-conn' |
| 28 | + location: 'canadacentral' |
| 29 | + |
| 30 | +stages: |
| 31 | + # ── Deploy demo apps 001-005 (all in parallel) ── |
| 32 | + - template: templates/deploy-app-stage.yml |
| 33 | + parameters: |
| 34 | + stageId: 'Deploy_001' |
| 35 | + stageName: 'Deploy App 001 (Rust)' |
| 36 | + appName: 'a11y-demo-app-001' |
| 37 | + resourceGroup: 'rg-a11y-demo-app-001' |
| 38 | + repository: 'app001' |
| 39 | + containerPort: '8080' |
| 40 | + |
| 41 | + - template: templates/deploy-app-stage.yml |
| 42 | + parameters: |
| 43 | + stageId: 'Deploy_002' |
| 44 | + stageName: 'Deploy App 002 (C#)' |
| 45 | + appName: 'a11y-demo-app-002' |
| 46 | + resourceGroup: 'rg-a11y-demo-app-002' |
| 47 | + repository: 'app002' |
| 48 | + containerPort: '8080' |
| 49 | + |
| 50 | + - template: templates/deploy-app-stage.yml |
| 51 | + parameters: |
| 52 | + stageId: 'Deploy_003' |
| 53 | + stageName: 'Deploy App 003 (Java)' |
| 54 | + appName: 'a11y-demo-app-003' |
| 55 | + resourceGroup: 'rg-a11y-demo-app-003' |
| 56 | + repository: 'app003' |
| 57 | + containerPort: '8080' |
| 58 | + |
| 59 | + - template: templates/deploy-app-stage.yml |
| 60 | + parameters: |
| 61 | + stageId: 'Deploy_004' |
| 62 | + stageName: 'Deploy App 004 (Python)' |
| 63 | + appName: 'a11y-demo-app-004' |
| 64 | + resourceGroup: 'rg-a11y-demo-app-004' |
| 65 | + repository: 'app004' |
| 66 | + containerPort: '8080' |
| 67 | + |
| 68 | + - template: templates/deploy-app-stage.yml |
| 69 | + parameters: |
| 70 | + stageId: 'Deploy_005' |
| 71 | + stageName: 'Deploy App 005 (Go)' |
| 72 | + appName: 'a11y-demo-app-005' |
| 73 | + resourceGroup: 'rg-a11y-demo-app-005' |
| 74 | + repository: 'app005' |
| 75 | + containerPort: '8080' |
| 76 | + |
| 77 | + # ── Deploy scan demo app (self repo, parallel with others) ── |
| 78 | + - stage: Deploy_ScanDemo |
| 79 | + displayName: 'Deploy Scan Demo App (Next.js)' |
| 80 | + dependsOn: [] |
| 81 | + jobs: |
| 82 | + - job: DeployApp |
| 83 | + displayName: 'Deploy a11y-scan-demo' |
| 84 | + steps: |
| 85 | + - checkout: self |
| 86 | + |
| 87 | + - task: AzureCLI@2 |
| 88 | + displayName: 'Deploy infrastructure' |
| 89 | + inputs: |
| 90 | + azureSubscription: '$(serviceConnection)' |
| 91 | + scriptType: bash |
| 92 | + scriptLocation: inlineScript |
| 93 | + inlineScript: | |
| 94 | + set -e |
| 95 | + az group create \ |
| 96 | + --name rg-a11y-scan-demo \ |
| 97 | + --location $(location) |
| 98 | + az deployment group create \ |
| 99 | + --resource-group rg-a11y-scan-demo \ |
| 100 | + --name infra-deploy \ |
| 101 | + --template-file infra/main.bicep \ |
| 102 | + --parameters infra/main.parameters.json \ |
| 103 | + --parameters imageTag=$(Build.BuildId) |
| 104 | +
|
| 105 | + - task: AzureCLI@2 |
| 106 | + displayName: 'Build and push Docker image' |
| 107 | + inputs: |
| 108 | + azureSubscription: '$(serviceConnection)' |
| 109 | + scriptType: bash |
| 110 | + scriptLocation: inlineScript |
| 111 | + inlineScript: | |
| 112 | + set -e |
| 113 | + ACR_NAME=$(az deployment group show \ |
| 114 | + --resource-group rg-a11y-scan-demo \ |
| 115 | + --name infra-deploy \ |
| 116 | + --query 'properties.outputs.acrName.value' -o tsv) |
| 117 | + echo "ACR: $ACR_NAME" |
| 118 | + az acr build \ |
| 119 | + --registry "$ACR_NAME" \ |
| 120 | + --image a11y-scan-demo:$(Build.BuildId) . |
| 121 | +
|
| 122 | + - task: AzureCLI@2 |
| 123 | + displayName: 'Deploy container to Web App' |
| 124 | + inputs: |
| 125 | + azureSubscription: '$(serviceConnection)' |
| 126 | + scriptType: bash |
| 127 | + scriptLocation: inlineScript |
| 128 | + inlineScript: | |
| 129 | + set -e |
| 130 | + WEB_APP_NAME=$(az deployment group show \ |
| 131 | + --resource-group rg-a11y-scan-demo \ |
| 132 | + --name infra-deploy \ |
| 133 | + --query 'properties.outputs.webAppName.value' -o tsv) |
| 134 | + ACR_LOGIN=$(az deployment group show \ |
| 135 | + --resource-group rg-a11y-scan-demo \ |
| 136 | + --name infra-deploy \ |
| 137 | + --query 'properties.outputs.acrLoginServer.value' -o tsv) |
| 138 | + az webapp config container set \ |
| 139 | + --name $WEB_APP_NAME \ |
| 140 | + --resource-group rg-a11y-scan-demo \ |
| 141 | + --container-image-name "$ACR_LOGIN/a11y-scan-demo:$(Build.BuildId)" |
| 142 | + az webapp restart \ |
| 143 | + --name $WEB_APP_NAME \ |
| 144 | + --resource-group rg-a11y-scan-demo |
| 145 | + SITE_URL=$(az deployment group show \ |
| 146 | + --resource-group rg-a11y-scan-demo \ |
| 147 | + --name infra-deploy \ |
| 148 | + --query 'properties.outputs.webAppUrl.value' -o tsv) |
| 149 | + echo "Deployed scan demo app to: $SITE_URL" |
| 150 | +
|
| 151 | + # ── Teardown (requires approval on 'teardown' environment) ── |
| 152 | + - template: templates/teardown-stage.yml |
| 153 | + parameters: |
| 154 | + dependsOn: |
| 155 | + - Deploy_001 |
| 156 | + - Deploy_002 |
| 157 | + - Deploy_003 |
| 158 | + - Deploy_004 |
| 159 | + - Deploy_005 |
| 160 | + - Deploy_ScanDemo |
| 161 | + resourceGroups: |
| 162 | + - 'rg-a11y-demo-app-001' |
| 163 | + - 'rg-a11y-demo-app-002' |
| 164 | + - 'rg-a11y-demo-app-003' |
| 165 | + - 'rg-a11y-demo-app-004' |
| 166 | + - 'rg-a11y-demo-app-005' |
| 167 | + - 'rg-a11y-scan-demo' |
0 commit comments