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
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
- job: Source_Build_Run_Tarball_Build
|
|
|
|
condition: ${{ parameters.condition }}
|
|
|
|
displayName: Source-Build Build Tarball
|
|
|
|
dependsOn: ${{ parameters.dependsOn }}
|
|
|
|
pool:
|
|
|
|
vmImage: ubuntu-20.04
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
Fedora33-Online:
|
|
|
|
_runOnline: true
|
|
|
|
_Container: mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-33-20210222183538-031e7d2
|
|
|
|
Fedora33-Offline:
|
|
|
|
_runOnline: false
|
|
|
|
_Container: mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-33-20210222183538-031e7d2
|
2021-08-23 22:05:58 +00:00
|
|
|
timeoutInMinutes: 180
|
2021-08-06 17:50:48 +00:00
|
|
|
variables:
|
|
|
|
_TarballDir: $(Build.StagingDirectory)/tarball
|
2021-08-26 16:30:50 +00:00
|
|
|
_BuildConfig: Release
|
|
|
|
_BuildArch: x64
|
2021-08-06 17:50:48 +00:00
|
|
|
workspace:
|
|
|
|
clean: all
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout: none
|
|
|
|
|
|
|
|
- download: ${{ parameters.tarballResourceId }}
|
|
|
|
artifact: BlobArtifacts
|
|
|
|
patterns: '**/dotnet-sdk-source*.tar.gz'
|
|
|
|
displayName: Download Tarball
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -x
|
|
|
|
|
|
|
|
resourceIdPathSegment=
|
|
|
|
if [ '${{ parameters.tarballResourceId }}' != 'current' ]; then
|
|
|
|
resourceIdPathSegment='${{ parameters.tarballResourceId }}/'
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p "$(_TarballDir)"
|
|
|
|
tarballFilePath="$(PIPELINE.WORKSPACE)/${resourceIdPathSegment}BlobArtifacts/dotnet-sdk-source*.tar.gz"
|
|
|
|
eval tar -ozxf "$tarballFilePath" -C "$(_TarballDir)"
|
2021-08-24 15:33:44 +00:00
|
|
|
eval rm -f "$tarballFilePath"
|
2021-08-06 17:50:48 +00:00
|
|
|
displayName: Extract Tarball
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -x
|
|
|
|
|
|
|
|
docker run --rm -v $(_TarballDir):/tarball -w /tarball $(_Container) ./prep.sh
|
|
|
|
displayName: Prep Tarball
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
set -x
|
|
|
|
df -h
|
|
|
|
|
|
|
|
networkArgs=
|
|
|
|
customBuildArgs=
|
|
|
|
if [ '$(_runOnline)' = 'true' ]; then
|
|
|
|
customBuildArgs='--online'
|
|
|
|
else
|
|
|
|
networkArgs='--network none'
|
|
|
|
fi
|
|
|
|
|
|
|
|
docker run --rm -v $(_TarballDir):/tarball -w /tarball ${networkArgs} $(_Container) ./build.sh ${customBuildArgs} -- /p:CleanWhileBuilding=true
|
|
|
|
displayName: Build Tarball
|
|
|
|
|
2021-08-26 16:30:50 +00:00
|
|
|
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
|
|
|
- publish: '$(_TarballDir)/artifacts/$(_BuildArch)/$(_BuildConfig)/'
|
|
|
|
artifact: $(Agent.JobName)_Artifacts_Attempt$(System.JobAttempt)
|
|
|
|
displayName: Publish Source Build Artifacts
|
2021-08-06 17:50:48 +00:00
|
|
|
|
|
|
|
- template: /src/SourceBuild/Arcade/eng/common/templates/steps/source-build-publish-logs.yml
|
|
|
|
parameters:
|
|
|
|
sourceFolder: $(_TarballDir)
|