-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpipeline-shared.yml
361 lines (286 loc) · 10.5 KB
/
pipeline-shared.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
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
stages:
- stage: Functions
displayName: Azure Functions Build and Deploy
dependsOn: []
jobs:
- job: build_and_deploy_rabbitmq
displayName: RabbitMQ Processor Function Build and Deploy
pool: '$(agent.pool)'
variables:
functionProject: 'Source/STSL.SmartLocker.Utils.RabbitMQProcessor/STSL.SmartLocker.Utils.RabbitMQProcessor.csproj'
buildConfiguration: 'Release'
outputPath: '$(Build.ArtifactStagingDirectory)/functions/rabbitmq_processor'
artifactName: 'rabbitmq_processor'
functionName: '$(function-rabbitmq_processor)'
steps:
- task: DotNetCoreCLI@2
inputs:
command: publish
projects: '$(functionProject)'
publishWebProjects: False
arguments: '--configuration $(buildConfiguration) --output $(outputPath)'
zipAfterPublish: True
- publish: $(outputPath)
artifact: $(artifactName)
- task: AzureFunctionApp@2
inputs:
connectedServiceNameARM: '$(service-connection)'
appType: 'functionApp'
appName: '$(functionName)'
package: '$(outputPath)/**/*.zip'
deploymentMethod: 'auto'
- job: build_and_deploy_message_consume
displayName: Message Consume Function Build and Deploy
pool: '$(agent.pool)'
variables:
functionProject: 'Source/STSL.SmartLocker.Utils.BluBugMessageConsume/STSL.SmartLocker.Utils.BluBugMessageConsume.csproj'
buildConfiguration: 'Release'
outputPath: '$(Build.ArtifactStagingDirectory)/functions/message_consume'
artifactName: 'message-consume'
functionName: '$(function-message-consume)'
steps:
- task: DotNetCoreCLI@2
inputs:
command: publish
projects: '$(functionProject)'
publishWebProjects: False
arguments: '--configuration $(buildConfiguration) --output $(outputPath)'
zipAfterPublish: True
- publish: $(outputPath)
artifact: $(artifactName)
- task: AzureFunctionApp@2
inputs:
connectedServiceNameARM: '$(service-connection)'
appType: 'functionApp'
appName: '$(functionName)'
package: '$(outputPath)/**/*.zip'
deploymentMethod: 'auto'
- job: build_and_deploy_process_lock_events
displayName: Process Lock Events Function Build and Deploy
pool: '$(agent.pool)'
variables:
functionProject: 'Source/STSL.SmartLocker.Utils.LockEvents/STSL.SmartLocker.Utils.LockEvents.csproj'
buildConfiguration: 'Release'
outputPath: '$(Build.ArtifactStagingDirectory)/functions/process_lock_events'
artifactName: 'process_lock_events'
functionName: '$(function-process-lock-events)'
steps:
- task: DotNetCoreCLI@2
inputs:
command: publish
projects: '$(functionProject)'
publishWebProjects: False
arguments: '--configuration $(buildConfiguration) --output $(outputPath)'
zipAfterPublish: True
- publish: $(outputPath)
artifact: $(artifactName)
- task: AzureFunctionApp@2
inputs:
connectedServiceNameARM: '$(service-connection)'
appType: 'functionApp'
appName: '$(functionName)'
package: '$(outputPath)/**/*.zip'
deploymentMethod: 'auto'
- job: build_and_deploy_process_msi
displayName: Process MSI Function Build and Deploy
pool: '$(agent.pool)'
variables:
functionProject: 'Source/STSL.SmartLocker.Utils.MSIProcessor/STSL.SmartLocker.Utils.MSIProcessor.csproj'
buildConfiguration: 'Release'
outputPath: '$(Build.ArtifactStagingDirectory)/functions/process_msi'
artifactName: 'process_msi'
functionName: '$(function-process-msi)'
steps:
- task: DotNetCoreCLI@2
inputs:
command: publish
projects: '$(functionProject)'
publishWebProjects: False
arguments: '--configuration $(buildConfiguration) --output $(outputPath)'
zipAfterPublish: True
- publish: $(outputPath)
artifact: $(artifactName)
- task: AzureFunctionApp@2
inputs:
connectedServiceNameARM: '$(service-connection)'
appType: 'functionApp'
appName: '$(functionName)'
package: '$(outputPath)/**/*.zip'
deploymentMethod: 'auto'
- stage: API
displayName: API Build and Deploy
dependsOn: []
jobs:
- job: build_and_deploy_api
displayName: Build and Deploy API Job
pool: '$(agent.pool)'
variables:
apiProject: 'Source/STSL.SmartLocker.Utils.Api/STSL.SmartLocker.Utils.Api.csproj'
buildConfiguration: 'Release'
outputPath: '$(Build.ArtifactStagingDirectory)/api'
artifactName: 'api'
webAppName: '$(web-app-api)'
steps:
- task: DotNetCoreCLI@2
inputs:
command: publish
projects: '$(apiProject)'
publishWebProjects: False
arguments: '--configuration $(buildConfiguration) --output $(outputPath)'
zipAfterPublish: True
- publish: $(outputPath)
artifact: $(artifactName)
- task: AzureRmWebAppDeployment@4
inputs:
ConnectionType: 'AzureRM'
azureSubscription: '$(service-connection)'
appType: 'webApp'
WebAppName: '$(webAppName)'
packageForLinux: '$(outputPath)/**/*.zip'
enableCustomDeployment: true
DeploymentType: 'webDeploy'
- stage: Enrolment_App
displayName: Enrolment App Build and Deploy
dependsOn: []
jobs:
- job: build_and_deploy_enrolment
displayName: Build and Deploy Enrolment App Job
pool: '$(agent.pool)'
variables:
enrolmentProject: 'Source/STSL.SmartLocker.Utils.Enrolment.WebApp/STSL.SmartLocker.Utils.Enrolment.WebApp.csproj'
buildConfiguration: 'Release'
outputPath: '$(Build.ArtifactStagingDirectory)/enrolment'
artifactName: 'enrolment'
webAppName: '$(web-app-enrolment)'
steps:
- task: DotNetCoreCLI@2
inputs:
command: publish
projects: '$(enrolmentProject)'
publishWebProjects: False
arguments: '--configuration $(buildConfiguration) --output $(outputPath)'
zipAfterPublish: True
- publish: $(outputPath)
artifact: $(artifactName)
- task: AzureRmWebAppDeployment@4
inputs:
ConnectionType: 'AzureRM'
azureSubscription: '$(service-connection)'
appType: 'webApp'
WebAppName: '$(webAppName)'
packageForLinux: '$(outputPath)/**/*.zip'
enableCustomDeployment: true
DeploymentType: 'webDeploy'
- stage: Redirect_App
displayName: Redirect App Build and Deploy
dependsOn: []
jobs:
- job: build_and_deploy_redirect
displayName: Build and Deploy Redirect App Job
pool: '$(agent.pool)'
variables:
enrolmentProject: 'Source/STSL.SmartLocker.Utils.Redirect.WebApp/STSL.SmartLocker.Utils.Redirect.WebApp.csproj'
buildConfiguration: 'Release'
outputPath: '$(Build.ArtifactStagingDirectory)/redirect'
artifactName: 'redirect'
webAppName: '$(web-app-redirect)'
steps:
- task: DotNetCoreCLI@2
inputs:
command: publish
projects: '$(enrolmentProject)'
publishWebProjects: False
arguments: '--configuration $(buildConfiguration) --output $(outputPath)'
zipAfterPublish: True
- publish: $(outputPath)
artifact: $(artifactName)
- task: AzureRmWebAppDeployment@4
inputs:
ConnectionType: 'AzureRM'
azureSubscription: '$(service-connection)'
appType: 'webApp'
WebAppName: '$(webAppName)'
packageForLinux: '$(outputPath)/**/*.zip'
enableCustomDeployment: true
DeploymentType: 'webDeploy'
- stage: Angular_Web_App
displayName: Angular Web App Build and Deploy
dependsOn: []
jobs:
- job: build_and_deploy_angular_job
displayName: Build and Deploy Angular Job
pool:
vmImage: ubuntu-latest
variables:
projectFolder: 'Source/STSL.SmartLocker.Utils.WebClient'
distFolder: 'dist/stsl.smart-locker.utils.web-client'
steps:
- task: AzureStaticWebApp@0
inputs:
azure_static_web_apps_api_token: '$(angular-app-web-deployment-token)'
app_location: '$(projectFolder)'
app_build_command: 'npm run $(angular-app-npm-run)'
output_location: '$(distFolder)'
- publish: '$(projectFolder)/$(distFolder)'
artifact: webapp
- stage: Kiosk_Vue_Client
displayName: Kiosk Vue Client Build and Deploy
dependsOn: []
jobs:
- job: build_and_deploy_kiosk_vue_client_job
displayName: Build and Deploy Kiosk Vue Client Job
pool:
vmImage: ubuntu-latest
variables:
projectFolder: 'Source/STSL.SmartLocker.Utils.Kiosk.Client'
distFolder: 'dist'
steps:
- task: AzureStaticWebApp@0
inputs:
azure_static_web_apps_api_token: '$(kiosk-vue-app-web-deployment-token)'
app_location: '$(projectFolder)'
app_build_command: 'npm run $(kiosk-vue-app-npm-run)'
output_location: '$(distFolder)'
- publish: '$(projectFolder)/$(distFolder)'
artifact: kioskwebapp
- stage: Kiosk_Wrapper
displayName: Kiosk Wrapper Build and Copy to Storage
dependsOn: []
jobs:
- job: build_and_copy_kiosk_wrapper
displayName: Build and Copy Kiosk Wrapper to Storage
pool: '$(agent.pool)'
variables:
solution: 'Source/STSL.SmartLocker.Utils.sln'
kioskProject: 'Source/STSL.SmartLocker.Utils.Kiosk.App.Wrapper/STSL.SmartLocker.Utils.Kiosk.App.Wrapper.csproj'
kioskProjectBinaries: 'Source/STSL.SmartLocker.Utils.Kiosk.App.Wrapper/bin/x86/Release/net8.0-windows10.0.19041.0'
buildPlatform: 'x86' # Adjusted from 'AnyCPU' to 'x86'
buildConfiguration: 'Release'
zipFileName: '$(kiosk-zip-file-name)'
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(kioskProject)'
msbuildArgs: ''
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- publish: '$(kioskProjectBinaries)'
artifact: kiosk
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(kioskProjectBinaries)'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/kiosk/$(zipFileName)'
replaceExistingArchive: true
- task: AzureFileCopy@5
inputs:
SourcePath: '$(Build.ArtifactStagingDirectory)/kiosk/$(zipFileName)'
azureSubscription: '$(service-connection-file-distribution)'
Destination: 'AzureBlob'
storage: '$(built-items-storage-account)'
ContainerName: '$(built-items-container-name)'