Skip to content

Commit 7655d1f

Browse files
authored
Updatepipeline (#107)
* Add APIScan Task * Add APIScan Task
1 parent 11b2c50 commit 7655d1f

1 file changed

Lines changed: 19 additions & 30 deletions

File tree

azure-pipeline/azure-pipeline.yml

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
# This pipeline will be extended to the MicroBuild template
66
# The Task 'PublishBuildArtifacts@1' has been converted to an output named 'Publish Artifact: Nuget packages' in the templateContext section.
77
trigger: none
8+
schedules:
9+
- cron: "0 0 14 * *"
10+
branches:
11+
include:
12+
- main
13+
always: true
814
resources:
915
repositories:
1016
- repository: self
@@ -26,6 +32,8 @@ extends:
2632
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
2733
parameters:
2834
sdl:
35+
policheck:
36+
enable: true
2937
sourceAnalysisPool:
3038
name: AzurePipelines-EO
3139
image: 1ESPT-Windows2022
@@ -65,14 +73,10 @@ extends:
6573
inputs:
6674
command: custom
6775
arguments: install MicroBuild.Core -version 0.3.0 -OutputDirectory .\packages -source https://devdiv.pkgs.visualstudio.com/DefaultCollection/_packaging/MicroBuildToolset/nuget/v3/index.json
68-
# to delete
69-
continueOnError: true
7076
- task: NuGetCommand@2
7177
displayName: NuGet restore
7278
inputs:
7379
solution: Microsoft.Aspnet.SessionState.sln
74-
# to delete
75-
continueOnError: true
7680
- task: MSBuild@1
7781
displayName: Build solution MicrosoftAspNetSessionState.msbuild
7882
inputs:
@@ -84,8 +88,6 @@ extends:
8488
clean: true
8589
createLogFile: true
8690
logFileVerbosity: detailed
87-
# to delete
88-
continueOnError: true
8991
- task: CopyFiles@2
9092
displayName: Stage dll's for verification
9193
inputs:
@@ -94,8 +96,6 @@ extends:
9496
TargetFolder: $(Build.SourcesDirectory)\.binaries\verify\dlls
9597
CleanTargetFolder: true
9698
OverWrite: true
97-
# to delete
98-
continueOnError: true
9999
- task: CopyFiles@2
100100
displayName: Stage nupkg's for verification
101101
inputs:
@@ -106,38 +106,27 @@ extends:
106106
TargetFolder: $(Build.SourcesDirectory)\.binaries\verify\packages
107107
CleanTargetFolder: true
108108
OverWrite: true
109-
# to delete
110-
continueOnError: true
111109
- task: ms-vseng.MicroBuildShipTasks.7c429315-71ba-4cb3-94bb-f829c95f7915.MicroBuildCodesignVerify@1
112110
displayName: Verify Signed Binaries
113111
inputs:
114112
TargetFolder: $(Build.SourcesDirectory)\.binaries\verify\dlls
115113
ExcludeFolders: .git MicroBuild apiscan
116-
# to delete
117-
continueOnError: true
118114
- task: ms-vseng.MicroBuildShipTasks.7c429315-71ba-4cb3-94bb-f829c95f7915.MicroBuildCodesignVerify@1
119115
displayName: Verify Signed Packages
120116
inputs:
121117
TargetFolder: $(Build.SourcesDirectory)\.binaries\verify\packages
122118
WhiteListPathForCerts: tools/.verif.whitelist
123119
ExcludeFolders: .git MicroBuild decomp *.xml
124-
# to delete
125-
continueOnError: true
126-
- task: CmdLine@2
127-
displayName: Map ConnectionString for ApiScan
120+
# Following article on https://dev.azure.com/devdiv/DevDiv/_wiki/wikis/DevDiv.wiki/25351/APIScan-step-by-step-guide-to-setting-up-a-Pipeline
121+
# No longer need the old format, and following guideline to use (ApiScanClientId)
122+
- task: APIScan@2
123+
displayName: Run APIScan
128124
inputs:
129-
script: |
130-
@echo off
131-
REM Per the documentation here - https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=classic%2Cbatch#set-variables-in-scripts
132-
REM
133-
REM We can set/update pipeline variables using the syntax used below. That way we can use a script task to
134-
REM pull secrets into the environment for APIScan to use, since the ApiScan task does not have an 'Environment'
135-
REM section for mapping secrets in classic pipelines.
136-
REM
137-
REM Make sure the pipeline secret variable 'AzureServicesAuthConnectionString' is set. It's format is like
138-
REM "runAs=App;AppId={AppId};TenantId={TenantId};AppKey={ClientSecret}"
139-
REM The values for that connStr can be found in the Tellurium Key Vault.
140-
@echo ##vso[task.setvariable variable=AzureServicesAuthConnectionString]%MappedConnectionString%
141-
continueOnError: true
125+
softwareFolder: '$(Build.SourcesDirectory)\.binaries\verify\dlls'
126+
softwareName: 'Microsoft.AspNet.SessionState.*'
127+
softwareVersionNum: '*'
128+
softwareBuildNum: '$(Build.BuildId)'
129+
symbolsFolder: '$(Build.SourcesDirectory)\.binaries\bin\Release;SRV*http://symweb'
130+
verbosityLevel: 'none'
142131
env:
143-
MappedConnectionString: $(AzureServicesAuthConnectionStringSecret)
132+
AzureServicesAuthConnectionString: RunAs=App;AppId=$(ApiScanClientId)

0 commit comments

Comments
 (0)