dotnet-installer/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml

140 lines
4.9 KiB
YAML
Raw Normal View History

# Builds a source-build tarball
parameters:
# Custom condition to apply to the job
condition: true
# Dependent jobs that must be completed before this job will run
dependsOn:
# The resource id of the tarball to download and build
tarballResourceId: current
2021-11-17 22:07:20 +00:00
# The following parameters aren't expected to be passed in rather they are used for encapsulation
# -----------------------------------------------------------------------------------------------
centOS7Container: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-source-build-20210714125450-5d87b80
centOS8Container: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-8-source-build-20211118190102-9355e7b
debian9Container: mcr.microsoft.com/dotnet-buildtools/prereqs:debian-stretch-20211001171226-047508b
2021-11-17 22:07:20 +00:00
fedora33Container: mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-33-20210222183538-031e7d2
ubuntu1804Container: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-20210924170306-047508b
2021-11-17 22:07:20 +00:00
poolInternal:
name: NetCore1ESPool-Svc-Internal
demands: ImageOverride -equals Build.Ubuntu.1804.Amd64
2021-11-17 22:07:20 +00:00
poolPublic:
name: NetCore1ESPool-Svc-Public
demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open
2021-11-17 22:07:20 +00:00
tarballDir: $(Build.StagingDirectory)/tarball
jobs:
2021-11-17 22:07:20 +00:00
- job: Build_Tarball
condition: ${{ parameters.condition }}
2021-11-17 22:07:20 +00:00
displayName: Build Tarball
dependsOn: ${{ parameters.dependsOn }}
pool:
${{ if eq(variables['System.TeamProject'], 'public') }}:
2021-11-17 22:07:20 +00:00
${{ parameters.poolPublic }}
${{ if eq(variables['System.TeamProject'], 'internal') }}:
2021-11-17 22:07:20 +00:00
${{ parameters.poolInternal }}
strategy:
matrix:
CentOS7-Online:
_BootstrapPrep: true
2021-11-17 22:07:20 +00:00
_BuildArch: x64
_Container: ${{ parameters.centOS7Container }}
2021-11-17 22:07:20 +00:00
_RunOnline: true
CentOS7-Offline:
_BootstrapPrep: true
2021-11-17 22:07:20 +00:00
_BuildArch: x64
_Container: ${{ parameters.centOS7Container }}
2021-11-17 22:07:20 +00:00
_RunOnline: false
${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
CentOS8-Offline:
_BootstrapPrep: true
_BuildArch: x64
_Container: ${{ parameters.centOS8Container }}
_RunOnline: false
Fedora33-Offline:
_BootstrapPrep: false
_BuildArch: x64
_Container: ${{ parameters.fedora33Container }}
_RunOnline: false
Ubuntu1804-Offline:
_BootstrapPrep: true
_BuildArch: x64
_Container: ${{ parameters.ubuntu1804Container }}
_RunOnline: false
timeoutInMinutes: 300
workspace:
clean: all
steps:
- checkout: none
2021-11-17 22:07:20 +00:00
- template: /src/SourceBuild/Arcade/eng/common/templates/steps/source-build-build-tarball.yml
parameters:
2021-11-17 22:07:20 +00:00
buildArch: $(_BuildArch)
container: $(_Container)
prepScript: |
set -x
customPrepArgs=
if [ '$(_BootstrapPrep)' = 'true' ]; then
customPrepArgs='--bootstrap'
fi
docker run --rm -v ${{ parameters.tarballDir }}:/tarball -w /tarball $(_Container) ./prep.sh ${customPrepArgs}
2021-11-17 22:07:20 +00:00
runOnline: $(_RunOnline)
tarballDir: ${{ parameters.tarballDir }}
tarballResourceId: ${{ parameters.tarballResourceId }}
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- job: Rebuild_Tarball
displayName: Rebuild Tarball With Previous
dependsOn: Build_Tarball
pool:
${{ if eq(variables['System.TeamProject'], 'public') }}:
${{ parameters.poolPublic }}
${{ if eq(variables['System.TeamProject'], 'internal') }}:
${{ parameters.poolInternal }}
strategy:
matrix:
Fedora33-Offline:
_PreviousSourceBuildArtifact: Build Tarball Fedora33-Offline_Artifacts
_BuildArch: x64
_Container: ${{ parameters.fedora33Container }}
_RunOnline: false
timeoutInMinutes: 180
workspace:
clean: all
steps:
- checkout: none
- download: current
artifact: $(_PreviousSourceBuildArtifact)
patterns: '*.tar.gz'
displayName: Download Previous Source Build Artifacts
- task: CopyFiles@2
displayName: Copy Previous Source Build Artifacts
inputs:
SourceFolder: $(PIPELINE.WORKSPACE)/$(_PreviousSourceBuildArtifact)
Contents: '*.tar.gz'
TargetFolder: ${{ parameters.tarballDir }}/packages/archive/
- template: /src/SourceBuild/Arcade/eng/common/templates/steps/source-build-build-tarball.yml
parameters:
additionalBuildArgs: --with-sdk /tarball/.dotnet
buildArch: $(_BuildArch)
container: $(_Container)
prepScript: |
set -x
mkdir ${{ parameters.tarballDir }}/.dotnet
tarballFilePath="${{ parameters.tarballDir }}/packages/archive/dotnet-sdk-*.tar.gz"
eval tar -ozxf "$tarballFilePath" -C "${{ parameters.tarballDir }}/.dotnet"
eval rm -f "$tarballFilePath"
runOnline: $(_RunOnline)
tarballDir: ${{ parameters.tarballDir }}
tarballResourceId: ${{ parameters.tarballResourceId }}