mirror of
https://github.com/tribufu/ServerManagers
synced 2026-06-01 09:42:39 +00:00
pipeline file changes
This commit is contained in:
parent
f93a98a0a8
commit
581ea89e4a
2 changed files with 37 additions and 4 deletions
|
|
@ -20,7 +20,40 @@ steps:
|
|||
[int]$PatternExpectedVersionNumbers = 4
|
||||
[int]$VersionNumbersInVersion = 4
|
||||
|
||||
Function Replace-Version() {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)] $content,
|
||||
[Parameter(Mandatory = $true)] [string]$version,
|
||||
[Parameter(Mandatory = $true)] [string]$attribute
|
||||
)
|
||||
|
||||
$exitFunction = $false
|
||||
|
||||
foreach ($line in $content) {
|
||||
if ($line -match 'exclude from semantic versioning') {
|
||||
Write-Host " * Skipping $attribute due to exclude"
|
||||
$exitFunction = $true
|
||||
}
|
||||
|
||||
if ($line -match 'include semantic versioning' -and $line -notmatch "include semantic versioning - $ApplicationName") {
|
||||
Write-Host " * Skipping $attribute due to include not matching"
|
||||
$exitFunction = $true
|
||||
}
|
||||
}
|
||||
|
||||
if ($exitFunction) {
|
||||
return $content
|
||||
}
|
||||
|
||||
return $content
|
||||
}
|
||||
|
||||
Function Get-VersionString($numberOfVersions, $extractedBuildNumbers) {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)] [int]$numberOfVersions,
|
||||
[Parameter(Mandatory = $true)] [string]$extractedBuildNumbers
|
||||
)
|
||||
|
||||
return [string]::Join('.',($extractedBuildNumbers | select -First ($numberOfVersions)))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue