Skip to content

Commit

Permalink
1ES Pipelines Template Adoption (#4670)
Browse files Browse the repository at this point in the history
* 1ES Pipelines Template Adoption

- Added 1Es templates ci
- Changed pools for Windows/Ubuntu to 1ES pools
- Disabled sign validation

* 1ES Pipelines Template Adoption

- Added baseline
- Added pool to proxy tests

* 1ES Pipelines Template Adoption

- Restored sign validation

* 1ES Pipelines Template Adoption

- replaced pipelineArtifacts with buildArtifacts
- changed artifact conditions

* 1ES Pipelines Template Adoption

- Skip CG
- Add mariner pool

* 1ES Pipelines Template Adoption

- Skip CG
- Add mariner pool

* 1ES Pipelines Template Adoption

- Skip CG
- Add mariner pool

* 1ES Pipelines Template Adoption

- Add parameter for notifications

* 1ES Pipelines Template Adoption

- Add parameter for notifications

* 1ES Pipelines Template Adoption

- Add parameter for notifications

* 1ES Pipelines Template Adoption

- Add arm pool

* 1ES Pipelines Template Adoption

- changed to dnf

* 1ES Pipelines Template Adoption

- changed to dnf

* 1ES Pipelines Template Adoption

- changed to dnf

* 1ES Pipelines Template Adoption

- changed to dnf

* 1ES Pipelines Template Adoption

- replaced mariner pool with 1ES-ABTT-Shared-Pool

* 1ES Pipelines Template Adoption

- Restore release conditions

* 1ES Pipelines Template Adoption

- Temporary set agent's version

* 1ES Pipelines Template Adoption

- Skip directories when copying hashes

* 1ES Pipelines Template Adoption

- Skip directories when copying hashes

* 1ES Pipelines Template Adoption

- Change os to unix

* 1ES Pipelines Template Adoption

- Restore agent version
  • Loading branch information
DmitriiBobreshev authored Feb 28, 2024
1 parent 1e9f5f1 commit 2b80cee
Show file tree
Hide file tree
Showing 9 changed files with 654 additions and 439 deletions.
69 changes: 26 additions & 43 deletions .azure-pipelines/build-job.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool.
parameters:

- name: jobName
Expand Down Expand Up @@ -43,9 +44,6 @@ parameters:
- name: codeCoverage
type: boolean

- name: componentDetection
type: boolean

- name: sign
type: boolean

Expand Down Expand Up @@ -87,15 +85,26 @@ jobs:
DisableDockerDetector: true
nugetMultiFeedWarnLevel: none
CheckoutBranch: ${{ parameters.branch }}

templateContext:
outputs:
- ${{ if or(parameters.unitTests, parameters.functionalTests) }}:
- output: buildArtifacts
displayName: 'Publish Test logs'
condition: always()
PathtoPublish: src/Test/TestLogs
ArtifactName: ${{ parameters.os }}-${{ parameters.arch }}-$(System.JobId)
- ${{ if eq(parameters.publishArtifact, true) }}:
- output: buildArtifacts
displayName: 'Publish Hash Artifact'
PathtoPublish: _package
ArtifactName: agent
- ${{ if eq(parameters.publishArtifact, true) }}:
- output: buildArtifacts
displayName: 'Publish Agent Artifact'
PathtoPublish: _package_hash
ArtifactName: hash
steps:

# Component detection
- ${{ if parameters.componentDetection }}:
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
displayName: 'Component Detection'

# Clean
- checkout: self
clean: true

Expand All @@ -113,7 +122,7 @@ jobs:
# 1ES images used on the ARM pool doesn't contain unzip tool, so we need to install it before starting the build
- ${{ if and(eq(parameters.arch, 'arm64'), ne(parameters.os, 'osx')) }}:
- script: sudo apt-get update && sudo apt-get -y install unzip
- script: sudo dnf -y update && sudo dnf -y install unzip
displayName: Install unzip
retryCountOnTaskFailure: 5

Expand Down Expand Up @@ -159,9 +168,9 @@ jobs:
- task: UseDotNet@2
displayName: Install .NET Core 6 SDK
inputs:
version: '6.0.418'
packageType: sdk
performMultiLevelLookup: true
version: '6.0.418'
packageType: sdk
performMultiLevelLookup: true
- script: ${{ variables.devCommand }} testl1 Debug ${{ parameters.os }}-${{ parameters.arch }}
workingDirectory: src
displayName: Functional tests
Expand All @@ -176,15 +185,6 @@ jobs:
testRunTitle: 'Agent Tests - ${{ parameters.os }}-${{ parameters.arch }}'
condition: always()

# Upload test log
- task: PublishBuildArtifacts@1.200.0
displayName: Publish Test logs
inputs:
pathToPublish: src/Test/TestLogs
artifactName: ${{ parameters.os }}-${{ parameters.arch }}-$(System.JobId)
artifactType: container
condition: always()

# Code coverage
- ${{ if and(parameters.codeCoverage, parameters.unitTests, parameters.functionalTests) }}:
- script: dotnet tool install --global dotnet-reportgenerator-globaltool
Expand All @@ -208,7 +208,7 @@ jobs:

- ${{ if parameters.sign }}:
# Signing steps
- template: signing.yml
- template: /.azure-pipelines/signing.yml@self
parameters:
layoutRoot: ${{ variables.layoutRoot }}
isWindows: ${{ eq(parameters.os, 'win') }}
Expand All @@ -218,7 +218,7 @@ jobs:

# Package .NET Core Windows dependency (VC++ Redistributable)
- ${{ if eq(parameters.os, 'win') }}:
- template: package-vcredist.yml
- template: /.azure-pipelines/package-vcredist.yml@self
parameters:
layoutRoot: ${{ variables.layoutRoot }}
flavor: ${{ parameters.arch }}
Expand All @@ -232,23 +232,6 @@ jobs:
workingDirectory: src
displayName: Hash Package

# Upload agent package zip as build artifact
- task: PublishBuildArtifacts@1.200.0
displayName: Publish Artifact
inputs:
pathToPublish: _package
artifactName: agent
artifactType: container

# Publish agent package hash too
- task: PublishBuildArtifacts@1.200.0
displayName: Publish Artifact
inputs:
pathToPublish: _package_hash
artifactName: hash
artifactType: container

# Signing verification
- ${{ if parameters.verifySigning }}:

# Verify all binaries are signed (generate report)
Expand All @@ -263,4 +246,4 @@ jobs:
inputs:
CodesignValidation: true
CodesignValidationBreakOn: WarningAbove
ToolLogsNotFoundAction: Error
ToolLogsNotFoundAction: Error
59 changes: 28 additions & 31 deletions .azure-pipelines/build-jobs.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool.

parameters:

- name: jobName
Expand Down Expand Up @@ -39,9 +41,6 @@ parameters:
type: boolean
default: false

- name: componentDetection
type: boolean

- name: sign
type: boolean

Expand All @@ -61,41 +60,39 @@ parameters:
default: false

jobs:
- template: build-job.yml
- template: /.azure-pipelines/build-job.yml@self
parameters:
jobName: ${{ parameters.jobName }}
displayName: ${{ parameters.displayName }}
pool: ${{ parameters.pool }}
container: ${{ parameters.container }}
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
os: ${{ parameters.os }}
arch: ${{ parameters.arch }}
branch: ${{ parameters.branch }}
codeCoverage: ${{ parameters.codeCoverage }}
unitTests: ${{ parameters.unitTests }}
functionalTests: ${{ parameters.functionalTests }}
sign: ${{ parameters.sign }}
verifySigning: ${{ parameters.verifySigning }}
publishArtifact: ${{ parameters.publishArtifacts }}
packageType: agent

- ${{ if parameters.buildAlternatePackage }}:
- template: /.azure-pipelines/build-job.yml@self
parameters:
jobName: ${{ parameters.jobName }}
displayName: ${{ parameters.displayName }}
jobName: ${{ parameters.jobName }}_alternate
displayName: ${{ parameters.displayName }} (without Node 6)
pool: ${{ parameters.pool }}
container: ${{ parameters.container }}
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
os: ${{ parameters.os }}
arch: ${{ parameters.arch }}
branch: ${{ parameters.branch }}
codeCoverage: ${{ parameters.codeCoverage }}
componentDetection: ${{ parameters.componentDetection }}
unitTests: ${{ parameters.unitTests }}
functionalTests: ${{ parameters.functionalTests }}
codeCoverage: false
unitTests: false
functionalTests: false
sign: ${{ parameters.sign }}
verifySigning: ${{ parameters.verifySigning }}
publishArtifact: ${{ parameters.publishArtifacts }}
packageType: agent

- ${{ if parameters.buildAlternatePackage }}:
- template: build-job.yml
parameters:
jobName: ${{ parameters.jobName }}_alternate
displayName: ${{ parameters.displayName }} (without Node 6)
pool: ${{ parameters.pool }}
container: ${{ parameters.container }}
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
os: ${{ parameters.os }}
arch: ${{ parameters.arch }}
branch: ${{ parameters.branch }}
codeCoverage: false
componentDetection: ${{ parameters.componentDetection }}
unitTests: false
functionalTests: false
sign: ${{ parameters.sign }}
verifySigning: ${{ parameters.verifySigning }}
publishArtifact: ${{ parameters.publishArtifacts }}
packageType: pipelines-agent
packageType: pipelines-agent
3 changes: 2 additions & 1 deletion .azure-pipelines/package-vcredist.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool.
parameters:
- name: layoutRoot
type: string
Expand All @@ -19,4 +20,4 @@ steps:
[System.IO.Compression.ZipFile]::ExtractToDirectory($outFile, $unzipDir)
$agentLayoutBin = Join-Path -Path $(Build.SourcesDirectory) -ChildPath "${{ parameters.layoutRoot }}\bin"
Copy-Item -Path $unzipDir -Destination $agentLayoutBin -Force
displayName: Package UCRT
displayName: Package UCRT
Loading

0 comments on commit 2b80cee

Please sign in to comment.