-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
346 lines (293 loc) · 12.6 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
trigger:
tags:
include:
- "*"
stages:
- stage: Build
jobs:
- job: Build_Solution
pool: Default
timeoutInMinutes: 180
cancelTimeoutInMinutes: 2
steps:
- template: .pipelines/templates/build-and-scan-solution.yml
- template: .pipelines/templates/create-efcore-bundle.yml
parameters:
solutionSubfolder: AddressServiceSolution
project: SeelansTyres.Services.AddressService
bundleName: SeelansTyresAddressDb
dbContext: AddressDbContext
- template: .pipelines/templates/create-efcore-bundle.yml
parameters:
solutionSubfolder: OrderServiceSolution
project: SeelansTyres.Services.OrderService
bundleName: SeelansTyresOrderDb
dbContext: OrderDbContext
- template: .pipelines/templates/create-efcore-bundle.yml
parameters:
solutionSubfolder: TyresServiceSolution
project: SeelansTyres.Services.TyresService
bundleName: SeelansTyresTyresDb
dbContext: TyresDbContext
- template: .pipelines/templates/publish-project.yml
parameters:
solutionFolder: Frontends
solutionSubfolder: HealthChecksUISolution
project: SeelansTyres.Frontends.HealthChecksUI
- template: .pipelines/templates/publish-project.yml
parameters:
solutionFolder: Frontends
solutionSubfolder: MvcSolution
project: SeelansTyres.Frontends.Mvc
- template: .pipelines/templates/publish-project.yml
parameters:
solutionFolder: FunctionApps
solutionSubfolder: SystemDegradedTogglerSolution
project: SeelansTyres.FunctionApps.SystemDegradedToggler
- template: .pipelines/templates/publish-project.yml
parameters:
solutionFolder: Gateways
solutionSubfolder: WebBffSolution
project: SeelansTyres.Gateways.WebBff
- template: .pipelines/templates/publish-project.yml
parameters:
solutionFolder: Services
solutionSubfolder: AddressServiceSolution
project: SeelansTyres.Services.AddressService
- template: .pipelines/templates/publish-project.yml
parameters:
solutionFolder: Services
solutionSubfolder: AddressServiceSolution
project: SeelansTyres.Workers.AddressWorker
- template: .pipelines/templates/publish-project.yml
parameters:
solutionFolder: Services
solutionSubfolder: IdentityServiceSolution
project: SeelansTyres.Services.IdentityService
selfContained: --self-contained
- template: .pipelines/templates/publish-project.yml
parameters:
solutionFolder: Services
solutionSubfolder: OrderServiceSolution
project: SeelansTyres.Services.OrderService
- template: .pipelines/templates/publish-project.yml
parameters:
solutionFolder: Services
solutionSubfolder: OrderServiceSolution
project: SeelansTyres.Workers.OrderWorker
- template: .pipelines/templates/publish-project.yml
parameters:
solutionFolder: Services
solutionSubfolder: TyresServiceSolution
project: SeelansTyres.Services.TyresService
- template: .pipelines/templates/final-copy-and-publish-of-artifacts.yml
- task: GitHubRelease@1
displayName: 'Create a New GitHub Release'
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
inputs:
gitHubConnection: 'ShaylenReddy42_OAuth'
repositoryName: '$(Build.Repository.Name)'
action: create
tagSource: userSpecifiedTag
tag: $(Build.SourceBranchName)
title: 'Release v$(Build.SourceBranchName)'
releaseNotesSource: filePath
releaseNotesFilePath: '$(Build.SourcesDirectory)/docs/releases/v$(Build.SourceBranchName).md'
assets: '$(Build.ArtifactStagingDirectory)/*'
addChangeLog: false
changeLogCompareToRelease: lastFullRelease
changeLogType: commitBased
- stage: Dev
dependsOn: Build
condition: succeeded()
variables:
- group: seelanstyres-dev
jobs:
- job: Deploy_Infrastructure
pool: Default
cancelTimeoutInMinutes: 2
timeoutInMinutes: 120
steps:
- checkout: none
- download: 'current'
artifact: 'drop'
patterns: '**/infrastructure/**'
displayName: 'Download Infrastructure'
- task: AzureCLI@2
displayName: 'Deploy Infrastructure'
inputs:
azureSubscription: 'Azure-Manual-SP'
scriptType: ps
scriptLocation: inlineScript
inlineScript: |
$clientIP = $(Invoke-RestMethod https://ipinfo.io/json?token=$(ipInfoAccessToken)).ip
az deployment sub create `
--template-file .\02-environment-specific\main.bicep `
--location southafricanorth `
--parameters `
environment=$(environment) `
adminCredentialsEmail=$(adminCredentialsEmail) `
adminCredentialsPassword=$(adminCredentialsPassword) `
clientIPOfAgent=$clientIP `
emailAddressOfResponder=$(emailAddress) `
emailCredentialsEmail=$(emailCredentialsEmail) `
emailCredentialsPassword=$(emailCredentialsPassword) `
healthCheckEndpoint=$(healthCheckEndpoint) `
mvcClientSecret=$(mvcClientSecret) `
webBffClientSecret=$(webBffClientSecret) `
sqlServerAdminLogin=$(sqlServerAdminLogin) `
sqlServerAdminPassword=$(sqlServerAdminPassword)
workingDirectory: '$(Pipeline.Workspace)/drop/infrastructure/with-bicep'
- job: Deploy_SystemDegradedTogglerSolution
pool: Default
cancelTimeoutInMinutes: 2
timeoutInMinutes: 120
dependsOn: Deploy_Infrastructure
steps:
- checkout: none
- download: 'current'
artifact: 'drop'
patterns: '**/SeelansTyres.FunctionApps.SystemDegradedToggler.zip'
displayName: 'Download the System-Degraded Toggler Zip'
- template: .pipelines/templates/deploy-system-degraded-toggler.yml
- job: Deploy_DatabaseSchema
pool: Default
cancelTimeoutInMinutes: 2
timeoutInMinutes: 120
dependsOn: Deploy_SystemDegradedTogglerSolution
steps:
- checkout: none
- download: 'current'
artifact: 'drop'
patterns: '**/.exe'
displayName: 'Download EF Core Bundles'
- template: .pipelines/templates/execute-efcore-bundle.yml
parameters:
bundleName: SeelansTyresAddressDb
- template: .pipelines/templates/execute-efcore-bundle.yml
parameters:
bundleName: SeelansTyresOrderDb
- template: .pipelines/templates/execute-efcore-bundle.yml
parameters:
bundleName: SeelansTyresTyresDb
- job: Deploy_TyresServiceSolution
pool: Default
cancelTimeoutInMinutes: 2
timeoutInMinutes: 120
dependsOn: Deploy_DatabaseSchema
steps:
- checkout: none
- download: 'current'
artifact: 'drop'
patterns: '**/SeelansTyres.Services.TyresService.zip'
displayName: 'Download the Tyres Service Zip'
- template: .pipelines/templates/deploy-webapp.yml
parameters:
intendedResourceName: app-seelanstyres-tyresservice-$(environment)
project: SeelansTyres.Services.TyresService
- job: Deploy_OrderServiceSolution
pool: Default
cancelTimeoutInMinutes: 2
timeoutInMinutes: 120
dependsOn: Deploy_TyresServiceSolution
steps:
- checkout: none
- download: 'current'
artifact: 'drop'
patterns: '**/SeelansTyres.Workers.OrderWorker.zip'
displayName: 'Download the Order Worker Zip'
- download: 'current'
artifact: 'drop'
patterns: '**/SeelansTyres.Services.OrderService.zip'
displayName: 'Download the Order Service Zip'
- template: .pipelines/templates/deploy-webapp.yml
parameters:
intendedResourceName: app-seelanstyres-orderworker-$(environment)
project: SeelansTyres.Workers.OrderWorker
- template: .pipelines/templates/deploy-webapp.yml
parameters:
intendedResourceName: app-seelanstyres-orderservice-$(environment)
project: SeelansTyres.Services.OrderService
- job: Deploy_IdentityServiceSolution
pool: Default
cancelTimeoutInMinutes: 2
timeoutInMinutes: 120
dependsOn: Deploy_OrderServiceSolution
steps:
- checkout: none
- download: 'current'
artifact: 'drop'
patterns: '**/SeelansTyres.Services.IdentityService.zip'
displayName: 'Download the Identity Service Zip'
- template: .pipelines/templates/deploy-webapp.yml
parameters:
intendedResourceName: app-seelanstyres-identityservice-$(environment)
project: SeelansTyres.Services.IdentityService
- job: Deploy_AddressServiceSolution
pool: Default
cancelTimeoutInMinutes: 2
timeoutInMinutes: 120
dependsOn: Deploy_IdentityServiceSolution
steps:
- checkout: none
- download: 'current'
artifact: 'drop'
patterns: '**/SeelansTyres.Workers.AddressWorker.zip'
displayName: 'Download the Address Worker Zip'
- download: 'current'
artifact: 'drop'
patterns: '**/SeelansTyres.Services.AddressService.zip'
displayName: 'Download the Address Service Zip'
- template: .pipelines/templates/deploy-webapp.yml
parameters:
intendedResourceName: app-seelanstyres-addressworker-$(environment)
project: SeelansTyres.Workers.AddressWorker
- template: .pipelines/templates/deploy-webapp.yml
parameters:
intendedResourceName: app-seelanstyres-addressservice-$(environment)
project: SeelansTyres.Services.AddressService
- job: Deploy_WebBffSolution
pool: Default
cancelTimeoutInMinutes: 2
timeoutInMinutes: 120
dependsOn: Deploy_AddressServiceSolution
steps:
- checkout: none
- download: 'current'
artifact: 'drop'
patterns: '**/SeelansTyres.Gateways.WebBff.zip'
displayName: 'Download the WebBff Gateway Zip'
- template: .pipelines/templates/deploy-webapp.yml
parameters:
intendedResourceName: app-seelanstyres-webbff-$(environment)
project: SeelansTyres.Gateways.WebBff
- job: Deploy_MvcSolution
pool: Default
cancelTimeoutInMinutes: 2
timeoutInMinutes: 120
dependsOn: Deploy_WebBffSolution
steps:
- checkout: none
- download: 'current'
artifact: 'drop'
patterns: '**/SeelansTyres.Frontends.Mvc.zip'
displayName: 'Download the Mvc Frontend Zip'
- template: .pipelines/templates/deploy-webapp.yml
parameters:
intendedResourceName: app-seelanstyres-mvc-$(environment)
project: SeelansTyres.Frontends.Mvc
- job: Deploy_HealthChecksUISolution
pool: Default
cancelTimeoutInMinutes: 2
timeoutInMinutes: 120
dependsOn: Deploy_MvcSolution
steps:
- checkout: none
- download: 'current'
artifact: 'drop'
patterns: '**/SeelansTyres.Frontends.HealthChecksUI.zip'
displayName: 'Download the HealthChecksUI Frontend Zip'
- template: .pipelines/templates/deploy-webapp.yml
parameters:
intendedResourceName: app-seelanstyres-healthchecksui-$(environment)
project: SeelansTyres.Frontends.HealthChecksUI