forked from ShiftLeftSecurity/shiftleft-csharp-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
74 lines (65 loc) · 2.42 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
variables:
- group: shiftleft-token
trigger:
- master
- feature/*
pool:
vmImage: 'windows-latest'
stages:
- stage: Builders
displayName: Build sample applications
jobs:
- job: Build
displayName: Build .Net and .Net core apps
pool:
vmImage: 'windows-latest'
steps:
- task: NuGetToolInstaller@1
- task: PowerShell@2
displayName: Download ShiftLeft cli
inputs:
targetType: 'inline'
script: |
Invoke-WebRequest -Uri 'https://cdn.shiftleft.io/download/sl-latest-windows-x64.zip' -OutFile $(Agent.HomeDirectory)\sl.zip
Expand-Archive -Path $(Agent.HomeDirectory)\sl.zip -DestinationPath $(Agent.HomeDirectory)\
- task: DotNetCoreCLI@2
displayName: Build console app
inputs:
command: 'build'
projects: '$(Build.SourcesDirectory)\netcoreConsole'
- task: CmdLine@2
displayName: Analyze with Inspect
inputs:
script: |
$(Agent.HomeDirectory)\sl.exe analyze --force --app netcoreConsole --tag branch=$(Build.SourceBranchName) --csharp --dotnet-core --cpg netcoreConsole/netcoreConsole/netcoreConsole.csproj
workingDirectory: '$(Build.SourcesDirectory)'
env:
SHIFTLEFT_ORG_ID: $(SHIFTLEFT_ORG_ID)
SHIFTLEFT_ACCESS_TOKEN: $(SHIFTLEFT_ACCESS_TOKEN)
- task: DotNetCoreCLI@2
displayName: Build web api
inputs:
command: 'build'
projects: '$(Build.SourcesDirectory)\netcoreWebapi'
- task: CmdLine@2
displayName: Analyze with Inspect
inputs:
script: |
$(Agent.HomeDirectory)\sl.exe analyze --force --app netcoreWebapi --tag branch=$(Build.SourceBranchName) --csharp --dotnet-core --cpg netcoreWebapi/netcoreWebapi.csproj
workingDirectory: '$(Build.SourcesDirectory)'
env:
SHIFTLEFT_ORG_ID: $(SHIFTLEFT_ORG_ID)
SHIFTLEFT_ACCESS_TOKEN: $(SHIFTLEFT_ACCESS_TOKEN)
- task: MSBuild@1
inputs:
solution: '$(Build.SourcesDirectory)/netfwWebapi/*.sln'
msbuildVersion: '16.0'
- task: CmdLine@2
displayName: Analyze with Inspect
inputs:
script: |
$(Agent.HomeDirectory)\sl.exe analyze --force --app netfwWebapi --tag branch=$(Build.SourceBranchName) --csharp --cpg netfwWebapi/netfwWebapi.sln
workingDirectory: '$(Build.SourcesDirectory)'
env:
SHIFTLEFT_ORG_ID: $(SHIFTLEFT_ORG_ID)
SHIFTLEFT_ACCESS_TOKEN: $(SHIFTLEFT_ACCESS_TOKEN)