use push command
This commit is contained in:
parent
439d38946c
commit
2f34945ee1
1 changed files with 17 additions and 13 deletions
|
@ -25,12 +25,12 @@ jobs:
|
||||||
- template: /eng/common/templates/variables/pool-providers.yml
|
- template: /eng/common/templates/variables/pool-providers.yml
|
||||||
- name: vmrPath
|
- name: vmrPath
|
||||||
value: $(Agent.BuildDirectory)/vmr
|
value: $(Agent.BuildDirectory)/vmr
|
||||||
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
|
- ${{ 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
|
||||||
- ${{ else }}:
|
- group: DotNetBot-GitHub-No-Scopes
|
||||||
- name: BotAccount-dotnet-bot-repo-PAT
|
- ${{ if and( eq(variables['System.TeamProject'], 'internal'), or(startswith(variables['Build.SourceBranch'], 'refs/heads/internal/release/'), startswith(variables['Build.SourceBranch'], 'refs/heads/dev/'))) }}:
|
||||||
value: N/A
|
- group: DotNetBot-AzDO-PAT
|
||||||
|
|
||||||
pool:
|
pool:
|
||||||
${{ if eq(variables['System.TeamProject'], 'public') }}:
|
${{ if eq(variables['System.TeamProject'], 'public') }}:
|
||||||
name: $(DncEngPublicBuildPool)
|
name: $(DncEngPublicBuildPool)
|
||||||
|
@ -52,16 +52,20 @@ jobs:
|
||||||
targetRef: ${{ parameters.targetRef }}
|
targetRef: ${{ parameters.targetRef }}
|
||||||
|
|
||||||
# For official builds, push the changes to the VMR
|
# For official builds, push the changes to the VMR
|
||||||
# Push only main and release branches
|
# 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')) }}:
|
- ${{ if and(not(parameters.noPush), not(in(variables['Build.Reason'], 'PullRequest')), eq(variables['System.TeamProject'], 'internal')) }}:
|
||||||
- script: |
|
- script: |
|
||||||
set -x
|
set -x
|
||||||
git config --global user.email 'dotnet-maestro[bot]@users.noreply.github.com' && git config --global user.name 'dotnet-maestro[bot]'
|
./.dotnet/dotnet darc vmr push --vmr $(vmrPath) --commit-verification-pat $(BotAccount-dotnet-maestro-bot-no-scopes-PAT) --branch ${{ parameters.vmrBranch }} --remote-url https://github.com/dotnet/dotnet.git --github-pat $(BotAccount-dotnet-bot-repo-PAT)
|
||||||
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 }}
|
|
||||||
displayName: Push changes to dotnet/dotnet
|
displayName: Push changes to dotnet/dotnet
|
||||||
workingDirectory: $(vmrPath)
|
workingDirectory: $(vmrPath)/src/installer
|
||||||
condition: and(succeeded(), or(eq(variables['vmrBranch'], 'main'), startsWith(variables['vmrBranch'], 'release/')))
|
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 https://dnceng@dev.azure.com/dnceng/internal/_git/dotnet-dotnet --azdev-pat $(dn-bot-dnceng-build-rw-code-rw)
|
||||||
|
displayName: Push changes to dotnet/dotnet
|
||||||
|
workingDirectory: $(vmrPath)/src/installer
|
||||||
|
condition: and(succeeded(), or(startsWith(variables['vmrBranch'], 'internal/release/'), startsWith(variables['vmrBranch'], 'dev/'))
|
Loading…
Add table
Reference in a new issue