-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move SetTestPipelineVersion.ps1 to eng/common (#17103)
Co-authored-by: Chidozie Ononiwu <[email protected]>
- Loading branch information
1 parent
36e4c0d
commit 88d3916
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Sets a valid version for a package using the buildID | ||
|
||
param ( | ||
[Parameter(mandatory = $true)] | ||
$BuildID, | ||
[Parameter(mandatory = $true)] | ||
$PackagName, | ||
[Parameter(mandatory = $true)] | ||
$ServiceDirectory | ||
) | ||
|
||
. common.ps1 | ||
|
||
$latestTags = git tag -l "${PackageName}_*" | ||
$semVars = @() | ||
|
||
Foreach ($tags in $latestTags) | ||
{ | ||
$semVars += $tags.Replace("${PackageName}_", "") | ||
} | ||
|
||
$semVarsSorted = [AzureEngSemanticVersion]::SortVersionStrings($semVars) | ||
LogDebug "Last Published Version $($semVarsSorted[0])" | ||
|
||
$newVersion = [AzureEngSemanticVersion]::new($semVarsSorted[0]) | ||
$newVersion.PrereleaseLabel = $newVersion.DefaultPrereleaseLabel | ||
$newVersion.PrereleaseNumber = $BuildID | ||
|
||
LogDebug "Version to publish [ $($newVersion.ToString()) ]" | ||
|
||
SetPackageVersion -PackageName $PackagName ` | ||
-Version $newVersion ` | ||
-ServiceDirectory $ServiceDirectory ` |