Update version number in umbraco template from azure pipeline in continuous builds

This commit is contained in:
Bjarke Berg
2020-12-17 14:26:17 +01:00
parent e4857abc57
commit cd169fbcce
2 changed files with 10 additions and 3 deletions

View File

@@ -18,7 +18,7 @@ resources:
ACCEPT_EULA: Y ACCEPT_EULA: Y
SA_PASSWORD: $(SA_PASSWORD) SA_PASSWORD: $(SA_PASSWORD)
MSSQL_PID: Developer MSSQL_PID: Developer
ports: ports:
- 1433:1433 - 1433:1433
options: --name mssql options: --name mssql
@@ -170,6 +170,13 @@ stages:
$continuous = "$($version.Release)-alpha.$(Build.BuildNumber)" $continuous = "$($version.Release)-alpha.$(Build.BuildNumber)"
} }
$ubuild.SetUmbracoVersion($continuous) $ubuild.SetUmbracoVersion($continuous)
#Update the version in template also
$templatePath = 'build/templates/UmbracoSolution/.template.config/template.json'
$a = Get-Content $templatePath -raw | ConvertFrom-Json
$a.symbols.version.defaultValue = $continuous
$a | ConvertTo-Json -depth 32| set-content $templatePath
Write-Host "Building: $continuous" Write-Host "Building: $continuous"
- task: PowerShell@1 - task: PowerShell@1

View File

@@ -9,13 +9,13 @@
"language": "C#", "language": "C#",
"type": "project" "type": "project"
}, },
"sourceName": "UmbracoSolution", // Will be replaced with the value provided via -n "sourceName": "UmbracoSolution",
"preferNameDirectory": true, "preferNameDirectory": true,
"symbols": { "symbols": {
"version": { "version": {
"type": "parameter", "type": "parameter",
"datatype": "string", "datatype": "string",
"defaultValue": "0.5.0-alpha*", "defaultValue": "0.5.0-alpha003",
"description": "The version of Umbraco to load using NuGet", "description": "The version of Umbraco to load using NuGet",
"replaces": "UMBRACO_VERSION_FROM_TEMPLATE" "replaces": "UMBRACO_VERSION_FROM_TEMPLATE"
}, },