forked from webmotions/fake-authentication-jwtbearer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
97 lines (87 loc) · 2.46 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
pool:
name: Azure Pipelines
vmImage: 'ubuntu-latest'
pr:
autoCancel: true
branches:
include:
- master
drafts: false
variables:
- name: BuildPlatform
value: 'Any CPU'
- name: Solution
value: 'WebMotions.Fake.Authentication.JwtBearer.sln'
- name: BuildConfiguration
value: 'Release'
- name: dropName
value: 'drop'
stages:
- stage: buildStage
displayName: 'Build'
jobs:
- job: buildJob
displayName: 'Build'
steps:
- checkout: self
- task: UseDotNet@2
displayName: '.NET Core 7.0.x'
inputs:
version: '7.0.x'
packageType: sdk
- task: DotNetCoreCLI@2
name: restoreVulnerabilitiesSolution
displayName: 'Restore Vulnerabilitity solution'
inputs:
command: restore
projects: $(Solution)
verbosityRestore: normal
- task: PowerShell@2
name: checkVulnerabilities
displayName: 'Vulnerabilities check'
inputs:
pwsh: true
targetType: inline
script: |
$output = dotnet list "$(Solution)" package --vulnerable
Write-Output $output
$errors = $output | Select-String '>'
if ($errors.Count -gt 0)
{
foreach ($err in $errors)
{
Write-Host "##vso[task.logissue type=error]Reference to vulnerable NuGet package $err"
}
exit 1
}
else
{
Write-Host "No vulnerable NuGet packages"
exit 0
}
- task: DotNetCoreCLI@2
displayName: Build solution
inputs:
projects: $(Solution)
arguments: --configuration $(BuildConfiguration)
- task: DotNetCoreCLI@2
displayName: 'Test'
inputs:
command: test
projects: 'test/**/*.csproj'
arguments: '--configuration $(buildConfiguration) -l "console;verbosity=detailed"'
publishTestResults: true
- task: DotNetCoreCLI@2
displayName: 'Publish'
inputs:
command: publish
publishWebProjects: false
projects: src/WebMotions.Fake.Authentication.JwtBearer/WebMotions.Fake.Authentication.JwtBearer.csproj
arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
zipAfterPublish: True
- task: PublishPipelineArtifact@1
displayName: 'Publish Artifact'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
parallel: true
artifactName: $(dropName)