11parameters :
22- 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
47 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
619
720variables :
821 IntermediateStepTimeoutInMinutes : 30
@@ -39,6 +52,22 @@ stages:
3952 pool : ${{ variables.WindowsAgentPoolName }}
4053 steps :
4154
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+
4271 # TODO: (Bernard) Uncomment the no checkout step after automatically install repo into agents
4372 # - checkout: none
4473 - checkout : self
@@ -59,7 +88,7 @@ stages:
5988 $token = "$(GitHubToken)"
6089
6190 $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
6392 Write-Host "##vso[task.setvariable variable=GenerationBranch;isOutput=true]$generationBranch"
6493
6594 - task : PowerShell@2
@@ -82,10 +111,18 @@ stages:
82111 targetType : inline
83112 pwsh : true
84113 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+
85120 $prepareModulesPath = Join-Path "$(Build.SourcesDirectory)" '.azure-pipelines' 'PipelineSteps' 'BatchGeneration' 'prepare.ps1'
86121 & $prepareModulesPath -RepoRoot "$(Build.SourcesDirectory)" -MaxParallelJobs "${{ variables.MaxParallelGenerateJobs }}"
87122 env :
88123 SKIPPED_MODULES : $(SkippedModules)
124+ SELECTED_TARGET_MODULES : ${{ parameters.SelectedTargetModules }}
125+ PREPARE_MODULES_ON_GENERATION_BRANCH : ${{ parameters.PrepareModulesOnGenerationBranch }}
89126
90127 - task : PublishPipelineArtifact@1
91128 displayName : ' Upload generated targets'
@@ -515,3 +552,4 @@ stages:
515552 env :
516553 TEAMS_URL : $(TEAMS_URL)
517554 FailedJobNotificationReceivers : $(FailedJobNotificationReceivers)
555+ NotificationReceiversOverride : ${{ parameters.NotificationReceiversOverride }}
0 commit comments