This repository has been archived by the owner on Jun 28, 2022. It is now read-only.
/
build-pipeline.yml
90 lines (78 loc) · 3.28 KB
/
build-pipeline.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
# Build Pipeline for Relativity Test Helpers
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
# Install NuGet Installer tool
steps:
- task: NuGetToolInstaller@0
# Restore NuGet packages for the Visual Studio Solution
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
# Build Visual Studio Solution
- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
# Run Integration tests only when merging from develop to Master. This is achieved by setting a 'condition' to the task
- task: VSTest@2
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\bin\**\Relativity.Test.Helpers.NUnit.Integration.dll
searchFolder: '$(System.DefaultWorkingDirectory)'
distributionBatchType: basedOnAssembly
runSettingsFile: 'Source\Relativity.Test.Helpers\Relativity.Test.Helpers.NUnit.Integration\test.runsettings'
overrideTestrunParameters:
-TestWorkspaceName $(testWorkspaceName)
-TestWorkspaceTemplateName $(testWorkspaceTemplateName)
-AdminUsername $(adminUsername)
-AdminPassword $(adminPassword)
-SQLUserName $(sqlUserName)
-SQLPassword $(sqlPassword)
-SQLServerAddress $(sqlServerAddress)
-RESTServerAddress $(restServerAddress)
-ServerBindingType $(serverBindingType)
-RelativityInstanceAddress $(relativityInstanceAddress)
-GmailMailTestEmailAddress $(gmailMailTestEmailAddress)
-GmailMailTestEmailPassword $(gmailMailTestEmailPassword)
-MailTrapTestApiKey $(mailTrapTestApiKey)
-MailTrapTestEmailAddress $(mailTrapTestEmailAddress)
-MailTrapTestEmailUsername $(mailTrapTestEmailUsername)
-MailTrapTestEmailPassword $(mailTrapTestEmailPassword)
# Copy the required Project DLL's to Artifact Staging Directory
- task: CopyFiles@2
inputs:
SourceFolder: '$(system.defaultworkingdirectory)'
Contents: '**\bin\**'
TargetFolder: '$(build.artifactstagingdirectory)'
# Copy NuGet spec file to Artifact Staging Directory
- task: CopyFiles@2
inputs:
SourceFolder: '$(system.defaultworkingdirectory)'
Contents: '*.nuspec*'
TargetFolder: '$(build.artifactstagingdirectory)'
# Copy NuGet targets file to Artifact Staging Directory
- task: CopyFiles@2
inputs:
SourceFolder: '$(system.defaultworkingdirectory)'
Contents: '*.targets*'
TargetFolder: '$(build.artifactstagingdirectory)'
# Copy the variables.json file which contains the version numbers for the NuGet package to Artifact Staging Directory
- task: CopyFiles@2
inputs:
SourceFolder: '$(system.defaultworkingdirectory)'
Contents: 'variables.json'
TargetFolder: '$(build.artifactstagingdirectory)'
# Publish Artifact Staging Directory to a Container to be accessed in Release pipeline for publishing NuGet package
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(build.artifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'