2021-08-06 17:50:48 +00:00
|
|
|
# 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
|
|
|
|
# -----------------------------------------------------------------------------------------------
|
2021-12-14 22:29:29 +00:00
|
|
|
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
|
2021-12-14 22:29:29 +00:00
|
|
|
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
|
2021-12-06 22:37:28 +00:00
|
|
|
demands: ImageOverride -equals Build.Ubuntu.1804.Amd64
|
2021-11-17 22:07:20 +00:00
|
|
|
poolPublic:
|
|
|
|
name: NetCore1ESPool-Svc-Public
|
2021-12-06 22:37:28 +00:00
|
|
|
demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open
|
2021-11-17 22:07:20 +00:00
|
|
|
tarballDir: $(Build.StagingDirectory)/tarball
|
|
|
|
|
2021-08-06 17:50:48 +00:00
|
|
|
jobs:
|
2021-11-17 22:07:20 +00:00
|
|
|
- job: Build_Tarball
|
2021-08-06 17:50:48 +00:00
|
|
|
condition: ${{ parameters.condition }}
|
2021-11-17 22:07:20 +00:00
|
|
|
displayName: Build Tarball
|
2021-08-06 17:50:48 +00:00
|
|
|
dependsOn: ${{ parameters.dependsOn }}
|
|
|
|
pool:
|
2021-09-01 04:20:55 +00:00
|
|
|
${{ if eq(variables['System.TeamProject'], 'public') }}:
|
2021-11-17 22:07:20 +00:00
|
|
|
${{ parameters.poolPublic }}
|
2021-09-01 04:20:55 +00:00
|
|
|
${{ if eq(variables['System.TeamProject'], 'internal') }}:
|
2021-11-17 22:07:20 +00:00
|
|
|
${{ parameters.poolInternal }}
|
2021-08-06 17:50:48 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-12-14 22:29:29 +00:00
|
|
|
CentOS7-Online:
|
|
|
|
_BootstrapPrep: true
|
2021-11-17 22:07:20 +00:00
|
|
|
_BuildArch: x64
|
2021-12-14 22:29:29 +00:00
|
|
|
_Container: ${{ parameters.centOS7Container }}
|
2021-11-17 22:07:20 +00:00
|
|
|
_RunOnline: true
|
2021-12-14 22:29:29 +00:00
|
|
|
CentOS7-Offline:
|
|
|
|
_BootstrapPrep: true
|
2021-11-17 22:07:20 +00:00
|
|
|
_BuildArch: x64
|
2021-12-14 22:29:29 +00:00
|
|
|
_Container: ${{ parameters.centOS7Container }}
|
2021-11-17 22:07:20 +00:00
|
|
|
_RunOnline: false
|
2021-12-14 22:29:29 +00:00
|
|
|
${{ 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
|
2021-08-06 17:50:48 +00:00
|
|
|
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
|
2021-08-06 17:50:48 +00:00
|
|
|
parameters:
|
2021-11-17 22:07:20 +00:00
|
|
|
buildArch: $(_BuildArch)
|
|
|
|
container: $(_Container)
|
|
|
|
prepScript: |
|
|
|
|
set -x
|
|
|
|
|
2021-12-14 22:29:29 +00:00
|
|
|
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 }}
|