75 lines
No EOL
3.4 KiB
YAML
75 lines
No EOL
3.4 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.SourceBranch)
|
|
|
|
- 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 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
|
|
- ${{ if and( eq(variables['System.TeamProject'], 'internal'), startswith(variables['Build.SourceBranch'], 'refs/heads/internal/release/')) }}:
|
|
- group: DotNetBot-AzDO-PAT
|
|
- name: vmrPublicUrl
|
|
value: https://github.com/dotnet/dotnet
|
|
- name: vmrPrivateUrl
|
|
value: https://dnceng@dev.azure.com/dnceng/internal/_git/dotnet-dotnet
|
|
|
|
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 }}
|
|
isBuiltFromVmr: false
|
|
|
|
- template: ../steps/vmr-pull-updates.yml
|
|
parameters:
|
|
vmrPath: $(vmrPath)
|
|
vmrBranch: ${{ parameters.vmrBranch }}
|
|
targetRef: ${{ parameters.targetRef }}
|
|
|
|
# For official builds, push the changes to the VMR
|
|
# Push main and release branches to the public VMR
|
|
- ${{ if and(not(parameters.noPush), not(in(variables['Build.Reason'], 'PullRequest')), eq(variables['System.TeamProject'], 'internal')) }}:
|
|
- script: |
|
|
set -x
|
|
./.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)
|
|
workingDirectory: $(vmrPath)/src/installer
|
|
condition: and(succeeded(), or(eq(variables['vmrBranch'], 'main'), startsWith(variables['vmrBranch'], 'release/')))
|
|
|
|
# Push internal/release branches to the internal VMR
|
|
- ${{ if and(not(parameters.noPush), not(in(variables['Build.Reason'], 'PullRequest')), eq(variables['System.TeamProject'], 'internal')) }}:
|
|
- script: |
|
|
set -x
|
|
./.dotnet/dotnet darc vmr push --vmr "$(vmrPath)" --skip-commit-verification --branch '${{ parameters.vmrBranch }}' --remote-url '$(vmrPrivateUrl)' --azdev-pat '$(dn-bot-dnceng-build-rw-code-rw)' --verbose
|
|
displayName: Push changes to dotnet-dotnet (internal)
|
|
workingDirectory: $(vmrPath)/src/installer
|
|
condition: and(succeeded(), startsWith(variables['vmrBranch'], 'internal/release/')) |