Skip to content

Commit

Permalink
Add arm/bicep deployment to pipelinewitness ci (#8151)
Browse files Browse the repository at this point in the history
Co-authored-by: Ben Broderick Phillips <[email protected]>
  • Loading branch information
hallipr and benbp authored Apr 23, 2024
1 parent 50a0474 commit 88a215f
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 2 deletions.
38 changes: 36 additions & 2 deletions eng/pipelines/templates/stages/archetype-sdk-tool-azure-webapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ parameters:
- name: Staging
type: object
default: {}
- name: ProductionArmSteps
type: stepList
default: []
- name: StagingArmSteps
type: stepList
default: []

stages:
- stage: Build
Expand Down Expand Up @@ -38,8 +44,22 @@ stages:
- stage: Staging
dependsOn: Build
jobs:
- deployment: PublishFunction
- ${{ if ne(length(parameters.StagingArmSteps), 0) }}:
- deployment: PublishArm
displayName: Publish ARM
environment: ${{ parameters.Staging.EnvironmentName }}
pool:
name: azsdk-pool-mms-ubuntu-2204-general
strategy:
runOnce:
deploy:
steps: ${{ parameters.StagingArmSteps }}

- deployment: PublishApp
displayName: Publish App
environment: ${{ parameters.Staging.EnvironmentName }}
${{ if ne(length(parameters.StagingArmSteps), 0) }}:
dependsOn: PublishArm
pool:
name: azsdk-pool-mms-ubuntu-2204-general
vmImage: ubuntu-22.04
Expand All @@ -65,8 +85,22 @@ stages:
- stage: Production
dependsOn: Staging
jobs:
- deployment: PublishFunction
- ${{ if ne(length(parameters.ProductionArmSteps), 0) }}:
- deployment: PublishArm
displayName: Publish ARM
environment: ${{ parameters.Production.EnvironmentName }}
pool:
name: azsdk-pool-mms-ubuntu-2204-general
strategy:
runOnce:
deploy:
steps: ${{ parameters.ProductionArmSteps }}

- deployment: PublishApp
displayName: Publish App
environment: ${{ parameters.Production.EnvironmentName }}
${{ if ne(length(parameters.ProductionArmSteps), 0) }}:
dependsOn: PublishArm
pool:
name: azsdk-pool-mms-ubuntu-2204-general
vmImage: ubuntu-22.04
Expand Down
18 changes: 18 additions & 0 deletions tools/pipeline-witness/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,26 @@ extends:
ResourceGroupName: pipelinewitnessprod
AzureSubscription: Azure SDK Engineering System
ResourceName: pipelinewitnessprod-app
ProductionArmSteps:
- checkout: self
- task: AzureCLI@2
displayName: 'Deploy ARM Template'
inputs:
azureSubscription: Azure SDK Engineering System
scriptType: pscore
scriptPath: tools/pipeline-witness/infrastructure/deploy.ps1
arguments: '-target production'
Staging:
EnvironmentName: package-publish
ResourceGroupName: pipelinewitnessstaging
AzureSubscription: Azure SDK Engineering System
ResourceName: pipelinewitnessstaging-app
StagingArmSteps:
- checkout: self
- task: AzureCLI@2
displayName: 'Deploy ARM Template'
inputs:
azureSubscription: Azure SDK Engineering System
scriptType: pscore
scriptPath: tools/pipeline-witness/infrastructure/deploy.ps1
arguments: '-target staging'
6 changes: 6 additions & 0 deletions tools/pipeline-witness/infrastructure/deploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ try {

Write-Host "> az deployment sub create --template-file './bicep/resourceGroup.bicep' --parameters $parametersFile --location $location --name $deploymentName"
az deployment sub create --template-file './bicep/resourceGroup.bicep' --parameters $parametersFile --location $location --name $deploymentName
if($LASTEXITCODE -eq 0) {
Write-Host "Deployed resource group"
} else {
Write-Error "Failed to deploy resource group"
exit 1
}
} finally {
Pop-Location
}

0 comments on commit 88a215f

Please sign in to comment.