зеркало из https://github.com/microsoft/msquic.git
Automatically Sync Master after Successful CI Build (#138)
This commit is contained in:
Родитель
805fdb7aa2
Коммит
58a76c3e54
|
@ -20,10 +20,19 @@ stages:
|
|||
- template: ./templates/build-windows.yml
|
||||
- template: ./templates/build-linux.yml
|
||||
|
||||
# Mirror
|
||||
|
||||
- stage: mirror
|
||||
displayName: Mirror
|
||||
condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'))
|
||||
jobs:
|
||||
- template: ./templates/sync-mirror.yml
|
||||
|
||||
# Tests
|
||||
|
||||
- stage: test
|
||||
displayName: Test
|
||||
dependsOn: build
|
||||
jobs:
|
||||
|
||||
## Build Verification Tests
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<#
|
||||
|
||||
.SYNOPSIS
|
||||
This synchronizes a branch on the current repository to the mirror repo.
|
||||
|
||||
.EXAMPLE
|
||||
sync-mirror.ps1
|
||||
|
||||
.EXAMPLE
|
||||
sync-mirror.ps1 -Branch release/xxxx
|
||||
|
||||
#>
|
||||
|
||||
param (
|
||||
[Parameter(Mandatory = $false)]
|
||||
[string]$Branch = "master"
|
||||
)
|
||||
|
||||
Set-StrictMode -Version 'Latest'
|
||||
$PSDefaultParameterValues['*:ErrorAction'] = 'Stop'
|
||||
|
||||
# Make sure we're in the correct branch.
|
||||
git checkout $Branch
|
||||
|
||||
# Add the AzDO repo as a remote.
|
||||
git remote add azdo-mirror "https://nibanks:$Env:AzDO_PAT@mscodehub.visualstudio.com/msquic/_git/msquic"
|
||||
|
||||
# Reset branch to origin.
|
||||
git reset --hard origin/$Branch
|
||||
|
||||
# Push to the AzDO repo.
|
||||
git push azdo-mirror $Branch
|
|
@ -0,0 +1,20 @@
|
|||
# This template contains steps to sync the GitHub repo to the AzDO mirror repo.
|
||||
|
||||
parameters:
|
||||
branch: 'master'
|
||||
|
||||
jobs:
|
||||
- job: mirror_${{ parameters.branch }}
|
||||
displayName: Mirror ${{ parameters.branch }} branch
|
||||
pool:
|
||||
vmImage: windows-latest
|
||||
steps:
|
||||
- checkout: self
|
||||
persistCredentials: true
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: Sync Changes to AzDO Mirror Branch
|
||||
inputs:
|
||||
pwsh: true
|
||||
filePath: scripts/sync-mirror.ps1
|
||||
arguments: -Branch ${{ parameters.branch }}
|
Загрузка…
Ссылка в новой задаче