Skip to content

Commit 1d8a0db

Browse files
bug: upstream release version env var (#88)
1 parent 804c131 commit 1d8a0db

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

src/ALZ.Settings.ps1

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
# specify the minimum required major PowerShell version that the build script should validate
2-
[version]$script:requiredPSVersion = '5.1.0'
3-
4-
# specify the supported versions of ALZ-Bicep
5-
$script:ALZBicepSupportedReleases = @('v0.14.0', 'v0.15.0', 'v0.16.0', 'v0.16.1', 'v0.16.2', 'v0.16.3', 'v0.16.4', 'v0.16.5')
2+
[version]$script:requiredPSVersion = '5.1.0'

src/ALZ/Private/Build-ALZDeploymentEnvFile.ps1

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ function Build-ALZDeploymentEnvFile {
44
[PSCustomObject] $configuration,
55

66
[Parameter(Mandatory = $false)]
7-
[string] $destination = "."
7+
[string] $destination = ".",
8+
9+
[Parameter(Mandatory = $false)]
10+
[string] $version = ""
811
)
912
<#
1013
.SYNOPSIS
@@ -24,9 +27,14 @@ function Build-ALZDeploymentEnvFile {
2427
foreach ($configurationValue in $configuration.PsObject.Properties) {
2528
foreach ($target in $configurationValue.Value.Targets) {
2629
if ($target.Destination -eq "Environment") {
30+
Write-InformationColored $configurationValue.Name -ForegroundColor Green -InformationAction Continue
2731

28-
$formattedValue = $configurationValue.Value.Value
29-
Add-Content -Path $envFile -Value "$($($target.Name))=`"$formattedValue`"" | Out-String | Write-Verbose
32+
if($configurationValue.Name -eq "UpstreamReleaseVersion") {
33+
Add-Content -Path $envFile -Value "$($($target.Name))=`"$version`"" | Out-String | Write-Verbose
34+
} else {
35+
$formattedValue = $configurationValue.Value.Value
36+
Add-Content -Path $envFile -Value "$($($target.Name))=`"$formattedValue`"" | Out-String | Write-Verbose
37+
}
3038
}
3139
}
3240
}

src/ALZ/Private/New-ALZEnvironmentBicep.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function New-ALZEnvironmentBicep {
5050

5151
Set-ComputedConfiguration -configuration $configuration | Out-String | Write-Verbose
5252
Edit-ALZConfigurationFilesInPlace -alzEnvironmentDestination $alzEnvironmentDestination -configuration $configuration | Out-String | Write-Verbose
53-
Build-ALZDeploymentEnvFile -configuration $configuration -Destination $alzEnvironmentDestination | Out-String | Write-Verbose
53+
Build-ALZDeploymentEnvFile -configuration $configuration -Destination $alzEnvironmentDestination -version $releaseTag | Out-String | Write-Verbose
5454

5555
$isGitRepo = Test-ALZGitRepository -alzEnvironmentDestination $alzEnvironmentDestination
5656
if (-not $isGitRepo) {

0 commit comments

Comments
 (0)