Skip to content

Commit

Permalink
Use BuildID to fix race ondition (#17459)
Browse files Browse the repository at this point in the history
  • Loading branch information
chidozieononiwu committed Nov 16, 2020
1 parent d4084a0 commit 35f8631
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
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)'

- 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

0 comments on commit 35f8631

Please sign in to comment.