-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
144 lines (134 loc) · 5.54 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# .NET Desktop
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net
trigger:
- master
resources:
repositories:
- repository: adf_project
type: github
endpoint: hmcts
name: qzhou-hmcts/datafactory
ref: adf_publish
trigger: # CI trigger for this repository, no CI trigger if skipped (only works for Azure Repos)
branches:
include: [ adf_publish ]
pool:
vmImage: 'Ubuntu-16.04'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
sqlDwPath: 'synapse'
azure.subscription.endpoint: 'DTS-SHAREDSERVICES-TEST'
keyvault.name: 'mi-vault-test'
stages:
- stage: 'build'
displayName: 'Validate project'
# condition: and(always(), eq(variables['Build.Reason'], 'PullRequest'))
jobs:
- job: 'validate_sql_packages'
displayName: 'Validate sql project'
pool:
vmImage: 'windows-latest'
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(sqlDwPath)/bin/$(buildConfiguration)/synapse.dacpac'
ArtifactName: 'sql_dw_dacpac'
displayName: 'Publish SQL DACPAC'
- stage: 'Deploy'
displayName: 'Deploy project'
condition: and(succeeded('build'), ne(variables['build.sourceBranch'], 'refs/heads/master'))
jobs:
- template: pipeline/templates/jobs/deploy-azuresqldb-job.yml
parameters:
environment: $(environment)
subscriptionEndpoint: $(azure.subscription.endpoint)
databaseServerName: 'mi-datawarehouse-server-test'
databaseName: 'mi-datawarehouse-db-test'
projectName: 'synapse'
artifactName: 'sql_dw_dacpac'
keyvaultName: 'mi-vault-test'
- template: pipeline/templates/jobs/deploy-adf-job.yml
parameters:
environment: $(environment)
subscriptionEndpoint: $(azure.subscription.endpoint)
adfName: mi-ingestion-adf-test
resourceGroup: mi-test-rg
adfOverrideParameters: '-mi_persistence_storage_mi_properties_typeProperties_serviceEndpoint "https://mipersistenttest.blob.core.windows.net"
-mi_synapse_kv_connectionString "Server=tcp:mi-datawarehouse-server-test.database.windows.net,1433;Initial Catalog=mi-datawarehouse-db-test;Persist Security Info=False;User ID=mi-server-admin;Password=$(sqlsrvrPassword);MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
-MI_synapse_mi_connectionString "Server=tcp:mi-datawarehouse-server-test.database.windows.net,1433;;Initial Catalog=mi-datawarehouse-db-test;Database=mi-datawarehouse-db-test;Connection Timeout=30"'
adfFolder: mi-ccd-datafactory-test
- template: pipeline/templates/jobs/integration-tests-job.yml
parameters:
subscriptionEndpoint: $(azure.subscription.endpoint)
databaseServerName: 'mi-datawarehouse-server-test'
databaseName: 'mi-datawarehouse-db-test'
adfName: mi-ingestion-adf-test
resourceGroup: mi-test-rg
keyvaultName: 'mi-vault-test'
ssKeyvaultName: 'ss-vault-test'
- stage: 'DeployStaging'
displayName: 'Deploy project on staging env'
condition: and(succeeded('build'), eq(variables['build.sourceBranch'], 'refs/heads/master'))
jobs:
- template: pipeline/templates/jobs/deploy-azuresqldb-job.yml
parameters:
environment: 'stg'
subscriptionEndpoint: DTS-SHAREDSERVICES-STG
databaseServerName: $(sqlsrvrName)
databaseName: 'mi-datawarehouse-db-stg'
projectName: 'synapse'
artifactName: 'sql_dw_dacpac'
keyvaultName: 'mi-vault-stg'
- template: pipeline/templates/jobs/deploy-adf-job.yml
parameters:
environment: $(environment)
subscriptionEndpoint: $(azure.subscription.endpoint)
adfName: mi-ccd-datafactory-stg
resourceGroup: mi-stg-rg
adfOverrideParameters: '-AzureBlobStorage1_properties_typeProperties_serviceEndpoint "https://mipersistentstg.blob.core.windows.net"'
- template: pipeline/templates/jobs/integration-tests-job.yml
parameters:
subscriptionEndpoint: $(azure.subscription.endpoint)
databaseServerName: $(sqlsrvrName)
databaseName: 'mi-datawarehouse-db-stg'
keyvaultName: 'mi-vault-stg'
ssKeyvaultName: 'ss-vault-stg'
adfName: 'mi-ccd-datafactory-stg'
resourceGroup: mi-stg-rg
- stage: 'DeployProd'
displayName: 'Deploy production'
condition: and(succeeded('DeployStaging'), eq(variables['build.sourceBranch'], 'refs/heads/master'))
jobs:
- template: pipeline/templates/jobs/deploy-azuresqldb-job.yml
parameters:
environment: prod
subscriptionEndpoint: DTS-SHAREDSERVICES-STG
databaseServerName: $(sqlsrvrName)
databaseName: 'mi-datawarehouse-db-prod'
projectName: 'synapse'
artifactName: 'sql_dw_dacpac'
keyvaultName: 'mi-vault-prod'
- template: pipeline/templates/jobs/deploy-adf-job.yml
parameters:
environment: prod
subscriptionEndpoint: $(azure.subscription.endpoint)
adfName: mi-ccd-datafactory-prod
resourceGroup: mi-prod-rg
adfOverrideParameters: '-AzureBlobStorage1_properties_typeProperties_serviceEndpoint "https://mipersistentprod.blob.core.windows.net"'