forked from Seddryck/NBi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
119 lines (102 loc) · 3.65 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
pool:
name: Hosted VS2017
demands:
- msbuild
- visualstudio
- vstest
steps:
- script: 'gitversion /l console /output buildserver /updateAssemblyInfo'
displayName: 'Run GitVersion'
- task: NuGetToolInstaller@0
displayName: 'Use NuGet 4.4.1'
inputs:
versionSpec: 4.4.1
- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
restoreSolution: '$(Parameters.solution)'
- script: 'clone-extensions.cmd'
displayName: 'Clone extensions'
- task: VSBuild@1
displayName: 'Build solution *.sln'
inputs:
solution: '$(Parameters.solution)'
vsVersion: 15.0
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
- task: petergroenewegen.PeterGroenewegen-Xpirit-Vsts-Build-InlinePowershell.Xpirit-Vsts-Build-InlinePowershell.InlinePowershell@1
displayName: 'Adapt connection-strings for testing'
inputs:
Script: |
Param(
[string]$sourcePath,
[string]$buildServer
)
Write-Output "Adapting connection-strings for testing on $buildServer"
$buildServerName = ($buildServer -replace '\s','').ToLower()
$basePath = $sourcePath + "\NBi.Testing\bin\Debug"
$userConfig = $basePath + "\ConnectionString.user.config"
$bsConfig = $basePath + "\ConnectionString.$buildServerName.config"
Write-Output "Checking for connection-strings' configuration at $bsConfig"
if (Test-Path $bsConfig)
{
if (Test-Path $userConfig)
{
Remove-Item $userConfig
}
Rename-Item -Path $bsConfig -NewName ConnectionString.user.config
Write-Output "Connection-strings' configuration updated"
}
else
{
Write-Output "No specific configuration found"
}
ScriptArguments: '-sourcePath $(System.DefaultWorkingDirectory) -buildServer ''Azure DevOps''
- task: VSTest@2
displayName: 'VsTest - testAssemblies'
inputs:
testAssemblyVer2: 'NBi.Testing*\bin\debug\NBi.Testing*.dll'
testFiltercriteria: 'TestCategory!=Olap & TestCategory!=Etl & TestCategory!=WindowsService & TestCategory!=ReportServerDB & TestCategory!=LocalSQL'
vsTestVersion: 15.0
codeCoverageEnabled: false
diagnosticsEnabled: True
- task: PowerShell@2
displayName: 'Package Nuget'
inputs:
targetType: filePath
filePath: './.packages\package-NBi.ps1'
arguments: '$env:GitVersion_NuGetVersionV2'
- task: CopyFiles@2
displayName: 'Copy Files to: $(build.artifactstagingdirectory)\Framework'
inputs:
SourceFolder: '$(system.defaultworkingdirectory)\NBi.NUnit.Runtime\bin\Debug\'
TargetFolder: '$(build.artifactstagingdirectory)\Framework'
CleanTargetFolder: true
condition: succeededOrFailed()
- task: CopyFiles@2
displayName: 'Copy Files to: $(build.artifactstagingdirectory)\UI'
inputs:
SourceFolder: '$(system.defaultworkingdirectory)\NBi.UI.Genbi\bin\Debug'
TargetFolder: '$(build.artifactstagingdirectory)\UI'
CleanTargetFolder: true
condition: succeededOrFailed()
- task: CopyFiles@2
displayName: 'Copy Files to: $(build.artifactstagingdirectory)\Packages'
inputs:
SourceFolder: '$(system.defaultworkingdirectory)\.nupkg'
Contents: '*.nupkg'
TargetFolder: '$(build.artifactstagingdirectory)\Packages'
CleanTargetFolder: true
condition: succeededOrFailed()
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
condition: succeededOrFailed()
- task: NuGetCommand@2
displayName: 'NuGet push'
inputs:
command: push
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;'
publishVstsFeed: '0b85ebc7-d3b9-4844-886e-848213247f91'
allowPackageConflicts: true