# 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 timeoutInMinutes: 180 variables: _TarballDir: $(Build.StagingDirectory)/tarball _BuildConfig: Release _BuildArch: x64 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)" eval rm -f "$tarballFilePath" 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 - ${{ 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 - template: /src/SourceBuild/Arcade/eng/common/templates/steps/source-build-publish-logs.yml parameters: sourceFolder: $(_TarballDir)