Skip to content

Commit a44a6c4

Browse files
authored
add yml based pipeline (1ES conversion) (#105)
1 parent 06de5f5 commit a44a6c4

1 file changed

Lines changed: 127 additions & 0 deletions

File tree

azure-pipeline/azure-pipeline.yml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool.
2+
# Please make sure to check all the converted content, it is your team's responsibility to make sure that the pipeline is still valid and functions as expected.
3+
# The SBOM tasks have been removed because they are not required for the unofficial template.
4+
# You can manually enable SBOM in the unofficial template if needed, othewise its automatically enabled when using official template. https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/sbom
5+
# This pipeline will be extended to the MicroBuild template
6+
# The Task 'PublishBuildArtifacts@1' has been converted to an output named 'Publish Artifact: Nuget packages' in the templateContext section.
7+
trigger: none
8+
resources:
9+
repositories:
10+
- repository: self
11+
type: git
12+
ref: refs/heads/main
13+
- repository: MicroBuildTemplate
14+
type: git
15+
name: 1ESPipelineTemplates/MicroBuildTemplate
16+
ref: refs/tags/release
17+
name: $(Date:yyyyMMdd).$(Rev:r)
18+
variables:
19+
- name: EnableNuGetPackageRestore
20+
value: true
21+
- name: Packaging.EnableSBOMSigning
22+
value: true
23+
- name: TeamName
24+
value: Asp.Net
25+
extends:
26+
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
27+
parameters:
28+
sdl:
29+
sourceAnalysisPool:
30+
name: AzurePipelines-EO
31+
image: 1ESPT-Windows2022
32+
os: windows
33+
customBuildTags:
34+
- ES365AIMigrationTooling
35+
stages:
36+
- stage: stage
37+
jobs:
38+
- job: Phase_1
39+
displayName: Phase 1
40+
cancelTimeoutInMinutes: 1
41+
pool:
42+
name: VSEngSS-MicroBuild2022-1ES
43+
templateContext:
44+
mb:
45+
signing:
46+
enabled: true
47+
outputs:
48+
- output: pipelineArtifact
49+
displayName: 'Publish Artifact: Nuget packages'
50+
targetPath: $(Build.SourcesDirectory)\.binaries\Packages\Release
51+
artifactName: Nuget packages
52+
steps:
53+
- checkout: self
54+
clean: true
55+
fetchTags: true
56+
- task: NuGetToolInstaller@0
57+
displayName: Use NuGet 5.4.0
58+
inputs:
59+
versionSpec: 5.4.0
60+
checkLatest: true
61+
- task: NuGetCommand@2
62+
displayName: NuGet custom
63+
inputs:
64+
command: custom
65+
arguments: install MicroBuild.Core -version 0.3.0 -OutputDirectory .\packages -source https://devdiv.pkgs.visualstudio.com/DefaultCollection/_packaging/MicroBuildToolset/nuget/v3/index.json
66+
- task: NuGetCommand@2
67+
displayName: NuGet restore
68+
inputs:
69+
solution: Microsoft.Aspnet.SessionState.sln
70+
- task: MSBuild@1
71+
displayName: Build solution MicrosoftAspNetSessionState.msbuild
72+
inputs:
73+
solution: MicrosoftAspNetSessionState.msbuild
74+
msbuildVersion: 17.0
75+
msbuildArchitecture: x64
76+
configuration: Release
77+
msbuildArguments: /p:GitCommit=%BUILD_SOURCEVERSION% /p:GitCommitLink="https://github.com/aspnet/AspNetSessionState/commit/%BUILD_SOURCEVERSION%" /p:SignType=real /p:SignAssembly=true /verbosity:normal
78+
clean: true
79+
createLogFile: true
80+
logFileVerbosity: detailed
81+
- task: CopyFiles@2
82+
displayName: Stage dll's for verification
83+
inputs:
84+
SourceFolder: $(Build.SourcesDirectory)\.binaries\bin\Release
85+
Contents: Microsoft.AspNet.SessionState.*.dll
86+
TargetFolder: $(Build.SourcesDirectory)\.binaries\verify\dlls
87+
CleanTargetFolder: true
88+
OverWrite: true
89+
- task: CopyFiles@2
90+
displayName: Stage nupkg's for verification
91+
inputs:
92+
SourceFolder: $(Build.SourcesDirectory)\.binaries\Packages\Release
93+
Contents: |
94+
Microsoft.AspNet.SessionState.*.nupkg
95+
!*.symbols.nupkg
96+
TargetFolder: $(Build.SourcesDirectory)\.binaries\verify\packages
97+
CleanTargetFolder: true
98+
OverWrite: true
99+
- task: ms-vseng.MicroBuildShipTasks.7c429315-71ba-4cb3-94bb-f829c95f7915.MicroBuildCodesignVerify@1
100+
displayName: Verify Signed Binaries
101+
inputs:
102+
TargetFolder: $(Build.SourcesDirectory)\.binaries\verify\dlls
103+
ExcludeFolders: .git MicroBuild apiscan
104+
- task: ms-vseng.MicroBuildShipTasks.7c429315-71ba-4cb3-94bb-f829c95f7915.MicroBuildCodesignVerify@1
105+
displayName: Verify Signed Packages
106+
inputs:
107+
TargetFolder: $(Build.SourcesDirectory)\.binaries\verify\packages
108+
WhiteListPathForCerts: tools/.verif.whitelist
109+
ExcludeFolders: .git MicroBuild decomp *.xml
110+
- task: CmdLine@2
111+
displayName: Map ConnectionString for ApiScan
112+
inputs:
113+
script: |
114+
@echo off
115+
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
116+
REM
117+
REM We can set/update pipeline variables using the syntax used below. That way we can use a script task to
118+
REM pull secrets into the environment for APIScan to use, since the ApiScan task does not have an 'Environment'
119+
REM section for mapping secrets in classic pipelines.
120+
REM
121+
REM Make sure the pipeline secret variable 'AzureServicesAuthConnectionString' is set. It's format is like
122+
REM "runAs=App;AppId={AppId};TenantId={TenantId};AppKey={ClientSecret}"
123+
REM The values for that connStr can be found in the Tellurium Key Vault.
124+
@echo ##vso[task.setvariable variable=AzureServicesAuthConnectionString]%MappedConnectionString%
125+
continueOnError: true
126+
env:
127+
MappedConnectionString: $(AzureServicesAuthConnectionStringSecret)

0 commit comments

Comments
 (0)