File tree Expand file tree Collapse file tree 2 files changed +86
-68
lines changed Expand file tree Collapse file tree 2 files changed +86
-68
lines changed Original file line number Diff line number Diff line change 1
- # Variable 'BaseBranch' was defined in the Variables tab
2
- # Variable 'ServiceName' was defined in the Variables tab
3
- # Multi-job configuration must be converted to matrix strategy: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&tabs=yaml#multi-job-configuration
4
1
resources :
5
2
repositories :
6
3
- repository : self
7
4
type : git
8
5
ref : main
9
6
10
- pr :
7
+ trigger :
11
8
branches :
12
9
include :
13
10
- main
14
11
paths :
15
12
include :
16
- - .azure-pipeline
13
+ - .azure-pipelines
17
14
- tools
18
15
- src/lib
16
+
17
+ variables :
18
+ GenerationBranchName : generation
19
+ AzureStackBranchName : Azs-tzl
19
20
20
21
jobs :
21
- - job : Job_1
22
- displayName : ' Service: '
23
- timeoutInMinutes : 90
24
- pool :
25
- name : Hosted VS2017
26
- steps :
27
- - checkout : self
28
- - task : PowerShell@2
29
- displayName : Config git
30
- inputs :
31
- targetType : inline
32
- script : >-
33
- git config --global user.email "[email protected] "
34
-
35
- git config --global user.name "azurepowershell"
36
-
37
- git checkout generation
38
- pwsh : true
39
- - task : PowerShell@2
40
- displayName : Sync .azure-pipeline folder from main to generation
41
- inputs :
42
- targetType : inline
43
- script : >-
44
- #cp .azure-pipeline .azure-pipeline-tmp -r
45
-
46
- rm .azure-pipeline -r
47
-
48
- mv .azure-pipeline-tmp .azure-pipeline
49
-
50
- git add .azure-pipeline
51
- pwsh : true
52
- - task : PowerShell@2
53
- displayName : Sync src/lib folder from main to generation
54
- inputs :
55
- targetType : inline
56
- script : >-
57
- #cp src/lib src/lib-tmp -r
58
-
59
- rm src/lib -r
60
-
61
- mv src/lib-tmp src/lib
22
+ - job : Sync
23
+ displayName : Sync task
24
+ condition : succeeded()
25
+ strategy :
26
+ matrix :
27
+ Generation :
28
+ BranchName : ${{ variables.GenerationBranchName }}
29
+ AzureStack :
30
+ BranchName : ${{ variables.AzureStackBranchName }}
62
31
63
- git add src/lib
64
- pwsh : true
65
- - task : PowerShell@2
66
- displayName : Sync tools folder from main to generation
67
- inputs :
68
- targetType : inline
69
- script : >-
70
- #cp tools tools-tmp -r
71
-
72
- rm tools -r
73
-
74
- mv tools-tmp tools
75
-
76
- git add tools
77
-
78
- git commit -m "Sync tools folder from main branch to generation branch"
79
-
80
- git remote set-url origin https://$env:[email protected] /Azure/azure-powershell.git
81
-
82
- git push origin syncToolsFolder --force
83
- pwsh : true
84
- ...
32
+ steps :
33
+ - template : util/sync-tools-folder-template.yml
34
+ parameters :
35
+ BranchName : $(BranchName)
Original file line number Diff line number Diff line change
1
+ parameters :
2
+ BranchName : ' '
3
+
4
+ steps :
5
+ - checkout : self
6
+ - task : PowerShell@2
7
+ displayName : Save folders need to be sync
8
+ inputs :
9
+ targetType : inline
10
+ script : >-
11
+ cp .azure-pipelines .azure-pipelines-tmp -r
12
+
13
+ cp src/lib src/lib-tmp -r
14
+
15
+ cp tools tools-tmp -r
16
+ pwsh : true
17
+ - task : PowerShell@2
18
+ displayName : Config git
19
+ inputs :
20
+ targetType : inline
21
+ script : >-
22
+ git config --global user.email "[email protected] "
23
+
24
+ git config --global user.name "azurepowershell"
25
+
26
+ git checkout -b syncToolsFolder-${{ parameters.BranchName }} origin/${{ parameters.BranchName }}
27
+ pwsh : true
28
+ - task : PowerShell@2
29
+ displayName : Sync .azure-pipelines folder from main to ${{ parameters.BranchName }}
30
+ inputs :
31
+ targetType : inline
32
+ script : >-
33
+ rm .azure-pipelines -r
34
+
35
+ mv .azure-pipelines-tmp .azure-pipelines
36
+
37
+ git add .azure-pipelines
38
+ pwsh : true
39
+ - task : PowerShell@2
40
+ displayName : Sync src/lib folder from main to ${{ parameters.BranchName }}
41
+ inputs :
42
+ targetType : inline
43
+ script : >-
44
+ rm src/lib -r
45
+
46
+ mv src/lib-tmp src/lib
47
+
48
+ git add src/lib
49
+ pwsh : true
50
+ - task : PowerShell@2
51
+ displayName : Sync tools folder from main to ${{ parameters.BranchName }}
52
+ inputs :
53
+ targetType : inline
54
+ script : >-
55
+ rm tools -r
56
+
57
+ mv tools-tmp tools
58
+
59
+ git add tools
60
+
61
+ git commit -m "Sync tools folder from main branch to ${{ parameters.BranchName }} branch"
62
+
63
+ git remote set-url origin https://$env:[email protected] /Azure/azure-powershell.git
64
+
65
+ git push origin syncToolsFolder-${{ parameters.BranchName }} --force
66
+ pwsh : true
67
+
You can’t perform that action at this time.
0 commit comments