-
Notifications
You must be signed in to change notification settings - Fork 14
/
azure-pipelines.yml
718 lines (644 loc) · 24.9 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
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
name: 8.0.$(Rev:r)
resources:
repositories:
- repository: HarmonyCoreSamples
type: github
endpoint: Synergex
name: Synergex/HarmonyCoreSamples
- repository: HarmonyCoreProjectTemplates
type: github
endpoint: Synergex
name: Synergex/HarmonyCoreProjectTemplates
parameters:
- name: PublishProjects
type: object
default:
- HarmonyCore.Test
- Services.Test.CS
- Services.Test
- Services.Host
stages:
- stage: build
displayName: 'Main Build'
jobs:
- job: BuildJob
workspace:
clean: all
pool:
name: Synergy-10-3-3build
strategy:
maxParallel: 4
matrix:
# Debug_x64:
# Configuration: Debug
# Platform: x64
Release_x64:
Configuration: Release
Platform: x64
RID: win-x64
# Debug_x86:
# Configuration: Debug
# Platform: x86
# Release_x86:
# Configuration: Release
# Platform: x86
Release_linux:
Configuration: Release
Platform: linux64
RID: linux-x64
steps:
- checkout: self
submodules: true
fetchDepth: 1
fetchTags: false
- task: ArchiveFiles@2
condition: and(eq(variables['Platform'], 'x64'), eq(variables['Configuration'], 'Release'))
displayName: "Archive sources"
inputs:
rootFolderOrFile: '$(Build.SourcesDirectory)'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/net6-release.zip'
replaceExistingArchive: true
- task: PublishPipelineArtifact@1
condition: and(eq(variables['Platform'], 'x64'), eq(variables['Configuration'], 'Release'))
displayName: "Publish HCarchive"
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifactName: 'HCarchive'
- task: DeleteFiles@1
displayName: 'Clean ArtifactStagingDirectory'
inputs:
SourceFolder: '$(Build.ArtifactStagingDirectory)'
Contents: '**/*'
- task: UseDotNet@2
displayName: 'Get .NET SDK 8.0.x'
inputs:
packageType: 'sdk'
version: '8.0.x'
- task: NuGetToolInstaller@1
displayName: 'Get NuGet 6.x'
inputs:
versionSpec: 6.x
checkLatest: true
#- task: NuGetCommand@2
# displayName: 'NuGet restore'
# inputs:
# command: 'restore'
# restoreSolution: '**/*.sln'
#feedsToUse: 'select'
#vstsFeed: '632eef26-b5e5-49d5-83f0-091dbb16477c'
- task: MSBuild@1
displayName: 'restore solution'
inputs:
solution: '$(HarmonyCoreSln)'
msbuildArchitecture: 'x64'
platform: $(Platform)
configuration: $(Configuration)
msbuildArguments: '-t:restore'
logFileVerbosity: diagnostic
clean: false
- task: MSBuild@1
displayName: 'Build solution'
inputs:
solution: '$(HarmonyCoreSln)'
msbuildArchitecture: 'x64'
platform: $(Platform)
configuration: $(Configuration)
logFileVerbosity: diagnostic
clean: false
# publish cli-tool-versions
- task: PublishPipelineArtifact@1
condition: and(eq(variables['Platform'], 'x64'), eq(variables['Configuration'], 'Release'))
displayName: 'Publish cli-tool-versions'
inputs:
targetPath: '$(Build.SourcesDirectory)\cli-tool-versions.json'
artifactName: 'cli-tool-versions'
# publish cli tool
- task: DotNetCoreCLI@2
condition: and(eq(variables['Platform'], 'x64'), eq(variables['Configuration'], 'Release'))
displayName: 'Publish HarmonyCore.CliTool'
inputs:
command: publish
publishWebProjects: false
arguments: '-r=$(RID) -c $(Configuration) -o $(Build.ArtifactStagingDirectory)'
verbosityPack: Diagnostic
zipAfterPublish: True
projects: |
HarmonyCore.CliTool
- task: PublishPipelineArtifact@1
condition: and(eq(variables['Platform'], 'x64'), eq(variables['Configuration'], 'Release'))
displayName: 'Publish HarmonyCore.CliTool as Artifact'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifactName: 'HarmonyCore.CliTool'
- task: DeleteFiles@1
displayName: 'Clean ArtifactStagingDirectory'
inputs:
SourceFolder: '$(Build.ArtifactStagingDirectory)'
Contents: '**/*'
# publish test binaries
- ${{ each project in parameters.PublishProjects }}:
- task: DotNetCoreCLI@2
displayName: 'Publish ${{ project }} Binaries'
inputs:
command: publish
publishWebProjects: false
arguments: '-r=$(RID) -c $(Configuration) -o $(Build.ArtifactStagingDirectory)/${{ project }}'
verbosityPack: Diagnostic
zipAfterPublish: True
projects: |
${{ project }}
# for linux only build TraditionalBridge.Test in x86
- task: MSBuild@1
displayName: "Build 32 bit TraditionalBridge.Test.dbr"
condition: and(eq(variables['Platform'], 'linux64'), eq(variables['Configuration'], 'Release'))
inputs:
solution: 'TraditionalBridge.Test'
msbuildArchitecture: 'x64'
platform: 'x86'
configuration: 'Release'
env:
TestDirX86: '\x86\'
# for windows only copy TraditionalBridge.UnitTest/TBTest
- task: CopyFiles@2
condition: ne(variables['Platform'], 'linux64')
displayName: "Copy TraditionalBridge.UnitTest/TBTest"
inputs:
SourceFolder: '$(SolutionDir)TraditionalBridge.UnitTest/TBTest'
Contents: '**'
TargetFolder: '$(Build.ArtifactStagingDirectory)/TraditionalBridge.UnitTest/TBTest'
- task: CopyFiles@2
displayName: "Copy TestDir"
inputs:
SourceFolder: '$(SolutionDir)TestDir'
Contents: '**'
TargetFolder: '$(Build.ArtifactStagingDirectory)/TestDir'
- task: CopyFiles@2
displayName: "Copy SampleData"
inputs:
SourceFolder: '$(SolutionDir)SampleData'
Contents: '**'
TargetFolder: '$(Build.ArtifactStagingDirectory)/SampleData'
- task: PublishPipelineArtifact@1
displayName: 'Publish Test Binaries as Artifact'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifactName: 'TestArtifacts$(Configuration)$(Platform)'
- task: DeleteFiles@1
displayName: 'Clean ArtifactStagingDirectory'
inputs:
SourceFolder: '$(Build.ArtifactStagingDirectory)'
Contents: '**/*'
- task: DotNetCoreCLI@2
displayName: 'Pack CLI Tool'
inputs:
command: 'pack'
arguments: '-c $(Configuration)'
projects: |
**/HarmonyCore.CLITool.csproj
- task: NuGetCommand@2
name: 'HarmonyCoreNuget'
displayName: 'Pack HarmonyCore'
inputs:
command: 'pack'
packagesToPack: '*.nuspec'
versioningScheme: 'byBuildNumber'
- task: NuGetCommand@2
condition: and(eq(variables['Platform'], 'x64'), eq(variables['Configuration'], 'Release'))
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/Harmony.*.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: 'HarmonyCore'
- publish: '$(Build.ArtifactStagingDirectory)/'
displayName: 'Publish nuget packages'
artifact: 'NugetPackages$(Configuration)$(Platform)'
- job: TestJob
dependsOn: BuildJob
workspace:
clean: all
pool:
name: $(AgentPool)
#demands:
# - agent.name -equals $(AgentName)
strategy:
maxParallel: 4
matrix:
Release_x64:
Configuration: Release
Platform: x64
AgentPool: Synergy-10-3-3Build
Release_linux:
Configuration: Release
Platform: linux64
AgentPool: HarmonyCore
steps:
- checkout: none
- task: UseDotNet@2
displayName: 'Get .NET SDK 8.0.x'
inputs:
packageType: 'sdk'
version: '8.0.x'
- download: current
displayName: "Download Artifacts"
artifact: 'TestArtifacts$(Configuration)$(Platform)'
# # for testing purposes reuse already published sde artifacts
# - task: DownloadPipelineArtifact@2
# inputs:
# buildType: specific
# project: HarmonyWebServices
# definition: 31
# pipelineId: 15541
# runVersion: specific
# allowPartiallySucceededBuilds: true
# artifactName: 'TestArtifacts$(Configuration)$(Platform)'
# targetPath: '$(Pipeline.Workspace)/TestArtifacts$(Configuration)$(Platform)'
- task: Bash@3
condition: and(eq(variables['Platform'], 'linux64'), eq(variables['Configuration'], 'Release'))
displayName: "Run setsde"
inputs:
targetType: 'inline'
script: |
. setsde
echo "##vso[task.setvariable variable=DBLDIR]$DBLDIR"
workingDirectory: $(Agent.HomeDirectory)
# unzip each project and run test
- ${{ each project in parameters.PublishProjects }}:
- task: ExtractFiles@1
displayName: "Extract ${{ project }}"
inputs:
archiveFilePatterns: '$(Pipeline.Workspace)/TestArtifacts$(Configuration)$(Platform)/${{ project }}/*.zip'
destinationFolder: '$(Pipeline.Workspace)/TestArtifacts$(Configuration)$(Platform)/${{ project }}'
cleanDestinationFolder: false
overwriteExistingFiles: false
- task: DotNetCoreCLI@2
displayName: 'Run HarmonyCore.Test'
inputs:
command: 'test'
testRunTitle: "HarmonyCore.Test $(Platform)"
arguments: '$(Pipeline.Workspace)/TestArtifacts$(Configuration)$(Platform)/HarmonyCore.Test/HarmonyCore.Test.dll'
- task: DotNetCoreCLI@2
displayName: 'Run Services.Test.CS'
inputs:
command: 'test'
testRunTitle: "Services.Test.CS $(Platform)"
arguments: '$(Pipeline.Workspace)/TestArtifacts$(Configuration)$(Platform)/Services.Test.CS/Services.Test.CS.dll'
- task: DotNetCoreCLI@2
displayName: 'Run Services.Test'
inputs:
command: 'test'
testRunTitle: "Services.Test $(Platform)"
arguments: '$(Pipeline.Workspace)/TestArtifacts$(Configuration)$(Platform)/Services.Test/Services.Test.dll'
# for Windows only copy TraditionalBridge.UnitTest to s folder and run TraditionalBridge.UnitTest
- task: CopyFiles@2
condition: ne(variables['Platform'], 'linux64')
displayName: "Copy TraditionalBridge.UnitTest/TBTest"
inputs:
SourceFolder: '$(Pipeline.Workspace)/TestArtifacts$(Configuration)$(Platform)/TraditionalBridge.UnitTest'
Contents: '**'
TargetFolder: '$(Build.SourcesDirectory)/TraditionalBridge.UnitTest'
- task: DotNetCoreCLI@2
condition: ne(variables['Platform'], 'linux64')
displayName: 'Run TraditionalBridge.UnitTest'
inputs:
command: 'test'
testRunTitle: "TraditionalBridge.UnitTest $(Platform)"
arguments: '$(Pipeline.Workspace)/TestArtifacts$(Configuration)$(Platform)/TestDir/TraditionalBridge.UnitTest.elb --test-adapter-path $(Pipeline.Workspace)/TestArtifacts$(Configuration)$(Platform)/TestDir/SynergyTraditionalUnitTest.TestAdapter.dll'
- job: BuildHarmonyCoreProjects
dependsOn: BuildJob
condition: false
workspace:
clean: all
pool:
name: Synergy-10-3-3Build
strategy:
maxParallel: 4
matrix:
Basic:
project: basic
Tb:
project: tb
TbStruct:
project: tbstruct
variables:
- name: clitool
value: $(Pipeline.Workspace)\HarmonyCore.CliTool\Harmony.Core.CliTool.exe
- name: SolutionDir
value: $(Pipeline.Workspace)\$(project)\
steps:
- checkout: HarmonyCoreSamples
clean: true
path: HarmonyCoreSamples
- checkout: HarmonyCoreProjectTemplates
clean: true
path: HarmonyCoreProjectTemplates
- task: CopyFiles@2
condition: ne(variables.project, 'basic')
inputs:
SourceFolder: '$(Pipeline.Workspace)\HarmonyCoreSamples\$(project)'
Contents: '**'
TargetFolder: '$(Pipeline.Workspace)\$(project)'
- task: CopyFiles@2
displayName: 'Copy powershell scripts'
inputs:
SourceFolder: '$(Pipeline.Workspace)\HarmonyCoreSamples\CICD'
Contents: '**'
TargetFolder: '$(Pipeline.Workspace)\CICD'
- task: UseDotNet@2
displayName: 'Get .NET SDK 8.0.x'
inputs:
packageType: 'sdk'
version: '8.0.x'
- task: CmdLine@2
displayName: "Install Harmony Core templates"
inputs:
script: |
dotnet new uninstall Harmony.Core.ProjectTemplates
call GenerateLocalPackages.bat
call InstallLocalPackages.bat
workingDirectory: '$(Pipeline.Workspace)\HarmonyCoreProjectTemplates'
- task: CmdLine@2
displayName: "Create new project from a template"
inputs:
script: |
dotnet new harmonycore -o $(project)
workingDirectory: '$(Pipeline.Workspace)'
# download clitools
- download: current
displayName: "Download Artifacts"
artifact: 'HarmonyCore.CliTool'
# # for testing purposes reuse already published sde artifacts
# - task: DownloadPipelineArtifact@2
# inputs:
# buildType: specific
# project: HarmonyWebServices
# definition: 31
# pipelineId: 16359
# runVersion: specific
# allowPartiallySucceededBuilds: true
# artifactName: 'HarmonyCore.CliTool'
# targetPath: '$(Pipeline.Workspace)/HarmonyCore.CliTool'
- task: ExtractFiles@1
displayName: "Extract HarmonyCore.CliTool"
inputs:
archiveFilePatterns: '$(Pipeline.Workspace)/HarmonyCore.CliTool/*.zip'
destinationFolder: '$(Pipeline.Workspace)/HarmonyCore.CliTool'
cleanDestinationFolder: false
overwriteExistingFiles: false
- download: current
displayName: "Download HCarchive"
artifact: 'HCarchive'
- task: DownloadPipelineArtifact@2
displayName: "Download cli-tool-versions"
inputs:
buildType: 'current'
artifact: 'cli-tool-versions'
targetPath: '$(Pipeline.Workspace)\$(project)'
- task: CmdLine@2
displayName: "Create dir for nuget packages"
inputs:
script: |
mkdir NugetPackagesReleasex64
workingDirectory: '$(Pipeline.Workspace)'
# download nuget packages
- task: DownloadPipelineArtifact@2
displayName: "Download nugetpackages"
inputs:
buildType: 'current'
artifact: 'NugetPackagesReleasex64'
targetPath: '$(Pipeline.Workspace)\NugetPackagesReleasex64'
- task: PowerShell@2
displayName: "Create nuget.config"
inputs:
targetType: 'inline'
script: |
$nugetConfigPath = "$(Pipeline.Workspace)\$(project)\nuget.config"
$localFeedPath = "$(Pipeline.Workspace)\NugetPackagesReleasex64"
# Create the nuget.config content
$nugetConfigContent = @"
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="local" value="$localFeedPath" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
"@
# Write the content to the nuget.config file
$nugetConfigContent | Out-File -FilePath $nugetConfigPath -Encoding utf8
workingDirectory: '$(Pipeline.Workspace)\$(project)'
# # for testing purposes reuse already published sde artifacts
# - task: DownloadPipelineArtifact@2
# inputs:
# buildType: specific
# project: HarmonyWebServices
# definition: 31
# pipelineId: 16359
# runVersion: specific
# allowPartiallySucceededBuilds: true
# artifactName: 'HCarchive'
# targetPath: '$(Pipeline.Workspace)/HCarchive'
- task: CmdLine@2
displayName: "Run harmonycore upgrade-latest"
inputs:
script: |
echo YES| ${{ variables.clitool }} upgrade-latest -z $(Pipeline.Workspace)\HCarchive\net6-release.zip
workingDirectory: '$(Pipeline.Workspace)\$(project)'
- task: CmdLine@2
displayName: "Add Structures"
inputs:
script: |
${{ variables.clitool }} codegen-add --structure --odata --ef -i CUSTOMERS ITEMS ORDERS ORDER_ITEMS VENDORS
${{ variables.clitool }} regen -p
workingDirectory: '$(Pipeline.Workspace)\$(project)'
- task: PowerShell@2
condition: ne(variables.project, 'basic')
displayName: "Add PK generator and StartupCustom to Services.synproj"
inputs:
filePath: '$(Pipeline.Workspace)\CICD\automationscripts.ps1'
arguments: 'AddServices $(Pipeline.Workspace)\$(project)\Services\Services.synproj'
failOnStderr: true
workingDirectory: '$(Pipeline.Workspace)\$(project)\Services'
- task: CmdLine@2
condition: ne(variables.project, 'basic')
displayName: "Add Traditional Bridge"
inputs:
script: |
${{ variables.clitool }} features --add-tb
workingDirectory: '$(Pipeline.Workspace)\$(project)'
- task: PowerShell@2
condition: ne(variables.project, 'basic')
displayName: "Update host.dbl"
inputs:
filePath: '$(Pipeline.Workspace)\CICD\automationscripts.ps1'
arguments: 'UpdateHost $(Pipeline.Workspace)\$(project)\TraditionalBridge\Source\host.dbl'
failOnStderr: true
workingDirectory: '$(Pipeline.Workspace)\$(project)\TraditionalBridge\Source'
- task: PowerShell@2
condition: ne(variables.project, 'basic')
displayName: "Update platform for TB"
inputs:
filePath: '$(Pipeline.Workspace)\CICD\automationscripts.ps1'
arguments: 'UpdateTbPlatform $(Pipeline.Workspace)\$(project)\$(project).sln'
failOnStderr: true
workingDirectory: '$(Pipeline.Workspace)\$(project)'
- task: PowerShell@2
condition: ne(variables.project, 'basic')
displayName: "Update output path for TB"
inputs:
filePath: '$(Pipeline.Workspace)\CICD\automationscripts.ps1'
arguments: 'UpdateTbOutput $(Pipeline.Workspace)\$(project)\TraditionalBridge\TraditionalBridge.synproj'
failOnStderr: true
workingDirectory: '$(Pipeline.Workspace)\$(project)\TraditionalBridge'
- task: CmdLine@2
condition: ne(variables.project, 'basic')
displayName: "Enable SMC import and run upgrade-latest"
inputs:
script: |
%clitool% features --smc $(Pipeline.Workspace)\$(project)\TraditionalBridge\MethodCatalog\MethodDefinitions.xml
echo run upgrade-latest
echo YES| %clitool% upgrade-latest -z $(Pipeline.Workspace)\HCarchive\net6-release.zip
workingDirectory: '$(Pipeline.Workspace)\$(project)'
- task: PowerShell@2
condition: eq(variables.project, 'tb')
displayName: "Add methods to TraditionalBridge.synproj Tb"
inputs:
filePath: '$(Pipeline.Workspace)\CICD\automationscripts.ps1'
arguments: 'AddMethodsTb $(Pipeline.Workspace)\$(project)\TraditionalBridge\TraditionalBridge.synproj'
failOnStderr: true
workingDirectory: '$(Pipeline.Workspace)\$(project)\TraditionalBridge'
- task: PowerShell@2
condition: eq(variables.project, 'tbstruct')
displayName: "Add methods to TraditionalBridge.synproj TbStruct"
inputs:
filePath: '$(Pipeline.Workspace)\CICD\automationscripts.ps1'
arguments: 'AddMethodsTbStruct $(Pipeline.Workspace)\$(project)\TraditionalBridge\TraditionalBridge.synproj'
failOnStderr: true
workingDirectory: '$(Pipeline.Workspace)\$(project)\TraditionalBridge'
- task: CmdLine@2
condition: eq(variables.project, 'tbstruct')
displayName: "Add TraditionalBridgeGenerator to CUSTOMERS structure"
inputs:
script: |
%clitool% codegen-add --structure --tb -i CUSTOMERS
workingDirectory: '$(Pipeline.Workspace)\$(project)'
- task: CmdLine@2
condition: ne(variables.project, 'basic')
displayName: "Add BridgeMethods interface"
inputs:
script: |
%clitool% codegen-add --interface --webapi -i BridgeMethods
workingDirectory: '$(Pipeline.Workspace)\$(project)'
- task: PowerShell@2
condition: ne(variables.project, 'basic')
displayName: "Set ODATA CreateTestFiles option"
inputs:
filePath: '$(Pipeline.Workspace)\CICD\automationscripts.ps1'
arguments: 'SetCreateTestFiles $(Pipeline.Workspace)\$(project)\Harmony.Core.CodeGen.json'
failOnStderr: true
workingDirectory: '$(Pipeline.Workspace)\$(project)'
- task: PowerShell@2
condition: eq(variables.project, 'basic')
displayName: "Set ODATA Options"
inputs:
filePath: '$(Pipeline.Workspace)\CICD\automationscripts.ps1'
arguments: 'SetOdataBasic $(Pipeline.Workspace)\$(project)\Harmony.Core.CodeGen.json'
failOnStderr: true
workingDirectory: '$(Pipeline.Workspace)\$(project)'
- task: CmdLine@2
condition: eq(variables.project, 'basic')
displayName: "Add unit tests"
inputs:
script: |
echo YES| %clitool% features --add-unit-tests -z $(Pipeline.Workspace)\HCarchive\net6-release.zip
workingDirectory: '$(Pipeline.Workspace)\$(project)'
env:
LOCAL_HC_TEMPLATES: 1
- task: CmdLine@2
displayName: "Run regen -p and upgrade-latest"
inputs:
script: |
%clitool% regen -p
echo YES| %clitool% upgrade-latest -z $(Pipeline.Workspace)\HCarchive\net6-release.zip
workingDirectory: '$(Pipeline.Workspace)\$(project)'
- task: DotNetCoreCLI@2
condition: eq(variables.project, 'basic')
displayName: "Build the project Basic"
inputs:
command: 'build'
projects: '$(Pipeline.Workspace)\$(project)'
arguments: '--configuration Release'
- task: DotNetCoreCLI@2
condition: eq(variables.project, 'basic')
displayName: "Run Services.Test"
inputs:
command: 'test'
projects: '$(Pipeline.Workspace)\$(project)\Services.Test'
testRunTitle: "Services.Test Basic Solution"
workingDirectory: '$(Pipeline.Workspace)\$(project)'
- task: VSBuild@1
condition: ne(variables.project, 'basic')
displayName: "Build the project Tb"
inputs:
solution: '$(Pipeline.Workspace)\$(project)\$(project).sln'
configuration: 'Release'
restoreNugetPackages: true
- task: PowerShell@2
condition: eq(variables.project, 'tb')
displayName: "Run the host and test the endpoint Tb"
inputs:
filePath: '$(Pipeline.Workspace)\CICD\automationscripts.ps1'
arguments: 'TestTb $(Pipeline.Workspace)\$(project)\'
failOnStderr: true
workingDirectory: '$(Pipeline.Workspace)\$(project)\Services.Host'
- task: PowerShell@2
condition: eq(variables.project, 'tbstruct')
displayName: "Run the host and test endpoints TbStruct"
inputs:
filePath: '$(Pipeline.Workspace)\CICD\automationscripts.ps1'
arguments: 'TestTbStruct $(Pipeline.Workspace)\$(project)\'
failOnStderr: true
workingDirectory: '$(Pipeline.Workspace)\$(project)\Services.Host'
- task: PowerShell@2
condition: ne(variables.project, 'basic')
displayName: "Update JSON to enable Authentication"
inputs:
filePath: '$(Pipeline.Workspace)\CICD\automationscripts.ps1'
arguments: 'EnableAuth $(Pipeline.Workspace)\$(project)\Harmony.Core.CodeGen.json'
failOnStderr: true
workingDirectory: '$(Pipeline.Workspace)\$(project)'
- task: CmdLine@2
condition: ne(variables.project, 'basic')
displayName: "Run regen -p"
inputs:
script: |
%clitool% regen -p
workingDirectory: '$(Pipeline.Workspace)\$(project)'
- task: VSBuild@1
condition: ne(variables.project, 'basic')
displayName: "Build the project Tb"
inputs:
solution: '$(Pipeline.Workspace)\$(project)\$(project).sln'
configuration: 'Release'
restoreNugetPackages: true
- task: PowerShell@2
condition: eq(variables.project, 'tb')
displayName: "Run the host and test the endpoint AUTH Tb"
inputs:
filePath: '$(Pipeline.Workspace)\CICD\automationscripts.ps1'
arguments: 'TestTbAuth $(Pipeline.Workspace)\$(project)\'
failOnStderr: true
workingDirectory: '$(Pipeline.Workspace)\$(project)\Services.Host'
- task: PowerShell@2
condition: eq(variables.project, 'tbstruct')
displayName: "Run the host and test endpoints with AUTH TbStruct"
inputs:
filePath: '$(Pipeline.Workspace)\CICD\automationscripts.ps1'
arguments: 'TestTbStructAuth $(Pipeline.Workspace)\$(project)\'
failOnStderr: true
workingDirectory: '$(Pipeline.Workspace)\$(project)\Services.Host'