Skip to content
代码片段 群组 项目
未验证 提交 2f4bd9b1 编辑于 作者: William Godbe's avatar William Godbe 提交者: GitHub
浏览文件

Allow explicit manual runs of mirror pipeline (#41736)


* Allow explicit manual runs of mirror pipeline

* Fixup

* Fixup 2

* Try different approach

* Update .azure/pipelines/azure-pipelines-mirror-within-azdo.yml

* Update .azure/pipelines/azure-pipelines-mirror-within-azdo.yml

Co-authored-by: default avatarDoug Bunting <6431421+dougbu@users.noreply.github.com>

Co-authored-by: default avatarDoug Bunting <6431421+dougbu@users.noreply.github.com>
上级 bf50999c
No related branches found
No related tags found
无相关合并请求
...@@ -4,58 +4,65 @@ trigger: ...@@ -4,58 +4,65 @@ trigger:
branches: branches:
include: include:
- internal/release/6.0 - 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: variables:
- group: Mirror-Credentials - group: Mirror-Credentials
# Merges code from one AzDO branch into another # Merges code from one AzDO branch into another
jobs: jobs:
- template: /eng/common/templates/jobs/jobs.yml - ${{ if and(contains(variables['Build.SourceBranch'], 'internal'), or(eq(variables['Build.Reason'], 'BatchedCI'), eq(parameters.manualRun, 'true'))) }}:
parameters: - template: /eng/common/templates/jobs/jobs.yml
enableTelemetry: true parameters:
helixRepo: dotnet/arcade enableTelemetry: true
jobs: helixRepo: dotnet/aspnetcore
- job: Merge_Azure_DevOps_Branches jobs:
enableSBOM: false - job: Merge_Azure_DevOps_Branches
condition: and(contains(variables['Build.SourceBranch'], 'internal'), eq(variables['Build.Reason'], 'BatchedCI')) enableSBOM: false
pool: pool:
name: NetCore1ESPool-Internal name: NetCore1ESPool-Internal
demands: ImageOverride -equals Build.Server.Amd64.VS2019 demands: ImageOverride -equals Build.Server.Amd64.VS2019
variables: variables:
- name: WorkingDirectoryName - name: WorkingDirectoryName
value: repo-dir value: repo-dir
- name: AzdoRepo - name: AzdoRepo
value: dotnet-aspnetcore value: dotnet-aspnetcore
- name: TargetBranchName - name: TargetBranchName
value: $(Build.SourceBranch)-nonstable value: $(Build.SourceBranch)-nonstable
- name: BranchToMirror - name: BranchToMirror
value: $(Build.SourceBranch) value: $(Build.SourceBranch)
steps: steps:
- script: | - 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) 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 displayName: Clone AzDO repo
- script: | - script: |
git -c user.email="dotnet-bot@microsoft.com" -c user.name="dotnet-bot" merge origin/$(BranchToMirror) -m "Merge in '$(BranchToMirror)' changes" git -c user.email="dotnet-bot@microsoft.com" -c user.name="dotnet-bot" merge origin/$(BranchToMirror) -m "Merge in '$(BranchToMirror)' changes"
displayName: Merge head branch to target branch displayName: Merge head branch to target branch
workingDirectory: $(WorkingDirectoryName) workingDirectory: $(WorkingDirectoryName)
- script: | - script: |
git push origin $(TargetBranchName) git push origin $(TargetBranchName)
displayName: Push changes to Azure DevOps repo 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)'
workingDirectory: $(WorkingDirectoryName) workingDirectory: $(WorkingDirectoryName)
inlineScript: |
param([string]$branch)
$commit = (git rev-parse HEAD).Substring(0, 7) - task: PowerShell@1
$target = "$branch".Replace('/', ' ') 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.updatebuildnumber]$target $commit"
Write-Host "##vso[build.addbuildtag]$target" Write-Host "##vso[build.addbuildtag]$target"
\ No newline at end of file
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册