2023-02-21 21:42:30 +00:00
|
|
|
# Select a pool provider based off branch name. Anything with branch name containing 'release' must go into an -Svc pool,
|
2022-10-22 12:27:57 +00:00
|
|
|
# otherwise it should go into the "normal" pools. This separates out the queueing and billing of released branches.
|
|
|
|
|
|
|
|
# Motivation:
|
|
|
|
# Once a given branch of a repository's output has been officially "shipped" once, it is then considered to be COGS
|
|
|
|
# (Cost of goods sold) and should be moved to a servicing pool provider. This allows both separation of queueing
|
2023-02-21 21:42:30 +00:00
|
|
|
# (allowing release builds and main PR builds to not intefere with each other) and billing (required for COGS.
|
2022-10-22 12:27:57 +00:00
|
|
|
# Additionally, the pool provider name itself may be subject to change when the .NET Core Engineering Services
|
|
|
|
# team needs to move resources around and create new and potentially differently-named pools. Using this template
|
|
|
|
# file from an Arcade-ified repo helps guard against both having to update one's release/* branches and renaming.
|
|
|
|
|
|
|
|
# How to use:
|
|
|
|
# This yaml assumes your shipped product branches use the naming convention "release/..." (which many do).
|
2023-02-21 21:42:30 +00:00
|
|
|
# If we find alternate naming conventions in broad usage it can be added to the condition below.
|
2022-10-22 12:27:57 +00:00
|
|
|
#
|
|
|
|
# First, import the template in an arcade-ified repo to pick up the variables, e.g.:
|
|
|
|
#
|
|
|
|
# variables:
|
2023-01-18 10:18:03 +00:00
|
|
|
# - template: /eng/common/templates/variables/pool-providers.yml
|
2022-10-22 12:27:57 +00:00
|
|
|
#
|
|
|
|
# ... then anywhere specifying the pool provider use the runtime variables,
|
|
|
|
# $(DncEngInternalBuildPool) and $ (DncEngPublicBuildPool), e.g.:
|
|
|
|
#
|
|
|
|
# pool:
|
|
|
|
# name: $(DncEngInternalBuildPool)
|
|
|
|
# demands: ImageOverride -equals windows.vs2019.amd64
|
|
|
|
|
|
|
|
variables:
|
2023-02-03 21:09:20 +00:00
|
|
|
# Coalesce the target and source branches so we know when a PR targets a release branch
|
|
|
|
# If these variables are somehow missing, fall back to main (tends to have more capacity)
|
2022-10-22 12:27:57 +00:00
|
|
|
|
2023-02-03 21:09:20 +00:00
|
|
|
# Any new -Svc alternative pools should have variables added here to allow for splitting work
|
2022-10-22 12:27:57 +00:00
|
|
|
- name: DncEngPublicBuildPool
|
2023-02-03 21:09:20 +00:00
|
|
|
value: $[
|
|
|
|
replace(
|
|
|
|
replace(
|
|
|
|
eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'),
|
|
|
|
True,
|
|
|
|
'NetCore-Svc-Public'
|
|
|
|
),
|
|
|
|
False,
|
|
|
|
'NetCore-Public'
|
|
|
|
)
|
|
|
|
]
|
2022-10-22 12:27:57 +00:00
|
|
|
|
|
|
|
- name: DncEngInternalBuildPool
|
2023-02-03 21:09:20 +00:00
|
|
|
value: $[
|
|
|
|
replace(
|
|
|
|
replace(
|
|
|
|
eq(contains(coalesce(variables['System.PullRequest.TargetBranch'], variables['Build.SourceBranch'], 'refs/heads/main'), 'release'), 'true'),
|
|
|
|
True,
|
|
|
|
'NetCore1ESPool-Svc-Internal'
|
|
|
|
),
|
|
|
|
False,
|
|
|
|
'NetCore1ESPool-Internal'
|
|
|
|
)
|
|
|
|
]
|