Skip to content
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
2 changes: 1 addition & 1 deletion .vsts.pipelines/builds/ci-internal.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
jobs:
stages:
- template: matrix.yml
parameters:
windowsPoolName: NetCoreInternal-Int-Pool
Expand Down
2 changes: 1 addition & 1 deletion .vsts.pipelines/builds/ci.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
jobs:
stages:
- template: matrix.yml
74 changes: 43 additions & 31 deletions .vsts.pipelines/builds/matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,58 +9,70 @@ parameters:
windowsPoolName: NetCorePublic-Int-Pool
windowsQueueName: buildpool.windows.10.amd64.vs2017.open

jobs:
- template: ../jobs/ci-linux.yml
stages:
- template: ../stages/stage-jobs-matrix.yml
parameters:
job: centos71
imageName: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-359e48e-20200313130914
reportPrebuiltLeaks: true
jobTemplateName: ../jobs/ci-linux.yml
name: centos71
jobParameters:
imageName: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-359e48e-20200313130914
reportPrebuiltLeaks: true
matrix:
Production: {}
Online: { type: Online }
Offline: { type: Offline }
Offline Portable: { type: Offline Portable }

- template: ../jobs/ci-linux.yml
- template: ../stages/stage-jobs-matrix.yml
parameters:
job: debian9
imageName: mcr.microsoft.com/dotnet-buildtools/prereqs:debian-stretch-bfcd90a-20200121150012
jobTemplateName: ../jobs/ci-linux.yml
name: debian9
jobParameters:
imageName: mcr.microsoft.com/dotnet-buildtools/prereqs:debian-stretch-bfcd90a-20200121150012
matrix:
Production: {}
Online: { type: Online }

- template: ../jobs/ci-linux.yml
- template: ../stages/stage-jobs-matrix.yml
parameters:
job: fedora30
imageName: mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-30-bfcd90a-20200324132732
jobTemplateName: ../jobs/ci-linux.yml
name: fedora30
jobParameters:
imageName: mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-30-bfcd90a-20200324132732
matrix:
Production: {}
Online: { type: Online }
Offline: { type: Offline }
Offline Portable: { type: Offline Portable }

- template: ../jobs/ci-linux.yml
- template: ../stages/stage-jobs-matrix.yml
parameters:
job: ubuntu1804
imageName: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-85814b7-20200324125103
jobTemplateName: ../jobs/ci-linux.yml
name: ubuntu1804
jobParameters:
imageName: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-85814b7-20200324125103

- template: ../jobs/ci-local.yml
- template: ../stages/stage-jobs-matrix.yml
parameters:
job: osx
pool:
name: Hosted macOS
scriptPrefix: ./
scriptSuffix: .sh
setupMac: true
jobTemplateName: ../jobs/ci-local.yml
name: osx
jobParameters:
pool:
name: Hosted macOS
scriptPrefix: ./
scriptSuffix: .sh
setupMac: true

- template: ../jobs/ci-local.yml
- template: ../stages/stage-jobs-matrix.yml
parameters:
job: windows
pool:
name: ${{ parameters.windowsPoolName }}
queue: ${{ parameters.windowsQueueName }}
scriptPrefix: ''
scriptSuffix: .cmd
setupWindows: true
skipSmokeTest: true
failOnPrebuiltBaselineError: false
jobTemplateName: ../jobs/ci-local.yml
name: windows
jobParameters:
pool:
name: ${{ parameters.windowsPoolName }}
queue: ${{ parameters.windowsQueueName }}
scriptPrefix: ''
scriptSuffix: .cmd
setupWindows: true
skipSmokeTest: true
failOnPrebuiltBaselineError: false
9 changes: 2 additions & 7 deletions .vsts.pipelines/jobs/ci-linux.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
parameters:
job: null
matrix:
Production: {}
pool:
name: Hosted Ubuntu 1604
imageName: null
reportPrebuiltLeaks: false

jobs:
- job: ${{ parameters.job }}
strategy:
matrix: ${{ parameters.matrix }}
pool: ${{ parameters.pool }}
timeoutInMinutes: 270
variables:
# Prefix to distinguish artifacts from different legs.
artifactName: ${{ format('{0} $(type)', parameters.job) }}
artifactName: ${{ parameters.job }}
# Use ":z" to set selinux flag for sharing in build-owned root dir. https://docs.docker.com/storage/bind-mounts/#configure-the-selinux-label
docker.agentSrc.map: -v $(Build.SourcesDirectory):/agentSrc:z
docker.agentSrc.work: -w /agentSrc
Expand All @@ -34,7 +29,7 @@ jobs:
stagingDirectory: $(rootDirectory)/sb/staging
tarballName: tarball_$(Build.BuildId)
# Default type, can be overridden by matrix legs.
type: Production
type: ${{ coalesce(parameters.type, 'Production') }}

steps:
- template: ../steps/cleanup-unneeded-files.yml
Expand Down
86 changes: 86 additions & 0 deletions .vsts.pipelines/stages/prepare-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
parameters:
gatherJobs: []
gatherPortableJob: ''

# downloadBuildConfig by default uses the current build, but can be changed to point at an
# existing/previous build by passing properties like these, instead:
#
# buildType: specific
# buildVersionToDownload: specific
# project: 'public'
# definition: 'source-build-CI'
# buildId: 741400
#
# By defining this in one place, it's easier to set this up if necessary. This may be useful
# because the build takes a long time relative to prepare-artifacts, and we may want to tweak
# prepare-artifacts in case it fails due to a bug in the future. ...It's also nice to have the
# properties listed in this comment even if we don't use them here, because it's hard to figure
# them out from the docs alone--it'll be a nice reference.
downloadBuildConfig:
buildType: current

stages:
- stage: PrepareArtifacts
dependsOn:
- ${{ each gather in parameters.gatherJobs }}:
- ${{ gather.job }}
jobs:
- job: PrepareArtifacts
pool:
vmImage: 'ubuntu-18.04'
timeoutInMinutes: 300
workspace:
clean: all
variables:
artifactStageDir: '$(Build.SourcesDirectory)/artifacts/stage'
nonportableSourceBuiltStageDir: '$(artifactStageDir)/nonportableSourceBuilt'
portableSourceBuiltStageDir: '$(artifactStageDir)/portableSourceBuilt'
allSourceBuiltStageDir: '$(artifactStageDir)/allSourceBuilt'
outputTarballFile: '$(artifactStageDir)/Private.SourceBuilt.Artifacts.$(Build.BuildId).tar.gz'
steps:
- ${{ each gather in parameters.gatherJobs }}:
- task: DownloadBuildArtifacts@0
displayName: 'Download ${{ gather.job }} nonportable'
inputs:
${{ insert }}: ${{ parameters.downloadBuildConfig }}
downloadType: single
artifactName: ${{ coalesce(gather.artifactName, format('Tarball {0}', gather.job)) }}
downloadPath: $(nonportableSourceBuiltStageDir)
allowPartiallySucceededBuilds: true

- task: DownloadBuildArtifacts@0
displayName: 'Download ${{ parameters.gatherPortableJob }} portable'
inputs:
${{ insert }}: ${{ parameters.downloadBuildConfig }}
downloadType: single
artifactName: 'Tarball ${{ parameters.gatherPortableJob }}'
downloadPath: $(portableSourceBuiltStageDir)
allowPartiallySucceededBuilds: true

- script: |
find "$(artifactStageDir)" -type f -exec du -h {} \;
displayName: Show downloaded artifacts

- script: |
set -xeuo pipefail
mkdir -p "$(allSourceBuiltStageDir)"

# Extract all source-built assets into a single place. Overlap and overwrites are expected.
# What matters is the portable ones are copied last and ultimately win.
find \
"$(nonportableSourceBuiltStageDir)" \
"$(portableSourceBuiltStageDir)" \
-iname 'Private.SourceBuilt.Artifacts.*.tar.gz' \
-exec tar -xf {} -C "$(allSourceBuiltStageDir)" \;

# Intentionally don't create a top-level directory. Matches earlier versions of this artifact.
cd "$(allSourceBuiltStageDir)"
tar --numeric-owner -czf "$(outputTarballFile)" *
displayName: Create source-built artifacts tar.gz

- publish: '$(outputTarballFile)'
artifact: Private.SourceBuilt.Artifacts

- script: |
tar -tf "$(outputTarballFile)" | sort
displayName: Show tarball contents
18 changes: 18 additions & 0 deletions .vsts.pipelines/stages/stage-jobs-matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
parameters:
name: ''
dependsOn: []
matrix:
Production: {}
jobParameters: {}

stages:
- ${{ each matrixPair in parameters.matrix }}:
- stage: ${{ parameters.name }}_${{ replace(coalesce(matrixPair.value.type, 'Production'), ' ', '_') }}
dependsOn: ${{ parameters.dependsOn }}
jobs:
- template: ${{ parameters.jobTemplateName }}
parameters:
${{ insert }}: ${{ parameters.jobParameters }}
job: ${{ parameters.name }}_${{ replace(coalesce(matrixPair.value.type, 'Production'), ' ', '_') }}
buildTypeName: ${{ matrixPair.key }}
type: ${{ matrixPair.value.type }}