1
1
parameters :
2
2
- name : TestChangedModulesOnly
3
- displayName : ' Only run tests on modules that are changed by regeneration'
3
+ type : boolean
4
+ default : true
5
+ # Selected modules to generate, build, analyze and test
6
+ - name : SelectedTargetModules
4
7
type : string
5
- default : ' True'
8
+ default : ' None'
9
+ - name : NotificationReceiversOverride
10
+ type : string
11
+ default : ' None'
12
+ # branch from when creating the generation branch
13
+ - name : GenerationBaseBranch
14
+ type : string
15
+ default : ' main'
16
+ - name : PrepareModulesOnGenerationBranch
17
+ type : boolean
18
+ default : false
6
19
7
20
variables :
8
21
IntermediateStepTimeoutInMinutes : 30
@@ -39,6 +52,22 @@ stages:
39
52
pool : ${{ variables.WindowsAgentPoolName }}
40
53
steps :
41
54
55
+ - task : PowerShell@2
56
+ name : showVariables
57
+ displayName : ' Show Variables'
58
+ inputs :
59
+ targetType : inline
60
+ pwsh : true
61
+ script : |
62
+ Write-Host "Pipeline variable SkippedModules: $($env:SkippedModules)"
63
+ Write-Host "Pipeline variable FailedJobNotificationReceivers: $($env:FailedJobNotificationReceivers)"
64
+
65
+ Write-Host "Parameter TestChangedModulesOnly: ${{ parameters.TestChangedModulesOnly }}"
66
+ Write-Host "Parameter SelectedTargetModules: ${{ parameters.SelectedTargetModules }}"
67
+ Write-Host "Parameter NotificationReceiversOverride: ${{ parameters.NotificationReceiversOverride }}"
68
+ Write-Host "Parameter GenerationBaseBranch: ${{ parameters.GenerationBaseBranch }}"
69
+ Write-Host "Parameter PrepareModulesOnGenerationBranch: ${{ parameters.PrepareModulesOnGenerationBranch }}"
70
+
42
71
# TODO: (Bernard) Uncomment the no checkout step after automatically install repo into agents
43
72
# - checkout: none
44
73
- checkout : self
@@ -59,7 +88,7 @@ stages:
59
88
$token = "$(GitHubToken)"
60
89
61
90
$createBranchPath = Join-Path "$(Build.SourcesDirectory)" '.azure-pipelines' 'PipelineSteps' 'BatchGeneration' 'create-branch.ps1'
62
- & $createBranchPath -Owner 'Azure' -Repo 'azure-powershell' -BaseBranch "$( GenerationBaseBranch) " -NewBranch $generationBranch -Token $token
91
+ & $createBranchPath -Owner 'Azure' -Repo 'azure-powershell' -BaseBranch "${{ parameters. GenerationBaseBranch }} " -NewBranch $generationBranch -Token $token
63
92
Write-Host "##vso[task.setvariable variable=GenerationBranch;isOutput=true]$generationBranch"
64
93
65
94
- task : PowerShell@2
@@ -82,10 +111,18 @@ stages:
82
111
targetType : inline
83
112
pwsh : true
84
113
script : |
114
+ if ($env:PREPARE_MODULES_ON_GENERATION_BRANCH -eq 'true') {
115
+ Write-Host "Checkout to GenerationBranch: $(checkout.GenerationBranch)"
116
+ git fetch origin "$(checkout.GenerationBranch)"
117
+ git checkout "$(checkout.GenerationBranch)"
118
+ }
119
+
85
120
$prepareModulesPath = Join-Path "$(Build.SourcesDirectory)" '.azure-pipelines' 'PipelineSteps' 'BatchGeneration' 'prepare.ps1'
86
121
& $prepareModulesPath -RepoRoot "$(Build.SourcesDirectory)" -MaxParallelJobs "${{ variables.MaxParallelGenerateJobs }}"
87
122
env :
88
123
SKIPPED_MODULES : $(SkippedModules)
124
+ SELECTED_TARGET_MODULES : ${{ parameters.SelectedTargetModules }}
125
+ PREPARE_MODULES_ON_GENERATION_BRANCH : ${{ parameters.PrepareModulesOnGenerationBranch }}
89
126
90
127
- task : PublishPipelineArtifact@1
91
128
displayName : ' Upload generated targets'
@@ -515,3 +552,4 @@ stages:
515
552
env :
516
553
TEAMS_URL : $(TEAMS_URL)
517
554
FailedJobNotificationReceivers : $(FailedJobNotificationReceivers)
555
+ NotificationReceiversOverride : ${{ parameters.NotificationReceiversOverride }}
0 commit comments