Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use BuildID to fix race ondition #17459

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
pwsh: true
workingDirectory: $(Build.SourcesDirectory)
filePath: eng/scripts/SetTestPipelineVersion.ps1
arguments: '-BuildNumber $(Build.BuildNumber)'
chidozieononiwu marked this conversation as resolved.
Show resolved Hide resolved

- script: |
echo "##vso[build.addbuildtag]Scheduled"
Expand Down
1 change: 1 addition & 0 deletions eng/pipelines/templates/stages/archetype-java-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ stages:
pwsh: true
workingDirectory: $(Build.SourcesDirectory)
filePath: eng/scripts/SetTestPipelineVersion.ps1
arguments: '-BuildNumber $(Build.BuildNumber)'

- task: UsePythonVersion@0
displayName: 'Use Python 3.6'
Expand Down
12 changes: 10 additions & 2 deletions eng/scripts/SetTestPipelineVersion.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Overides the project file and CHANGELOG.md for the template project using the next publishable version
# Overides the project file and CHANGELOG.md for the template project.
# This is to help with testing the release pipeline.

param (
[Parameter(mandatory = $true)]
$BuildNumber
)

. "${PSScriptRoot}\..\common\scripts\common.ps1"
$latestTags = git tag -l "azure-sdk-template_*"
$semVars = @()
Expand All @@ -16,7 +22,9 @@ $semVarsSorted = [AzureEngSemanticVersion]::SortVersionStrings($semVars)
LogDebug "Last Published Version $($semVarsSorted[0])"

$newVersion = [AzureEngSemanticVersion]::ParseVersionString($semVarsSorted[0])
$newVersion.IncrementAndSetToPrerelease()
$newVersion.PrereleaseLabel = "beta"
$newVersion.PrereleaseNumber = $BuildNumber

LogDebug "Version to publish [ $($newVersion.ToString()) ]"

$pomFileContent = New-Object -TypeName XML
Expand Down