Skip to content

Commit

Permalink
Removing 'ImageVersion' as an env var as we already use 'IMAGE_VERSIO…
Browse files Browse the repository at this point in the history
…N' (#2509)

* Removing 'ImageVersion' as an env var as we already use 'IMAGE_VERSION'. The env var is only used SoftwareReport.Generator script.

* Adding IMAGE_VERISON to SoftwareReport.Generator

* Adding IMAGE_VERISON to SoftwareReport.Generator

* Chnaging the way the env vars are used to floow the same pattern throughout

Co-authored-by: Jose Mosquera <[email protected]>
  • Loading branch information
jmos5156 and ddjmos authored Jan 27, 2021
1 parent df8a157 commit 1eb504f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
4 changes: 4 additions & 0 deletions images/win/scripts/Installers/Initialize-VM.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ function Disable-UserAccessControl {
# Enable $ErrorActionPreference='Stop' for AllUsersAllHosts
Add-Content -Path $profile.AllUsersAllHosts -Value '$ErrorActionPreference="Stop"'

# Set static env vars
setx ImageVersion $env:IMAGE_VERSION /m
setx ImageOS $env:IMAGE_OS /m

# Set TLS1.2
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $markdown += New-MDHeader "$OSName" -Level 1
$OSVersion = Get-OSVersion
$markdown += New-MDList -Style Unordered -Lines @(
"$OSVersion"
"Image Version: $env:ImageVersion"
"Image Version: $env:IMAGE_VERSION"
)

if (Test-IsWin19)
Expand Down
11 changes: 3 additions & 8 deletions images/win/windows2016.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@
{
"type": "powershell",
"environment_vars": [
"ImageVersion={{user `image_version`}}",
"IMAGE_VERSION={{user `image_version`}}",
"IMAGE_OS={{user `image_os`}}",
"TOOLSET_JSON_PATH={{user `toolset_json_path`}}",
"PSMODULES_ROOT_FOLDER={{user `psmodules_root_folder`}}"
],
Expand All @@ -134,13 +135,6 @@
"type": "windows-restart",
"restart_timeout": "30m"
},
{
"type": "powershell",
"inline": [
"setx ImageVersion {{user `image_version` }} /m",
"setx ImageOS {{user `image_os` }} /m"
]
},
{
"type": "powershell",
"environment_vars": [
Expand Down Expand Up @@ -357,6 +351,7 @@
"pwsh -File '{{user `image_folder`}}\\SoftwareReport\\SoftwareReport.Generator.ps1'"
],
"environment_vars": [
"IMAGE_VERSION={{user `image_version`}}",
"TOOLSET_JSON_PATH={{user `toolset_json_path`}}"
]
},
Expand Down
11 changes: 3 additions & 8 deletions images/win/windows2019.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@
{
"type": "powershell",
"environment_vars": [
"ImageVersion={{user `image_version`}}",
"IMAGE_VERSION={{user `image_version`}}",
"IMAGE_OS={{user `image_os`}}",
"TOOLSET_JSON_PATH={{user `toolset_json_path`}}",
"PSMODULES_ROOT_FOLDER={{user `psmodules_root_folder`}}"
],
Expand All @@ -138,13 +139,6 @@
"{{ template_dir }}/scripts/Installers/Install-ContainersFeature.ps1"
]
},
{
"type": "powershell",
"inline": [
"setx ImageVersion {{user `image_version` }} /m",
"setx ImageOS {{user `image_os` }} /m"
]
},
{
"type": "windows-restart",
"restart_timeout": "10m"
Expand Down Expand Up @@ -350,6 +344,7 @@
"pwsh -File '{{user `image_folder`}}\\SoftwareReport\\SoftwareReport.Generator.ps1'"
],
"environment_vars": [
"IMAGE_VERSION={{user `image_version`}}",
"TOOLSET_JSON_PATH={{user `toolset_json_path`}}"
]
},
Expand Down

0 comments on commit 1eb504f

Please sign in to comment.