Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 3 additions & 29 deletions azure-pipelines/vs-insertion-experimental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,8 @@ parameters:
displayName: 'Insertion Target Branch (select for manual insertion)'
values:
- main
- rel/d18.6
- rel/d18.5
- rel/d18.4
- rel/d18.3
- rel/d18.0
- rel/d17.14
- rel/d17.13
- rel/d17.12
- rel/d17.11
- rel/d17.8
- rel/d17.6
- rel/d17.3
- rel/d17.0
- rel/d16.11
- rel/insiders
- rel/stable

variables:
- name: TeamName
Expand Down Expand Up @@ -120,27 +108,13 @@ extends:
inputs:
targetType: inline
script: |
# Extract VS version from branch name if it follows exp/vsXX.Y-somename pattern
$fullBranch = "$(resources.pipeline.MSBuildExpPerf.sourceBranch)"
$parameterTargetBranch = "${{ parameters.TargetBranch }}"
$detectedTarget = "main" # Default target branch

# Try to match the pattern with regex
if ($fullBranch -match "exp/vs(\d+)\.(\d+).*") {
$major = $matches[1]
$minor = $matches[2]
$targetBranch = "rel/d$major.$minor"
Write-Host "Detected version pattern in branch: $major.$minor"
Write-Host "Setting target branch to $targetBranch"
$detectedTarget = $targetBranch
} else {
Write-Host "No version pattern detected in branch, using default target: main"
}

# Determine which target branch to use based on build reason
$finalTargetBranch = $parameterTargetBranch
if ("$(Build.Reason)" -eq "ResourceTrigger" -or "$(Build.Reason)" -eq "PipelineCompletedTrigger") {
Comment thread
MichalPavlik marked this conversation as resolved.
Outdated
Write-Host "Build was triggered automatically, using detected target branch: $detectedTarget"
Write-Host "Build was triggered automatically, using default target branch: $detectedTarget"
$finalTargetBranch = $detectedTarget
} else {
Write-Host "Build was triggered manually, using parameter target branch: $parameterTargetBranch"
Expand Down
75 changes: 7 additions & 68 deletions azure-pipelines/vs-insertion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ resources:
branch: main # for daily main scheduled insertion
trigger:
branches:
include: # trigger as a followup to servicing CI
include: # trigger as a followup to CI on servicing branches
- vs*
repositories:
- repository: 1ESPipelineTemplates
Expand All @@ -44,20 +44,8 @@ parameters:
values:
- auto
- main
- rel/d18.6
- rel/d18.5
- rel/d18.4
- rel/d18.3
- rel/d18.0
- rel/d17.14
- rel/d17.13
- rel/d17.12
- rel/d17.11
- rel/d17.10
- rel/d17.8
- rel/d17.6
- rel/d17.3
- rel/d17.0
- rel/insiders
- rel/stable
- name: DropRetentionDays
default: 183
type: number
Expand All @@ -70,38 +58,7 @@ parameters:
variables:
# `auto` should work every time and selecting a branch in parameters is likely to fail due to incompatible versions in MSBuild and VS
- name: AutoInsertTargetBranch
${{ if eq(variables['Build.SourceBranchName'], 'vs18.6') }}:
value: 'rel/d18.6'
${{ elseif eq(variables['Build.SourceBranchName'], 'vs18.5') }}:
value: 'rel/d18.5'
${{ elseif eq(variables['Build.SourceBranchName'], 'vs18.4') }}:
value: 'rel/d18.4'
${{ elseif eq(variables['Build.SourceBranchName'], 'vs18.3') }}:
value: 'rel/d18.3'
${{ elseif eq(variables['Build.SourceBranchName'], 'vs18.0') }}:
value: 'rel/d18.0'
${{ elseif eq(variables['Build.SourceBranchName'], 'vs17.14') }}:
value: 'rel/d17.14'
${{ elseif eq(variables['Build.SourceBranchName'], 'vs17.13') }}:
value: 'rel/d17.13'
${{ elseif eq(variables['Build.SourceBranchName'], 'vs17.12') }}:
value: 'rel/d17.12'
${{ elseif eq(variables['Build.SourceBranchName'], 'vs17.11') }}:
value: 'rel/d17.11'
${{ elseif eq(variables['Build.SourceBranchName'], 'vs17.8') }}:
value: 'rel/d17.8'
${{ elseif eq(variables['Build.SourceBranchName'], 'vs17.6') }}:
value: 'rel/d17.6'
${{ elseif eq(variables['Build.SourceBranchName'], 'vs17.3') }}:
value: 'rel/d17.3'
${{ elseif eq(variables['Build.SourceBranchName'], 'vs17.0') }}:
value: 'rel/d17.0'
${{ elseif eq(variables['Build.SourceBranchName'], 'main') }}:
value: 'main'
${{ elseif eq(variables['Build.SourceBranchName'], 'vs17.15') }}:
value: 'main'
${{ else }}:
value: ''
value: 'main'
- name: InsertTargetBranch
${{ if not(eq(parameters.TargetBranch, 'auto')) }}:
value: ${{ parameters.TargetBranch }}
Comment thread
MichalPavlik marked this conversation as resolved.
Outdated
Expand Down Expand Up @@ -235,29 +192,11 @@ extends:
"Microsoft.Build.Utilities.Core=$MicrosoftNETStringToolsPackageVersion",
"Microsoft.NET.StringTools=$MicrosoftNETStringToolsPackageVersion"
)
# servicing branches until 17.12 also include Microsoft.Build.Engine and Microsoft.Build.Conversion.Core
if ("$(InsertTargetBranch)" -in @("rel/d17.0", "rel/d17.3", "rel/d17.6", "rel/d17.8", "rel/d17.10", "rel/d17.11", "rel/d17.12"))

{
$props += @(
"Microsoft.Build.Conversion.Core=$MicrosoftNETStringToolsPackageVersion",
"Microsoft.Build.Engine=$MicrosoftNETStringToolsPackageVersion"
)
}
$propsValue = $props -join ";"
Comment thread
MichalPavlik marked this conversation as resolved.
Outdated

# For 18.0+, don't update PackageReferences so that VS packages like VSSDK
# can choose their own versioning and don't always depend on a super fresh MSBuild
if ("$(InsertTargetBranch)" -in @("rel/d17.10", "rel/d17.12", "rel/d17.14"))
{
Write-Host "Setting InsertPackagePropsValues to '$propsValue'"
Write-Host "##vso[task.setvariable variable=InsertPackagePropsValues]$($propsValue)"
}
else
{
Write-Host "Unsetting InsertPackagePropsValues"
Write-Host "##vso[task.setvariable variable=InsertPackagePropsValues]"
}
# InsertPackagePropsValues was needed for old servicing branches (rel/d17.x) but is not used for main
Write-Host "Unsetting InsertPackagePropsValues"
Write-Host "##vso[task.setvariable variable=InsertPackagePropsValues]"

# autocomplete main
$autocomplete = "false"
Expand Down
Loading