dotnet-installer/eng/pipelines/templates/jobs/vmr-synchronization.yml
Přemek Vysoký 87955496af
Use VMR instead of the tarball for Source-Build builds (#15042)
For PRs, the Source-Build leg that was running inside of the Build stage is now moved to a separate stage but runs more or less the same: https://dev.azure.com/dnceng-public/public/_build/results?buildId=97509&view=results
Instead of creating the tarball, we are building the `dotnet/dotnet` repo there.

For internal rolling builds, we are taking [this pipeline](https://dev.azure.com/dnceng/internal/_build/results?buildId=2056327&view=results) and merging it into `dotnet-installer-official-ci`.
So it's one extra stage that runs pretty quick (faster than the Build stage by far).
It won't be creating and pushing the tarball artifact anymore though.

Once the rolling build is finished, there won't be no more source-build-build pipeline but instead dotnet-dotnet-official-ci which will build the dotnet/dotnet repo again instead of the tarball that was originally produced from the rolling build.
The MSFT SDK from the installer build will still be consumed by it though.

More details https://github.com/dotnet/arcade/issues/10677
2022-12-01 10:51:39 +01:00

73 lines
2.7 KiB
YAML

### This job synchronizes code from product repositories into the VMR (https://github.com/dotnet/dotnet)
### It synchronizes the content of the VMR to this new commit and pushes the changes
parameters:
- name: targetRef
displayName: Target revision of dotnet/installer to synchronize
type: string
default: $(Build.SourceVersion)
- name: vmrBranch
displayName: dotnet/dotnet branch to use
type: string
default: $(Build.SourceBranchName)
- name: noPush
displayName: Don't push changes to dotnet/dotnet
type: boolean
default: false
jobs:
- job: Synchronize_VMR
displayName: Synchronize dotnet/dotnet
timeoutInMinutes: 120
variables:
- template: /eng/common/templates/variables/pool-providers.yml
- name: vmrPath
value: $(Agent.BuildDirectory)/vmr
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
- group: DotNetBot-GitHub
- ${{ else }}:
- name: BotAccount-dotnet-bot-repo-PAT
value: N/A
pool:
${{ if eq(variables['System.TeamProject'], 'public') }}:
name: $(DncEngPublicBuildPool)
demands: ImageOverride -equals Build.Ubuntu.2004.Amd64.Open
${{ if eq(variables['System.TeamProject'], 'internal') }}:
name: $(DncEngInternalBuildPool)
demands: ImageOverride -equals Build.Ubuntu.2004.Amd64
steps:
- template: ../steps/vmr-prepare.yml
parameters:
vmrBranch: ${{ parameters.vmrBranch }}
- template: ../steps/vmr-pull-updates.yml
parameters:
vmrPath: $(vmrPath)
vmrBranch: ${{ parameters.vmrBranch }}
targetRef: ${{ parameters.targetRef }}
# For official builds, push the changes to the VMR
- ${{ if and(not(parameters.noPush), not(in(variables['Build.Reason'], 'PullRequest')), eq(variables['System.TeamProject'], 'internal')) }}:
- script: |
set -x
git config --global user.email 'dotnet-maestro[bot]@users.noreply.github.com' && git config --global user.name 'dotnet-maestro[bot]'
git remote add dotnet 'https://$(BotAccount-dotnet-bot-repo-PAT)@github.com/dotnet/dotnet.git'
git fetch dotnet
git branch ${{ parameters.vmrBranch }}
git branch --set-upstream-to=dotnet/${{ parameters.vmrBranch }} ${{ parameters.vmrBranch }} || echo 'Branch ${{ parameters.vmrBranch }} not found in remote'
git push dotnet ${{ parameters.vmrBranch }}
# Export the SHA as an artifact to be reused by the official VMR build
sha=`git rev-parse HEAD`
mkdir -p "$(Build.ArtifactStagingDirectory)/VmrRevision"
echo $sha > "$(Build.ArtifactStagingDirectory)/VmrRevision/VmrRevision.txt"
displayName: Push changes to dotnet/dotnet
workingDirectory: $(vmrPath)
- publish: $(Build.ArtifactStagingDirectory)/VmrRevision
artifact: VmrRevision
displayName: Publish new SHA