|
|
@@ -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"
|