|
| 1 | +### This job synchronizes code from product repositories into the VMR (https://github.com/dotnet/dotnet) |
| 2 | +### It synchronizes the content of the VMR to this new commit and pushes the changes |
| 3 | + |
| 4 | +parameters: |
| 5 | +- name: targetRef |
| 6 | + displayName: Target revision of dotnet/installer to synchronize |
| 7 | + type: string |
| 8 | + default: $(Build.SourceVersion) |
| 9 | + |
| 10 | +- name: vmrBranch |
| 11 | + displayName: dotnet/dotnet branch to use |
| 12 | + type: string |
| 13 | + default: $(Build.SourceBranch) |
| 14 | + |
| 15 | +- name: noPush |
| 16 | + displayName: Don't push changes to dotnet/dotnet |
| 17 | + type: boolean |
| 18 | + default: false |
| 19 | + |
| 20 | +jobs: |
| 21 | +- job: Synchronize_VMR |
| 22 | + displayName: Synchronize VMR's ${{ parameters.vmrBranch }} |
| 23 | + timeoutInMinutes: 120 |
| 24 | + variables: |
| 25 | + - ${{ if eq(variables['System.TeamProject'], 'public') }}: |
| 26 | + - template: /eng/common/templates/variables/pool-providers.yml |
| 27 | + - ${{ else }}: |
| 28 | + - template: /eng/common/templates-official/variables/pool-providers.yml |
| 29 | + - name: vmrPath |
| 30 | + value: $(Agent.BuildDirectory)/vmr |
| 31 | + - ${{ if not(parameters.noPush) }}: |
| 32 | + - ${{ if and( eq(variables['System.TeamProject'], 'internal'), or(startswith(variables['Build.SourceBranch'], 'refs/heads/release/'), eq(variables['Build.SourceBranch'], 'refs/heads/main'))) }}: |
| 33 | + - group: DotNetBot-GitHub |
| 34 | + - group: DotNetBot-GitHub-No-Scopes |
| 35 | + - name: vmrPublicUrl |
| 36 | + value: https://github.com/dotnet/dotnet |
| 37 | + - ${{ if and( eq(variables['System.TeamProject'], 'internal'), startswith(variables['Build.SourceBranch'], 'refs/heads/internal/release/')) }}: |
| 38 | + # https://dev.azure.com/dnceng/internal/_library?itemType=VariableGroups&view=VariableGroupView&variableGroupId=172&path=DotNetBot-AzDO-PAT |
| 39 | + - group: DotNetBot-AzDO-PAT |
| 40 | + - name: vmrInternalUrl |
| 41 | + value: https://[email protected]/dnceng/internal/_git/dotnet-dotnet |
| 42 | + |
| 43 | + pool: |
| 44 | + ${{ if eq(variables['System.TeamProject'], 'public') }}: |
| 45 | + name: $(DncEngPublicBuildPool) |
| 46 | + image: 1es-ubuntu-2004-open |
| 47 | + os: linux |
| 48 | + ${{ else }}: |
| 49 | + name: $(DncEngInternalBuildPool) |
| 50 | + demands: ImageOverride -equals 1es-ubuntu-2004 |
| 51 | + os: linux |
| 52 | + |
| 53 | + steps: |
| 54 | + - template: ../steps/vmr-prepare.yml |
| 55 | + parameters: |
| 56 | + vmrBranch: ${{ parameters.vmrBranch }} |
| 57 | + |
| 58 | + - template: ../steps/vmr-pull-updates.yml |
| 59 | + parameters: |
| 60 | + vmrPath: $(vmrPath) |
| 61 | + vmrBranch: ${{ parameters.vmrBranch }} |
| 62 | + targetRef: ${{ parameters.targetRef }} |
| 63 | + |
| 64 | + - ${{ if and(not(parameters.noPush), not(in(variables['Build.Reason'], 'PullRequest')), eq(variables['System.TeamProject'], 'internal')) }}: |
| 65 | + # Push main and release branches to the public VMR |
| 66 | + - ${{ if or(eq(parameters.vmrBranch, 'main'), startsWith(parameters.vmrBranch, 'release/')) }}: |
| 67 | + - script: > |
| 68 | + ./.dotnet/dotnet darc vmr push |
| 69 | + --vmr '$(vmrPath)' |
| 70 | + --commit-verification-pat '$(BotAccount-dotnet-maestro-bot-no-scopes-PAT)' |
| 71 | + --branch '${{ parameters.vmrBranch }}' |
| 72 | + --remote-url '$(vmrPublicUrl)' |
| 73 | + --github-pat '$(BotAccount-dotnet-bot-repo-PAT)' |
| 74 | + --verbose |
| 75 | + displayName: Push changes to dotnet/dotnet (public) |
| 76 | + workingDirectory: $(Agent.BuildDirectory)/installer |
| 77 | + |
| 78 | + # Push internal/release branches to the internal VMR |
| 79 | + - ${{ if startsWith(parameters.vmrBranch, 'internal/release/') }}: |
| 80 | + - script: > |
| 81 | + ./.dotnet/dotnet darc vmr push |
| 82 | + --vmr '$(vmrPath)' |
| 83 | + --skip-commit-verification |
| 84 | + --branch '${{ parameters.vmrBranch }}' |
| 85 | + --remote-url '$(vmrInternalUrl)' |
| 86 | + --azdev-pat '$(dn-bot-dnceng-build-rw-code-rw)' |
| 87 | + --verbose |
| 88 | + displayName: Push changes to dotnet-dotnet (internal) |
| 89 | + workingDirectory: $(Agent.BuildDirectory)/installer |
0 commit comments