246 строки
7.5 KiB
YAML
246 строки
7.5 KiB
YAML
# DESCRIPTION:
|
|
# Deploys the CI environment in case the persistent resources are deleted or broken.
|
|
# This pipeline is only needed if CI is broken. It can be months between runs.
|
|
# As CI is a persistent environment this pipeline should not be run unless needed.
|
|
|
|
name: $(SourceBranchName)-$(Date:yyyyMMdd)$(Rev:-r)
|
|
trigger: none
|
|
|
|
variables:
|
|
- template: ci-variables.yml
|
|
- template: build-variables.yml
|
|
|
|
stages:
|
|
- stage: UpdateVersion
|
|
displayName: 'Determine Semver'
|
|
dependsOn: []
|
|
jobs:
|
|
- job: Semver
|
|
pool:
|
|
name: '$(DefaultLinuxPool)'
|
|
vmImage: '$(LinuxVmImage)'
|
|
steps:
|
|
- template: ./jobs/update-semver.yml
|
|
|
|
- stage: DockerBuild
|
|
displayName: 'Build images'
|
|
dependsOn:
|
|
- UpdateVersion
|
|
variables:
|
|
assemblySemFileVer: $[stageDependencies.UpdateVersion.Semver.outputs['SetVariablesFromGitVersion.assemblySemFileVer']]
|
|
jobs:
|
|
- template: ./jobs/docker-build-all.yml
|
|
parameters:
|
|
tag: $(ImageTag)
|
|
buildPlatform: $(publicDockerImagePlatforms)
|
|
|
|
- stage: provisionEnvironment
|
|
displayName: Provision Environment
|
|
dependsOn: []
|
|
jobs:
|
|
- template: ./jobs/cleanup-resourcegroup-aad.yml
|
|
- job: provision
|
|
dependsOn: DeleteResourceGroup
|
|
steps:
|
|
- task: AzurePowerShell@5
|
|
displayName: Provision Resource Group
|
|
inputs:
|
|
azureSubscription: $(ConnectedServiceName)
|
|
azurePowerShellVersion: latestVersion
|
|
ScriptType: inlineScript
|
|
Inline: |
|
|
New-AzResourceGroup -Name "$(DeploymentEnvironmentName)" -Location "$(ResourceGroupRegion)" -Force
|
|
- template: ./jobs/add-resource-group-role-assignments.yml
|
|
parameters:
|
|
azureSubscription: $(ConnectedServiceName)
|
|
resourceGroupName: $(ResourceGroupName)
|
|
|
|
- stage: aadTestEnvironment
|
|
displayName: Setup AAD Test Environment
|
|
dependsOn:
|
|
- provisionEnvironment
|
|
jobs:
|
|
- job: setup
|
|
pool:
|
|
vmImage: '$(WindowsVmImage)'
|
|
steps:
|
|
- template: ./jobs/add-aad-test-environment.yml
|
|
|
|
- stage: deploySqlServer
|
|
displayName: 'Deploy SQLServer'
|
|
dependsOn:
|
|
- provisionEnvironment
|
|
jobs:
|
|
- template: ./jobs/provision-sqlServer.yml
|
|
parameters:
|
|
resourceGroup: $(ResourceGroupName)
|
|
sqlServerName: $(DeploymentEnvironmentName)
|
|
adminType: 'userAssignedManagedIdentity'
|
|
adminUserAssignedManagedIdentityName: "$(DeploymentEnvironmentName)-uami"
|
|
deploymentName: "AppServer"
|
|
- template: ./jobs/provision-sqlServer.yml
|
|
parameters:
|
|
resourceGroup: $(ResourceGroupName)
|
|
sqlServerName: $(DeploymentEnvironmentName)inttest
|
|
adminType: 'federatedServiceConnection'
|
|
deploymentName: "IntegrationTests"
|
|
|
|
- stage: deployStu3
|
|
displayName: 'Deploy STU3 CosmosDB Site'
|
|
dependsOn:
|
|
- aadTestEnvironment
|
|
- DockerBuild
|
|
jobs:
|
|
- template: ./jobs/provision-deploy.yml
|
|
parameters:
|
|
version: Stu3
|
|
webAppName: $(DeploymentEnvironmentName)
|
|
appServicePlanName: $(appServicePlanName)
|
|
appServicePlanResourceGroup: $(appServicePlanResourceGroup)
|
|
subscription: $(ConnectedServiceName)
|
|
resourceGroup: $(DeploymentEnvironmentName)
|
|
testEnvironmentUrl: $(TestApplicationResource)
|
|
imageTag: $(ImageTag)
|
|
reindexEnabled: true
|
|
|
|
- stage: deployStu3Sql
|
|
displayName: 'Deploy STU3 SQL Site'
|
|
dependsOn:
|
|
- aadTestEnvironment
|
|
- DockerBuild
|
|
- deploySqlServer
|
|
jobs:
|
|
- template: ./jobs/provision-deploy.yml
|
|
parameters:
|
|
version: Stu3
|
|
sql: true
|
|
webAppName: $(DeploymentEnvironmentNameSql)
|
|
appServicePlanName: $(appServicePlanName)
|
|
appServicePlanResourceGroup: $(appServicePlanResourceGroup)
|
|
subscription: $(ConnectedServiceName)
|
|
resourceGroup: $(DeploymentEnvironmentName)
|
|
testEnvironmentUrl: $(TestApplicationResource)
|
|
imageTag: $(ImageTag)
|
|
schemaAutomaticUpdatesEnabled: 'auto'
|
|
sqlServerName: $(DeploymentEnvironmentName)
|
|
reindexEnabled: true
|
|
|
|
- stage: deployR4
|
|
displayName: 'Deploy R4 CosmosDB Site'
|
|
dependsOn:
|
|
- aadTestEnvironment
|
|
- DockerBuild
|
|
jobs:
|
|
- template: ./jobs/provision-deploy.yml
|
|
parameters:
|
|
version: R4
|
|
webAppName: $(DeploymentEnvironmentNameR4)
|
|
appServicePlanName: $(appServicePlanName)
|
|
appServicePlanResourceGroup: $(appServicePlanResourceGroup)
|
|
subscription: $(ConnectedServiceName)
|
|
resourceGroup: $(DeploymentEnvironmentName)
|
|
testEnvironmentUrl: $(TestApplicationResource)
|
|
imageTag: $(ImageTag)
|
|
reindexEnabled: true
|
|
|
|
- stage: deployR4Sql
|
|
displayName: 'Deploy R4 SQL Site'
|
|
dependsOn:
|
|
- aadTestEnvironment
|
|
- DockerBuild
|
|
- deploySqlServer
|
|
jobs:
|
|
- template: ./jobs/provision-deploy.yml
|
|
parameters:
|
|
version: R4
|
|
sql: true
|
|
webAppName: $(DeploymentEnvironmentNameR4Sql)
|
|
appServicePlanName: $(appServicePlanName)
|
|
appServicePlanResourceGroup: $(appServicePlanResourceGroup)
|
|
subscription: $(ConnectedServiceName)
|
|
resourceGroup: $(DeploymentEnvironmentName)
|
|
testEnvironmentUrl: $(TestApplicationResource)
|
|
imageTag: $(ImageTag)
|
|
schemaAutomaticUpdatesEnabled: 'auto'
|
|
sqlServerName: $(DeploymentEnvironmentName)
|
|
reindexEnabled: true
|
|
|
|
- stage: deployR4B
|
|
displayName: 'Deploy R4B CosmosDB Site'
|
|
dependsOn:
|
|
- aadTestEnvironment
|
|
- DockerBuild
|
|
jobs:
|
|
- template: ./jobs/provision-deploy.yml
|
|
parameters:
|
|
version: R4B
|
|
webAppName: $(DeploymentEnvironmentNameR4B)
|
|
appServicePlanName: $(appServicePlanName)
|
|
appServicePlanResourceGroup: $(appServicePlanResourceGroup)
|
|
subscription: $(ConnectedServiceName)
|
|
resourceGroup: $(DeploymentEnvironmentName)
|
|
testEnvironmentUrl: $(TestApplicationResource)
|
|
imageTag: $(ImageTag)
|
|
reindexEnabled: true
|
|
|
|
- stage: deployR4BSql
|
|
displayName: 'Deploy R4B SQL Site'
|
|
dependsOn:
|
|
- aadTestEnvironment
|
|
- DockerBuild
|
|
- deploySqlServer
|
|
jobs:
|
|
- template: ./jobs/provision-deploy.yml
|
|
parameters:
|
|
version: R4B
|
|
sql: true
|
|
webAppName: $(DeploymentEnvironmentNameR4BSql)
|
|
appServicePlanName: $(appServicePlanName)
|
|
appServicePlanResourceGroup: $(appServicePlanResourceGroup)
|
|
subscription: $(ConnectedServiceName)
|
|
resourceGroup: $(DeploymentEnvironmentName)
|
|
testEnvironmentUrl: $(TestApplicationResource)
|
|
sqlServerName: $(DeploymentEnvironmentName)
|
|
imageTag: $(ImageTag)
|
|
schemaAutomaticUpdatesEnabled: 'auto'
|
|
|
|
- stage: deployR5
|
|
displayName: 'Deploy R5 CosmosDB Site'
|
|
dependsOn:
|
|
- aadTestEnvironment
|
|
- DockerBuild
|
|
jobs:
|
|
- template: ./jobs/provision-deploy.yml
|
|
parameters:
|
|
version: R5
|
|
webAppName: $(DeploymentEnvironmentNameR5)
|
|
appServicePlanName: $(appServicePlanName)
|
|
appServicePlanResourceGroup: $(appServicePlanResourceGroup)
|
|
subscription: $(ConnectedServiceName)
|
|
resourceGroup: $(DeploymentEnvironmentName)
|
|
testEnvironmentUrl: $(TestApplicationResource)
|
|
imageTag: $(ImageTag)
|
|
reindexEnabled: true
|
|
|
|
- stage: deployR5Sql
|
|
displayName: 'Deploy R5 SQL Site'
|
|
dependsOn:
|
|
- aadTestEnvironment
|
|
- DockerBuild
|
|
- deploySqlServer
|
|
jobs:
|
|
- template: ./jobs/provision-deploy.yml
|
|
parameters:
|
|
version: R5
|
|
sql: true
|
|
webAppName: $(DeploymentEnvironmentNameR5Sql)
|
|
appServicePlanName: $(appServicePlanName)
|
|
appServicePlanResourceGroup: $(appServicePlanResourceGroup)
|
|
subscription: $(ConnectedServiceName)
|
|
resourceGroup: $(DeploymentEnvironmentName)
|
|
testEnvironmentUrl: $(TestApplicationResource)
|
|
imageTag: $(ImageTag)
|
|
schemaAutomaticUpdatesEnabled: 'auto'
|
|
sqlServerName: $(DeploymentEnvironmentName)
|
|
reindexEnabled: true
|