Skip to content

Commit

Permalink
Sync eng/common directory with azure-sdk-tools for PR 9466 (Azure#23835)
Browse files Browse the repository at this point in the history
* Use new generation tool that supports service connections

* Fix condition for generating weekly test pipelines

---------

Co-authored-by: Wes Haggard <[email protected]>
Co-authored-by: Wes Haggard <[email protected]>
  • Loading branch information
3 people authored Dec 6, 2024
1 parent 69f4346 commit 211fb18
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
27 changes: 26 additions & 1 deletion eng/common/pipelines/templates/jobs/prepare-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ jobs:
Prefix: 'na'
DevOpsPath: 'na'
InternalVariableGroups: ''
InternalServiceConnections: ''
GeneratePublicCIPipeline: ''
GenerateUnifiedWeekly: ''
TestVariableGroups: ''
TestServiceConnections: ''

# Standard set of variable groups for the Azure SDK repositories
AzureSDK_Maven_Release_Pipeline_Secrets: 1
Expand Down Expand Up @@ -70,6 +73,12 @@ jobs:
exit 1
}
$generatePublicCIPipeline = 'true'
$generateUnifiedWeekly = 'false'
$testServiceConnections = '"Azure" "azure-sdk-tests" "azure-sdk-tests-china" "azure-sdk-tests-preview" "azure-sdk-tests-public" "azure-sdk-tests-usgov" "Azure SDK Test Resources - LiveTestSecrets"'
$internalServiceConnections = '"Azure" "Azure SDK Artifacts" "Azure SDK Engineering System" "opensource-api-connection" "AzureSDKEngKeyVault Secrets"'
# Map the language prefix to the appropriate variable groups
switch ($prefix)
{
Expand All @@ -81,16 +90,19 @@ jobs:
$internalVariableGroups = '$(AzureSDK_Maven_Release_Pipeline_Secrets) $(Release_Secrets_for_GitHub) $(APIReview_AutoCreate_Configurations)'
}
"js" {
$generatePublicCIPipeline = 'false'
$internalVariableGroups = '$(NPM_Registry_Authentication) $(Release_Secrets_for_GitHub) $(APIReview_AutoCreate_Configurations)'
$testVariableGroups = '$(Secrets_for_Resource_Provisioner)'
}
"python" {
$generatePublicCIPipeline = 'false'
$internalVariableGroups = '$(Release_Secrets_for_GitHub) $(APIReview_AutoCreate_Configurations)'
$testVariableGroups = '$(Secrets_for_Resource_Provisioner)'
}
"net" {
$internalVariableGroups = '$(AzureSDK_Nuget_Release_Pipeline_Secrets) $(Release_Secrets_for_GitHub) $(APIReview_AutoCreate_Configurations)'
$testVariableGroups = '$(Secrets_for_Resource_Provisioner)'
$internalServiceConnections += ' "Azure SDK Symbols Publishing" Nuget.org'
}
"cpp" {
$internalVariableGroups = '$(Release_Secrets_for_GitHub) $(APIReview_AutoCreate_Configurations) $(Secrets_for_Resource_Provisioner)'
Expand All @@ -110,9 +122,16 @@ jobs:
Write-Host "InternalVariableGroups = $internalVariableGroups"
Write-Host "TestVariableGroups = $testVariableGroups"
Write-Host "TestServiceConnections = $testServiceConnections"
Write-Host "InternalServiceConnections = $internalServiceConnections"
Write-Host "GeneratePublicCIPipeline = $generatePublicCIPipeline"
Write-Host "GenerateUnifiedWeekly = $generateUnifiedWeekly"
Write-Host "##vso[task.setvariable variable=InternalVariableGroups]$internalVariableGroups"
Write-Host "##vso[task.setvariable variable=TestVariableGroups]$testVariableGroups"
Write-Host "##vso[task.setvariable variable=TestServiceConnections]$testServiceConnections"
Write-Host "##vso[task.setvariable variable=InternalServiceConnections]$internalServviceConnections"
Write-host "##vso[task.setvariable variable=GeneratePublicCIPipeline]$generatePublicCIPipeline"
Write-Host "##vso[task.setvariable variable=GenerateUnifiedWeekly]$generateUnifiedWeekly"
displayName: Setup pipeline generation variables
Expand All @@ -135,7 +154,9 @@ jobs:
--branch refs/heads/$(DefaultBranch)
--set-managed-variables
--debug
--serviceconnections "Azure"
displayName: 'Generate ci pipelines for: ${{ parameters.Repository }}'
condition: and(succeeded(), eq(variables['GeneratePublicCIPipeline'],'true'))
continueOnError: true
- task: AzureCLI@2
inputs:
Expand All @@ -157,6 +178,7 @@ jobs:
--set-managed-variables
--debug
--variablegroups $(InternalVariableGroups) $(TestVariableGroups)
--serviceconnections $(InternalServiceConnections) $(TestServiceConnections)
displayName: 'Generate release pipelines for: ${{ parameters.Repository }}'
continueOnError: true
- task: AzureCLI@2
Expand All @@ -179,6 +201,7 @@ jobs:
--set-managed-variables
--debug
--variablegroups $(TestVariableGroups)
--serviceconnections $(TestServiceConnections)
displayName: 'Generate test pipelines for: ${{ parameters.Repository }}'
condition: and(succeeded(), ne(variables['TestVariableGroups'],''))
continueOnError: true
Expand All @@ -202,6 +225,7 @@ jobs:
--set-managed-variables
--debug
--variablegroups $(TestVariableGroups)
--serviceconnections $(TestServiceConnections)
displayName: 'Generate weekly test pipelines (multi-cloud) for: ${{ parameters.Repository }}'
condition: and(succeeded(), ne(variables['TestVariableGroups'],''))
continueOnError: true
Expand All @@ -225,6 +249,7 @@ jobs:
--set-managed-variables
--debug
--variablegroups $(InternalVariableGroups) $(TestVariableGroups)
--serviceconnections $(InternalServiceConnections) $(TestServiceConnections)
displayName: 'Generate weekly unified test pipelines (multi-cloud) for: ${{ parameters.Repository }}'
condition: and(succeeded(), ne(variables['GenerateUnifiedWeekly'],''))
condition: and(succeeded(), eq(variables['GenerateUnifiedWeekly'],'true'))
continueOnError: true
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ steps:
- script: >
dotnet tool install
Azure.Sdk.Tools.PipelineGenerator
--version 1.1.0-dev.20240604.1
--version 1.1.0-dev.20241204.1
--add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json
--tool-path ${{parameters.ToolPath}}
workingDirectory: $(Pipeline.Workspace)/pipeline-generator
Expand Down

0 comments on commit 211fb18

Please sign in to comment.