Skip to content

[VMR] Add support for join point vertical job in vmr-build.yml #43288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Sep 13, 2024
46 changes: 28 additions & 18 deletions eng/pipelines/templates/jobs/vmr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ parameters:
type: boolean
default: false

# Name of a previous job (from the same template as this) whose output will be used to build this job
# Name of previous job(s) (from the same template as this) whose output will be used to build this job
# The SDK from its artifacts is copied to $(sourcesPath)/.dotnet
- name: reuseBuildArtifactsFrom
type: string
type: object
default: ''

# Allow downloading artifacts from the internet during the build
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
# Always attempt to run the bootstrap leg (e.g. even when stage 1 tests fail) in order to get a complete accessment of the build status.
# The build shortcuts when stage 1 build fails and doesn't produce the SDK.
condition: succeededOrFailed()
dependsOn: ${{ parameters.reuseBuildArtifactsFrom }}_${{ parameters.architecture }}
dependsOn: ${{ parameters.reuseBuildArtifactsFrom }}
variables:
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
- group: AzureDevOps-Artifact-Feeds-Pats
Expand Down Expand Up @@ -205,20 +205,30 @@ jobs:
displayName: Export VMR sources
workingDirectory: $(Build.StagingDirectory)

- ${{ if ne(parameters.reuseBuildArtifactsFrom, '') }}:
- download: current
artifact: ${{ parameters.reuseBuildArtifactsFrom }}_${{ parameters.architecture }}_Artifacts
patterns: |
**/Private.SourceBuilt.Artifacts.*.tar.gz
**/dotnet-sdk-*.tar.gz
displayName: Download Previous Build

- task: CopyFiles@2
displayName: Copy Previous Build
inputs:
SourceFolder: $(Pipeline.Workspace)/${{ parameters.reuseBuildArtifactsFrom }}_${{ parameters.architecture }}_Artifacts/assets/Release
Contents: '*.tar.gz'
TargetFolder: $(sourcesPath)/prereqs/packages/archive/
- ${{ if ne(parameters.reuseBuildArtifactsFrom,'') }}:
- ${{ each reuseBuildArtifacts in parameters.reuseBuildArtifactsFrom }}:
- download: current
artifact: ${{ reuseBuildArtifacts }}_Artifacts
patterns: |
**/Private.SourceBuilt.Artifacts.*.tar.gz
**/dotnet-sdk-*.tar.gz
**/*.nupkg
displayName: Download Previous Build (${{ reuseBuildArtifacts }})

- task: CopyFiles@2
displayName: Copy Previous Build (${{ reuseBuildArtifacts }} - Source Build artifacts)
inputs:
SourceFolder: $(Pipeline.Workspace)/${{ reuseBuildArtifacts }}_Artifacts/assets/Release
Contents: '*.tar.gz'
TargetFolder: $(sourcesPath)/prereqs/packages/archive/

- task: CopyFiles@2
displayName: Copy Previous Build (${{ reuseBuildArtifacts }} - NuGet Packages)
inputs:
SourceFolder: $(Pipeline.Workspace)/${{ reuseBuildArtifacts }}_Artifacts/packages
Contents: '**/*.nupkg'
OverWrite: false
TargetFolder: $(sourcesPath)/artifacts/packages/

- ${{ if eq(parameters.withPreviousSDK, 'true') }}:
- script: |
Expand Down Expand Up @@ -293,7 +303,7 @@ jobs:
# downloading portable versions from the internet.
customPrepArgs="${customPrepArgs} --no-sdk --no-bootstrap"
prepSdk=false
elif [[ -n '${{ parameters.reuseBuildArtifactsFrom }}' ]]; then
elif [[ '${{ length(parameters.reuseBuildArtifactsFrom) }}' -gt '0' ]]; then
customPrepArgs="${customPrepArgs} --no-sdk --no-artifacts"
prepSdk=false
fi
Expand Down
9 changes: 6 additions & 3 deletions eng/pipelines/templates/stages/vmr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ stages:
runOnline: true # ✅
useMonoRuntime: false # 🚫
withPreviousSDK: false # 🚫
reuseBuildArtifactsFrom: ${{ format('{0}_Online_MsftSdk', variables.centOSStreamName) }}
reuseBuildArtifactsFrom:
- ${{ format('{0}_Online_MsftSdk_x64', variables.centOSStreamName) }}

- template: ../jobs/vmr-build.yml
parameters:
Expand Down Expand Up @@ -318,7 +319,8 @@ stages:
runOnline: false # 🚫
useMonoRuntime: false # 🚫
withPreviousSDK: false # 🚫
reuseBuildArtifactsFrom: ${{ format('{0}_Offline_MsftSdk', variables.fedoraName) }}
reuseBuildArtifactsFrom:
- ${{ format('{0}_Offline_MsftSdk_x64', variables.fedoraName) }}

- template: ../jobs/vmr-build.yml
parameters:
Expand All @@ -336,7 +338,8 @@ stages:
runOnline: false # 🚫
useMonoRuntime: true # ✅
withPreviousSDK: false # 🚫
reuseBuildArtifactsFrom: ${{ format('{0}_Mono_Offline_MsftSdk', variables.centOSStreamName) }}
reuseBuildArtifactsFrom:
- ${{ format('{0}_Mono_Offline_MsftSdk_x64', variables.centOSStreamName) }}

#### VERTICAL BUILD ####
- ${{ if not(parameters.isSourceOnlyBuild) }}:
Expand Down