-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Allow explicit manual runs of mirror pipeline #41736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4de825f
Allow explicit manual runs of mirror pipeline
wtgodbe c76ce26
Fixup
wtgodbe 91869b4
Fixup 2
wtgodbe db9e712
Try different approach
wtgodbe c0fe7b5
Update .azure/pipelines/azure-pipelines-mirror-within-azdo.yml
wtgodbe 999368b
Update .azure/pipelines/azure-pipelines-mirror-within-azdo.yml
wtgodbe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,58 +4,65 @@ trigger: | |
branches: | ||
include: | ||
- internal/release/6.0 | ||
|
||
parameters: | ||
# Run the pipeline manually (usually disallowed) | ||
- name: manualRun | ||
default: false | ||
displayName: Are you sure you want to run this pipeline manually? | ||
type: boolean | ||
|
||
variables: | ||
- group: Mirror-Credentials | ||
|
||
# Merges code from one AzDO branch into another | ||
jobs: | ||
- template: /eng/common/templates/jobs/jobs.yml | ||
parameters: | ||
enableTelemetry: true | ||
helixRepo: dotnet/arcade | ||
jobs: | ||
- job: Merge_Azure_DevOps_Branches | ||
enableSBOM: false | ||
condition: and(contains(variables['Build.SourceBranch'], 'internal'), eq(variables['Build.Reason'], 'BatchedCI')) | ||
pool: | ||
name: NetCore1ESPool-Internal | ||
demands: ImageOverride -equals Build.Server.Amd64.VS2019 | ||
variables: | ||
- name: WorkingDirectoryName | ||
value: repo-dir | ||
- name: AzdoRepo | ||
value: dotnet-aspnetcore | ||
- name: TargetBranchName | ||
value: $(Build.SourceBranch)-nonstable | ||
- name: BranchToMirror | ||
value: $(Build.SourceBranch) | ||
steps: | ||
- script: | | ||
git clone https://dn-bot:$(dn-bot-dnceng-build-rw-code-rw)@dev.azure.com/dnceng/internal/_git/$(AzdoRepo) $(WorkingDirectoryName) --recursive --no-tags --branch $(TargetBranchName) | ||
displayName: Clone AzDO repo | ||
- script: | | ||
git -c user.email="[email protected]" -c user.name="dotnet-bot" merge origin/$(BranchToMirror) -m "Merge in '$(BranchToMirror)' changes" | ||
displayName: Merge head branch to target branch | ||
workingDirectory: $(WorkingDirectoryName) | ||
- script: | | ||
git push origin $(TargetBranchName) | ||
displayName: Push changes to Azure DevOps repo | ||
workingDirectory: $(WorkingDirectoryName) | ||
|
||
- task: PowerShell@1 | ||
displayName: Broadcast target, branch, commit in metadata | ||
continueOnError: true | ||
condition: always() | ||
inputs: | ||
scriptType: inlineScript | ||
arguments: '$(BranchToMirror)' | ||
- ${{ if and(contains(variables['Build.SourceBranch'], 'internal'), or(eq(variables['Build.Reason'], 'BatchedCI'), eq(parameters.manualRun, 'true'))) }}: | ||
- template: /eng/common/templates/jobs/jobs.yml | ||
parameters: | ||
enableTelemetry: true | ||
helixRepo: dotnet/aspnetcore | ||
jobs: | ||
- job: Merge_Azure_DevOps_Branches | ||
enableSBOM: false | ||
pool: | ||
name: NetCore1ESPool-Internal | ||
demands: ImageOverride -equals Build.Server.Amd64.VS2019 | ||
variables: | ||
- name: WorkingDirectoryName | ||
value: repo-dir | ||
- name: AzdoRepo | ||
value: dotnet-aspnetcore | ||
- name: TargetBranchName | ||
value: $(Build.SourceBranch)-nonstable | ||
- name: BranchToMirror | ||
value: $(Build.SourceBranch) | ||
steps: | ||
- script: | | ||
git clone https://dn-bot:$(dn-bot-dnceng-build-rw-code-rw)@dev.azure.com/dnceng/internal/_git/$(AzdoRepo) $(WorkingDirectoryName) --recursive --no-tags --branch $(TargetBranchName) | ||
displayName: Clone AzDO repo | ||
- script: | | ||
git -c user.email="[email protected]" -c user.name="dotnet-bot" merge origin/$(BranchToMirror) -m "Merge in '$(BranchToMirror)' changes" | ||
displayName: Merge head branch to target branch | ||
workingDirectory: $(WorkingDirectoryName) | ||
- script: | | ||
git push origin $(TargetBranchName) | ||
displayName: Push changes to Azure DevOps repo | ||
workingDirectory: $(WorkingDirectoryName) | ||
inlineScript: | | ||
param([string]$branch) | ||
|
||
$commit = (git rev-parse HEAD).Substring(0, 7) | ||
$target = "$branch".Replace('/', ' ') | ||
- task: PowerShell@1 | ||
displayName: Broadcast target, branch, commit in metadata | ||
continueOnError: true | ||
condition: always() | ||
inputs: | ||
scriptType: inlineScript | ||
arguments: '$(BranchToMirror)' | ||
workingDirectory: $(WorkingDirectoryName) | ||
inlineScript: | | ||
param([string]$branch) | ||
|
||
$commit = (git rev-parse HEAD).Substring(0, 7) | ||
$target = "$branch".Replace('/', ' ') | ||
|
||
Write-Host "##vso[build.updatebuildnumber]$target $commit" | ||
Write-Host "##vso[build.addbuildtag]$target" | ||
Write-Host "##vso[build.updatebuildnumber]$target $commit" | ||
Write-Host "##vso[build.addbuildtag]$target" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain the point of this confirmation❔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use case of this pipeline is pretty narrow, and given that we're making users explicitly opt-in to running it manually, I think it makes sense to ask for confirmation.