Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/6.0-staging] Merge 1ES templates #103366

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions eng/pipelines/common/global-build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ parameters:
enableRichCodeNavigation: false
richCodeNavigationLanguage: 'csharp'
richCodeNavigationEnvironment: 'production'
templatePath: 'templates'
preBuildSteps: []

jobs:
- template: /eng/common/templates/job/job.yml
- template: /eng/common/${{ parameters.templatePath }}/job/job.yml
parameters:
name: ${{ format('build_{0}{1}_{2}_{3}_{4}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.nameSuffix) }}
displayName: ${{ format('Build {0}{1} {2} {3} {4}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.nameSuffix) }}
Expand Down Expand Up @@ -145,7 +146,7 @@ jobs:
path: '$(Build.SourcesDirectory)/artifacts/obj/mono/offsetfiles'

- ${{ if eq(parameters.buildingOnSourceBuildImage, true) }}:
- template: /eng/common/templates/steps/source-build.yml
- template: /eng/common/${{ parameters.templatePath }}/steps/source-build.yml
parameters:
platform:
buildScript: $(_sclEnableCommand) $(Build.SourcesDirectory)$(dir)build$(scriptExt)
Expand Down Expand Up @@ -235,11 +236,16 @@ jobs:
- ${{ else }}:
- ${{ postBuildStep }}

- task: PublishBuildArtifacts@1
displayName: Publish Logs
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/'
PublishLocation: Container
ArtifactName: Logs_Build_${{ parameters.osGroup }}_${{ parameters.osSubGroup }}_${{ parameters.archType }}_${{ parameters.buildConfig }}_${{ parameters.nameSuffix }}
continueOnError: true
condition: always()
- template: /eng/pipelines/common/templates/publish-build-artifacts.yml
parameters:
isOfficialBuild: ${{ parameters.isOfficialBuild }}
displayName: Publish Logs
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/'
PublishLocation: Container
${{ if notin(parameters.osGroup, 'browser', 'wasi') }}:
ArtifactName: Logs_Build_Attempt$(System.JobAttempt)_${{ parameters.osGroup }}_${{ parameters.osSubGroup }}_${{ parameters.archType }}_${{ parameters.buildConfig }}_${{ parameters.nameSuffix }}
${{ if in(parameters.osGroup, 'browser', 'wasi') }}:
ArtifactName: Logs_Build_Attempt$(System.JobAttempt)_${{ parameters.osGroup }}_${{ parameters.archType }}_${{ parameters.hostedOs }}_${{ parameters.buildConfig }}_${{ parameters.nameSuffix }}
continueOnError: true
condition: always()
138 changes: 74 additions & 64 deletions eng/pipelines/common/templates/pipeline-with-resources.yml
Original file line number Diff line number Diff line change
@@ -1,79 +1,89 @@
parameters:
- name: stages
type: stageList
- name: isOfficialBuild
type: boolean
default: false

extends:
template: templateDispatch.yml
parameters:
${{ if parameters.isOfficialBuild }}:
templatePath: template1es.yml
${{ else }}:
templatePath: templatePublic.yml

stages: ${{ parameters.stages }}

containers:
Linux_arm:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-arm-20220907130538-70ed2e8
env:
ROOTFS_DIR: /crossrootfs/arm

Linux_armv6:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-cross-armv6-raspbian-10-20211208135931-e6e3ac4
env:
ROOTFS_DIR: /crossrootfs/armv6

Linux_arm64:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-20210719121212-8a8d3be
env:
ROOTFS_DIR: /crossrootfs/arm64

Linux_musl_x64:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.13-WithNode-20210910135845-c401c85

Linux_musl_arm:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-arm-alpine-20220915134743-78f7860
env:
ROOTFS_DIR: /crossrootfs/arm

Linux_musl_arm64:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-alpine-20210719121212-b2c2436
env:
ROOTFS_DIR: /crossrootfs/arm64

resources:
containers:
- container: Linux_arm
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-arm-20220907130538-70ed2e8
env:
ROOTFS_DIR: /crossrootfs/arm

- container: Linux_armv6
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-cross-armv6-raspbian-10-20211208135931-e6e3ac4
env:
ROOTFS_DIR: /crossrootfs/armv6

- container: Linux_arm64
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-20210719121212-8a8d3be
env:
ROOTFS_DIR: /crossrootfs/arm64

- container: Linux_musl_x64
image: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.13-WithNode-20210910135845-c401c85

- container: Linux_musl_arm
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-arm-alpine-20220915134743-78f7860
env:
ROOTFS_DIR: /crossrootfs/arm

- container: Linux_musl_arm64
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-alpine-20210719121212-b2c2436
env:
ROOTFS_DIR: /crossrootfs/arm64
# This container contains all required toolsets to build for Android and for Linux with bionic libc.
Linux_bionic:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-android-20200422191843-e2c3f83

- container: Linux_bionic
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-android-20200422191843-e2c3f83
Linux_x64:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-20210714125435-9b5bbc2

- container: Linux_x64
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-20210714125435-9b5bbc2
Linux_x86:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-x86-linux-20211022152824-f853169
env:
ROOTFS_DIR: /crossrootfs/x86

- container: Linux_x86
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-x86-linux-20211022152824-f853169
env:
ROOTFS_DIR: /crossrootfs/x86
SourceBuild_Linux_x64:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-source-build-20210714125450-5d87b80

- container: SourceBuild_Linux_x64
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-source-build-20210714125450-5d87b80
Linux_s390x:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-s390x-20201102145728-d6e0352
env:
ROOTFS_DIR: /crossrootfs/s390x

- container: Linux_s390x
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-s390x-20201102145728-d6e0352
env:
ROOTFS_DIR: /crossrootfs/s390x
Linux_ppc64le:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-ppc64le-20220531132048-b9de666
env:
ROOTFS_DIR: /crossrootfs/ppc64le

- container: Linux_ppc64le
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-ppc64le-20220531132048-b9de666
env:
ROOTFS_DIR: /crossrootfs/ppc64le
Browser_wasm:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-webassembly-20210531091624-f5c7a43

- container: Browser_wasm
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-webassembly-20210531091624-f5c7a43
FreeBSD_x64:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-freebsd-12-20210917001307-f13d79e
env:
ROOTFS_DIR: /crossrootfs/x64

- container: FreeBSD_x64
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-freebsd-12-20210917001307-f13d79e
env:
ROOTFS_DIR: /crossrootfs/x64
Tizen_armel:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-armel-tizen-20210719212651-8b02f56
env:
ROOTFS_DIR: /crossrootfs/armel

- container: Tizen_armel
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-armel-tizen-20210719212651-8b02f56
env:
ROOTFS_DIR: /crossrootfs/armel
debpkg:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-debpkg-20220504035737-cfdd435

- container: debpkg
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-debpkg-20220504035737-cfdd435

- container: rpmpkg
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-8-rpmpkg-20210714125410-daa5116

stages: ${{ parameters.stages }}
rpmpkg:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-8-rpmpkg-20210714125410-daa5116
22 changes: 22 additions & 0 deletions eng/pipelines/common/templates/publish-build-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
parameters:
- name: isOfficialBuild
type: boolean
- name: displayName
type: string
- name: inputs
type: object
- name: condition
type: string
default: ''

steps:
- ${{ if parameters.isOfficialBuild }}:
- task: 1ES.PublishBuildArtifacts@1
displayName: ${{ parameters.displayName }}
inputs: ${{ parameters.inputs }}
condition: ${{ parameters.condition }}
- ${{ else }}:
- task: PublishBuildArtifacts@1
displayName: ${{ parameters.displayName }}
inputs: ${{ parameters.inputs }}
condition: ${{ parameters.condition }}
17 changes: 17 additions & 0 deletions eng/pipelines/common/templates/publish-pipeline-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
parameters:
- name: displayName
type: string
- name: inputs
type: object
- name: isOfficialBuild
type: boolean

steps:
- ${{ if parameters.isOfficialBuild }}:
- task: 1ES.PublishPipelineArtifact@1
displayName: ${{ parameters.displayName }}
inputs: ${{ parameters.inputs }}
- ${{ else }}:
- task: PublishPipelineArtifact@1
displayName: ${{ parameters.displayName }}
inputs: ${{ parameters.inputs }}
17 changes: 10 additions & 7 deletions eng/pipelines/common/templates/runtimes/build-test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ parameters:
runtimeVariant: ''
dependsOn: []
dependOnEvaluatePaths: false
isOfficialBuild: false

### Build managed test components (native components are getting built as part
### of the the product build job).
Expand Down Expand Up @@ -161,10 +162,12 @@ jobs:


# Publish Logs
- task: PublishPipelineArtifact@1
displayName: Publish Logs
inputs:
targetPath: $(Build.SourcesDirectory)/artifacts/log
artifactName: '${{ parameters.runtimeFlavor }}_Common_Runtime_TestBuildLogs_AnyOS_AnyCPU_$(buildConfig)_Lib${{ parameters.liveLibrariesBuildConfig }}_${{ parameters.testGroup }}'
continueOnError: true
condition: always()
- template: /eng/pipelines/common/templates/publish-pipeline-artifacts.yml
parameters:
displayName: Publish Logs
isOfficialBuild: ${{ parameters.isOfficialBuild }}
inputs:
targetPath: $(Build.SourcesDirectory)/artifacts/log
ArtifactName: '${{ parameters.runtimeFlavor }}_Common_Runtime_TestBuildLogs_Attempt$(System.JobAttempt)_AnyOS_AnyCPU_$(buildConfig)_${{ parameters.testGroup }}'
continueOnError: true
condition: always()
3 changes: 2 additions & 1 deletion eng/pipelines/common/templates/runtimes/xplat-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ parameters:
timeoutInMinutes: ''
enableMicrobuild: ''
gatherAssetManifests: false
templatePath: 'templates'

variables: {} ## any extra variables to add to the defaults defined below

jobs:
- template: /eng/common/templates/job/job.yml
- template: /eng/common/${{ parameters.templatePath }}/job/job.yml
parameters:

name: ${{ parameters.name }}
Expand Down
31 changes: 31 additions & 0 deletions eng/pipelines/common/templates/template1es.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@


parameters:
- name: templatePath
type: string
default: 'templates-official'
- name: stages
type: stageList
- name: containers
type: object


resources:
repositories:
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release

extends:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
pool:
name: NetCore1ESPool-Svc-Internal
image: 1es-windows-2022
os: windows

containers:
${{ parameters.containers }}

stages: ${{ parameters.stages }}
13 changes: 13 additions & 0 deletions eng/pipelines/common/templates/templateDispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
parameters:
- name: templatePath
type: string
- name: stages
type: stageList
- name: containers
type: object

extends:
template: ${{ parameters.templatePath }}
parameters:
stages: ${{ parameters.stages }}
containers: ${{ parameters.containers }}
21 changes: 21 additions & 0 deletions eng/pipelines/common/templates/templatePublic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

parameters:
- name: templatePath
type: string
default: 'templates'
- name: stages
type: stageList
- name: containers
type: object

resources:
containers:
- ${{ each container_pair in parameters.containers }}:
- ${{ if container_pair.value.image }}:
- container: ${{ container_pair.key }}
${{ each pair in container_pair.value }}:
${{ if notIn(pair.key, 'tenantId', 'identityType', 'registry') }}:
${{ pair.key }}: ${{ pair.value }}


stages: ${{ parameters.stages }}
14 changes: 9 additions & 5 deletions eng/pipelines/common/upload-artifact-step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ parameters:
archiveExtension: ''
artifactName: ''
displayName: ''
isOfficialBuild: false

steps:
# Zip Artifact
Expand All @@ -18,8 +19,11 @@ steps:
tarCompression: ${{ parameters.tarCompression }}
includeRootFolder: ${{ parameters.includeRootFolder }}

- task: PublishBuildArtifacts@1
displayName: 'Publish ${{ parameters.displayName }}'
inputs:
pathtoPublish: $(Build.StagingDirectory)/${{ parameters.artifactName }}${{ parameters.archiveExtension }}
artifactName: ${{ parameters.artifactName }}
- template: /eng/pipelines/common/templates/publish-build-artifacts.yml
parameters:
isOfficialBuild: ${{ parameters.isOfficialBuild }}
displayName: 'Publish ${{ parameters.displayName }}'
inputs:
PathtoPublish: $(Build.StagingDirectory)/${{ parameters.artifactName }}${{ parameters.archiveExtension }}
artifactName: ${{ parameters.artifactName }}
condition: ${{ parameters.condition }}
Loading
Loading