Skip to content

Commit 88a215f

Browse files
halliprbenbp
andauthored
Add arm/bicep deployment to pipelinewitness ci (#8151)
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
1 parent 50a0474 commit 88a215f

5 files changed

Lines changed: 60 additions & 2 deletions

File tree

eng/pipelines/templates/stages/archetype-sdk-tool-azure-webapp.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ parameters:
88
- name: Staging
99
type: object
1010
default: {}
11+
- name: ProductionArmSteps
12+
type: stepList
13+
default: []
14+
- name: StagingArmSteps
15+
type: stepList
16+
default: []
1117

1218
stages:
1319
- stage: Build
@@ -38,8 +44,22 @@ stages:
3844
- stage: Staging
3945
dependsOn: Build
4046
jobs:
41-
- deployment: PublishFunction
47+
- ${{ if ne(length(parameters.StagingArmSteps), 0) }}:
48+
- deployment: PublishArm
49+
displayName: Publish ARM
50+
environment: ${{ parameters.Staging.EnvironmentName }}
51+
pool:
52+
name: azsdk-pool-mms-ubuntu-2204-general
53+
strategy:
54+
runOnce:
55+
deploy:
56+
steps: ${{ parameters.StagingArmSteps }}
57+
58+
- deployment: PublishApp
59+
displayName: Publish App
4260
environment: ${{ parameters.Staging.EnvironmentName }}
61+
${{ if ne(length(parameters.StagingArmSteps), 0) }}:
62+
dependsOn: PublishArm
4363
pool:
4464
name: azsdk-pool-mms-ubuntu-2204-general
4565
vmImage: ubuntu-22.04
@@ -65,8 +85,22 @@ stages:
6585
- stage: Production
6686
dependsOn: Staging
6787
jobs:
68-
- deployment: PublishFunction
88+
- ${{ if ne(length(parameters.ProductionArmSteps), 0) }}:
89+
- deployment: PublishArm
90+
displayName: Publish ARM
91+
environment: ${{ parameters.Production.EnvironmentName }}
92+
pool:
93+
name: azsdk-pool-mms-ubuntu-2204-general
94+
strategy:
95+
runOnce:
96+
deploy:
97+
steps: ${{ parameters.ProductionArmSteps }}
98+
99+
- deployment: PublishApp
100+
displayName: Publish App
69101
environment: ${{ parameters.Production.EnvironmentName }}
102+
${{ if ne(length(parameters.ProductionArmSteps), 0) }}:
103+
dependsOn: PublishArm
70104
pool:
71105
name: azsdk-pool-mms-ubuntu-2204-general
72106
vmImage: ubuntu-22.04

tools/pipeline-witness/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,26 @@ extends:
3232
ResourceGroupName: pipelinewitnessprod
3333
AzureSubscription: Azure SDK Engineering System
3434
ResourceName: pipelinewitnessprod-app
35+
ProductionArmSteps:
36+
- checkout: self
37+
- task: AzureCLI@2
38+
displayName: 'Deploy ARM Template'
39+
inputs:
40+
azureSubscription: Azure SDK Engineering System
41+
scriptType: pscore
42+
scriptPath: tools/pipeline-witness/infrastructure/deploy.ps1
43+
arguments: '-target production'
3544
Staging:
3645
EnvironmentName: package-publish
3746
ResourceGroupName: pipelinewitnessstaging
3847
AzureSubscription: Azure SDK Engineering System
3948
ResourceName: pipelinewitnessstaging-app
49+
StagingArmSteps:
50+
- checkout: self
51+
- task: AzureCLI@2
52+
displayName: 'Deploy ARM Template'
53+
inputs:
54+
azureSubscription: Azure SDK Engineering System
55+
scriptType: pscore
56+
scriptPath: tools/pipeline-witness/infrastructure/deploy.ps1
57+
arguments: '-target staging'

tools/pipeline-witness/infrastructure/deploy.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ try {
3434

3535
Write-Host "> az deployment sub create --template-file './bicep/resourceGroup.bicep' --parameters $parametersFile --location $location --name $deploymentName"
3636
az deployment sub create --template-file './bicep/resourceGroup.bicep' --parameters $parametersFile --location $location --name $deploymentName
37+
if($LASTEXITCODE -eq 0) {
38+
Write-Host "Deployed resource group"
39+
} else {
40+
Write-Error "Failed to deploy resource group"
41+
exit 1
42+
}
3743
} finally {
3844
Pop-Location
3945
}

tools/pipeline-witness/infrastructure/kusto/functions/users/kojamroz/LintDiff_report.kql renamed to tools/pipeline-witness/infrastructure/kusto/functions/users/kojamroz/LintDiff_report.kql.ignore

File renamed without changes.

tools/pipeline-witness/infrastructure/kusto/functions/users/kojamroz/SpecsPipelinesBuildsJobLogs.kql renamed to tools/pipeline-witness/infrastructure/kusto/functions/users/kojamroz/SpecsPipelinesBuildsJobLogs.kql.ignore

File renamed without changes.

0 commit comments

Comments
 (0)