2022-12-01 09:51:39 +00:00
|
|
|
### 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
|
2022-11-08 16:47:32 +00:00
|
|
|
|
|
|
|
parameters:
|
|
|
|
- name: targetRef
|
2022-12-01 09:51:39 +00:00
|
|
|
displayName: Target revision of dotnet/installer to synchronize
|
2022-11-08 16:47:32 +00:00
|
|
|
type: string
|
|
|
|
default: $(Build.SourceVersion)
|
|
|
|
|
|
|
|
- name: vmrBranch
|
|
|
|
displayName: dotnet/dotnet branch to use
|
|
|
|
type: string
|
2023-01-31 17:30:25 +00:00
|
|
|
default: $(Build.SourceBranch)
|
2022-11-08 16:47:32 +00:00
|
|
|
|
|
|
|
- name: noPush
|
|
|
|
displayName: Don't push changes to dotnet/dotnet
|
|
|
|
type: boolean
|
|
|
|
default: false
|
|
|
|
|
|
|
|
jobs:
|
2022-12-01 09:51:39 +00:00
|
|
|
- job: Synchronize_VMR
|
2024-03-26 13:18:33 +00:00
|
|
|
displayName: Synchronize VMR's ${{ parameters.vmrBranch }}
|
2022-11-08 16:47:32 +00:00
|
|
|
timeoutInMinutes: 120
|
2022-12-01 09:51:39 +00:00
|
|
|
variables:
|
2024-03-26 13:18:33 +00:00
|
|
|
- ${{ if eq(variables['System.TeamProject'], 'public') }}:
|
|
|
|
- template: /eng/common/templates/variables/pool-providers.yml
|
|
|
|
- ${{ else }}:
|
|
|
|
- template: /eng/common/templates-official/variables/pool-providers.yml
|
2022-12-01 09:51:39 +00:00
|
|
|
- name: vmrPath
|
|
|
|
value: $(Agent.BuildDirectory)/vmr
|
2023-02-27 15:02:25 +00:00
|
|
|
- ${{ if not(parameters.noPush) }}:
|
|
|
|
- ${{ if and( eq(variables['System.TeamProject'], 'internal'), or(startswith(variables['Build.SourceBranch'], 'refs/heads/release/'), eq(variables['Build.SourceBranch'], 'refs/heads/main'))) }}:
|
|
|
|
- group: DotNetBot-GitHub
|
|
|
|
- group: DotNetBot-GitHub-No-Scopes
|
|
|
|
- name: vmrPublicUrl
|
|
|
|
value: https://github.com/dotnet/dotnet
|
|
|
|
- ${{ if and( eq(variables['System.TeamProject'], 'internal'), startswith(variables['Build.SourceBranch'], 'refs/heads/internal/release/')) }}:
|
2024-01-22 14:41:51 +00:00
|
|
|
# https://dev.azure.com/dnceng/internal/_library?itemType=VariableGroups&view=VariableGroupView&variableGroupId=172&path=DotNetBot-AzDO-PAT
|
2023-02-27 15:02:25 +00:00
|
|
|
- group: DotNetBot-AzDO-PAT
|
|
|
|
- name: vmrInternalUrl
|
|
|
|
value: https://dnceng@dev.azure.com/dnceng/internal/_git/dotnet-dotnet
|
2024-03-26 13:18:33 +00:00
|
|
|
|
2022-11-08 16:47:32 +00:00
|
|
|
pool:
|
|
|
|
${{ if eq(variables['System.TeamProject'], 'public') }}:
|
|
|
|
name: $(DncEngPublicBuildPool)
|
2024-03-26 13:18:33 +00:00
|
|
|
image: 1es-ubuntu-2004-open
|
|
|
|
os: linux
|
|
|
|
${{ else }}:
|
2022-11-08 16:47:32 +00:00
|
|
|
name: $(DncEngInternalBuildPool)
|
2024-03-26 13:18:33 +00:00
|
|
|
demands: ImageOverride -equals 1es-ubuntu-2004
|
|
|
|
os: linux
|
2022-11-08 16:47:32 +00:00
|
|
|
|
|
|
|
steps:
|
2022-12-01 09:51:39 +00:00
|
|
|
- template: ../steps/vmr-prepare.yml
|
2022-11-08 16:47:32 +00:00
|
|
|
parameters:
|
|
|
|
vmrBranch: ${{ parameters.vmrBranch }}
|
2024-03-26 14:30:02 +00:00
|
|
|
isBuiltFromVmr: false
|
2022-11-08 16:47:32 +00:00
|
|
|
|
2022-12-01 09:51:39 +00:00
|
|
|
- template: ../steps/vmr-pull-updates.yml
|
2022-11-08 16:47:32 +00:00
|
|
|
parameters:
|
|
|
|
vmrPath: $(vmrPath)
|
|
|
|
vmrBranch: ${{ parameters.vmrBranch }}
|
|
|
|
targetRef: ${{ parameters.targetRef }}
|
|
|
|
|
2023-02-02 14:03:02 +00:00
|
|
|
- ${{ if and(not(parameters.noPush), not(in(variables['Build.Reason'], 'PullRequest')), eq(variables['System.TeamProject'], 'internal')) }}:
|
2023-02-07 14:25:30 +00:00
|
|
|
# Push main and release branches to the public VMR
|
|
|
|
- ${{ if or(eq(parameters.vmrBranch, 'main'), startsWith(parameters.vmrBranch, 'release/')) }}:
|
|
|
|
- script: >
|
|
|
|
./.dotnet/dotnet darc vmr push
|
|
|
|
--vmr '$(vmrPath)'
|
|
|
|
--commit-verification-pat '$(BotAccount-dotnet-maestro-bot-no-scopes-PAT)'
|
|
|
|
--branch '${{ parameters.vmrBranch }}'
|
|
|
|
--remote-url '$(vmrPublicUrl)'
|
|
|
|
--github-pat '$(BotAccount-dotnet-bot-repo-PAT)'
|
|
|
|
--verbose
|
|
|
|
displayName: Push changes to dotnet/dotnet (public)
|
2023-02-07 15:05:01 +00:00
|
|
|
workingDirectory: $(Agent.BuildDirectory)/installer
|
2023-02-07 14:25:30 +00:00
|
|
|
|
|
|
|
# Push internal/release branches to the internal VMR
|
|
|
|
- ${{ if startsWith(parameters.vmrBranch, 'internal/release/') }}:
|
|
|
|
- script: >
|
|
|
|
./.dotnet/dotnet darc vmr push
|
|
|
|
--vmr '$(vmrPath)'
|
|
|
|
--skip-commit-verification
|
|
|
|
--branch '${{ parameters.vmrBranch }}'
|
|
|
|
--remote-url '$(vmrInternalUrl)'
|
|
|
|
--azdev-pat '$(dn-bot-dnceng-build-rw-code-rw)'
|
|
|
|
--verbose
|
|
|
|
displayName: Push changes to dotnet-dotnet (internal)
|
2024-03-26 13:18:33 +00:00
|
|
|
workingDirectory: $(Agent.BuildDirectory)/installer
|