|
1 |
| -resources: |
2 |
| - repositories: |
3 |
| - - repository: self |
4 |
| - type: git |
5 |
| - ref: main |
| 1 | +parameters: |
| 2 | +- name: ToBranches |
| 3 | + displayName: To Branches |
| 4 | + type: object |
| 5 | + default: ["generation"] |
| 6 | +- name: SyncPaths |
| 7 | + displayName: Paths to sync |
| 8 | + type: object |
| 9 | + default: |
| 10 | + - .ci-config.json |
| 11 | + - tools |
| 12 | + - .azure-pipelines |
| 13 | + - src/lib |
| 14 | + - src/shared |
| 15 | + - build.proj |
| 16 | + - src/Az.props |
| 17 | + - src/Az.Shared.props |
| 18 | + - src/Az.Test.props |
| 19 | + - src/Az.autorest.props |
| 20 | + - src/Az.Post.props |
| 21 | + - src/psm1.props |
| 22 | + - NuGet.Config |
6 | 23 |
|
7 | 24 | trigger:
|
8 | 25 | branches:
|
9 | 26 | include:
|
10 | 27 | - main
|
11 | 28 | paths:
|
12 | 29 | include:
|
13 |
| - - .azure-pipelines |
14 |
| - - .devcontainer |
15 |
| - - tools |
16 |
| - - src/lib |
17 |
| - - .ci-config.json |
18 |
| - - src/shared |
19 |
| - - build.proj |
20 |
| - - src/Az.props |
21 |
| - - src/Az.Shared.props |
22 |
| - - src/Az.Test.props |
23 |
| - - src/Az.autorest.props |
24 |
| - - src/Az.Post.props |
25 |
| - - src/psm1.props |
26 |
| - - NuGet.Config |
| 30 | + - .ci-config.json |
| 31 | + - tools |
| 32 | + - .azure-pipelines |
| 33 | + - src/lib |
| 34 | + - src/shared |
| 35 | + - build.proj |
| 36 | + - src/Az.props |
| 37 | + - src/Az.Shared.props |
| 38 | + - src/Az.Test.props |
| 39 | + - src/Az.autorest.props |
| 40 | + - src/Az.Post.props |
| 41 | + - src/psm1.props |
| 42 | + - NuGet.Config |
27 | 43 |
|
28 |
| -variables: |
29 |
| - GenerationBranchName: generation |
30 |
| - |
31 | 44 | jobs:
|
32 |
| -- job: Sync |
33 |
| - displayName: Sync task |
34 |
| - condition: succeeded() |
35 |
| - strategy: |
36 |
| - matrix: |
37 |
| - Generation: |
38 |
| - BranchName: ${{ variables.GenerationBranchName }} |
| 45 | +- ${{ each ToBranch in parameters.ToBranches }}: |
| 46 | + - job: Sync_${{ replace(ToBranch, '/', '_') }} |
| 47 | + displayName: "Sync To ${{ ToBranch }}" |
| 48 | + pool: pool-ubuntu-2004 |
39 | 49 |
|
40 |
| - steps: |
41 |
| - - template: util/get-github-pat-steps.yml |
42 |
| - - task: PowerShell@2 |
43 |
| - displayName: Sync branch |
44 |
| - inputs: |
45 |
| - targetType: inline |
46 |
| - script: >- |
47 |
| - ./tools/SyncFromMainBranch.ps1 -BranchName $(BranchName) -GithubToken $(GithubToken) |
48 |
| - pwsh: true |
| 50 | + steps: |
| 51 | + - template: util/get-github-pat-steps.yml |
49 | 52 |
|
50 |
| - - pwsh: | |
51 |
| - $Title = "Sync tools code from main branch to $(BranchName) branch" |
52 |
| - $HeadBranch = "syncToolsFolder-$(BranchName)" |
53 |
| - $BaseBranch = "$(BranchName)" |
54 |
| - $Description = "Migrate Sync tools code from main branch to $(BranchName) branch" |
55 |
| - ./tools/Github/CreatePR.ps1 -Title $Title -HeadBranch $HeadBranch -BaseBranch $BaseBranch -BotAccessToken $(GithubToken) -Description $Description |
56 |
| - displayName: Create PR to $(BranchName) branch |
| 53 | + - task: PowerShell@2 |
| 54 | + displayName: "Sync To ${{ ToBranch }}" |
| 55 | + inputs: |
| 56 | + targetType: inline |
| 57 | + script: | |
| 58 | + $SyncPaths='${{Converttojson(parameters.SyncPaths)}}' | ConvertFrom-Json |
| 59 | + ./tools/SyncFromMainBranch.ps1 -BranchName ${{ ToBranch }} -GithubToken $(GithubToken) -SyncPath $SyncPaths -UnSyncPath @() |
| 60 | + pwsh: true |
| 61 | + |
| 62 | + - pwsh: | |
| 63 | + $Title = "Sync tools code from $(Build.SourceBranchName) branch to ${{ ToBranch }} branch" |
| 64 | + $HeadBranch = "syncToolsFolder/${{ ToBranch }}" |
| 65 | + $BaseBranch = "${{ ToBranch }}" |
| 66 | + $Description = "Migrate Sync tools code from $(Build.SourceBranchName) branch to ${{ ToBranch }} branch" |
| 67 | + ./tools/Github/CreatePR.ps1 -Title $Title -HeadBranch $HeadBranch -BaseBranch $BaseBranch -BotAccessToken $(GithubToken) -Description $Description |
| 68 | + displayName: Create PR to ${{ ToBranch }} branch |
0 commit comments