16 строки
669 B
PowerShell
16 строки
669 B
PowerShell
try {
|
|
# package.json is in root folder, while version.ps1 runs in .pipelines folder.
|
|
$version = (Get-Content "package.json") -join "`n" | ConvertFrom-Json | Select -ExpandProperty "version"
|
|
$revision = $env:CDP_DEFINITION_BUILD_COUNT_DAY
|
|
$buildNumber = "$version.$revision"
|
|
|
|
Write-Host "Build Number is" $buildNumber
|
|
|
|
[Environment]::SetEnvironmentVariable("CustomBuildNumber", $buildNumber, "User") # This will allow you to use it from env var in later steps of the same phase
|
|
Write-Host "##vso[build.updatebuildnumber]${buildNumber}" # This will update build number on your build
|
|
}
|
|
catch {
|
|
Write-Error $_.Exception
|
|
exit 1;
|
|
}
|