Removing 'ImageVersion' as an env var as we already use 'IMAGE_VERSION' (#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 <jose.mosquera@dotdigital.com>
This commit is contained in:
jmos5156
2021-01-27 10:12:48 +00:00
committed by GitHub
parent df8a157caf
commit 1eb504f4d4
4 changed files with 11 additions and 17 deletions

View File

@@ -33,6 +33,10 @@ function Disable-UserAccessControl {
# Enable $ErrorActionPreference='Stop' for AllUsersAllHosts # Enable $ErrorActionPreference='Stop' for AllUsersAllHosts
Add-Content -Path $profile.AllUsersAllHosts -Value '$ErrorActionPreference="Stop"' 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 # Set TLS1.2
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12" [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12"

View File

@@ -17,7 +17,7 @@ $markdown += New-MDHeader "$OSName" -Level 1
$OSVersion = Get-OSVersion $OSVersion = Get-OSVersion
$markdown += New-MDList -Style Unordered -Lines @( $markdown += New-MDList -Style Unordered -Lines @(
"$OSVersion" "$OSVersion"
"Image Version: $env:ImageVersion" "Image Version: $env:IMAGE_VERSION"
) )
if (Test-IsWin19) if (Test-IsWin19)

View File

@@ -112,7 +112,8 @@
{ {
"type": "powershell", "type": "powershell",
"environment_vars": [ "environment_vars": [
"ImageVersion={{user `image_version`}}", "IMAGE_VERSION={{user `image_version`}}",
"IMAGE_OS={{user `image_os`}}",
"TOOLSET_JSON_PATH={{user `toolset_json_path`}}", "TOOLSET_JSON_PATH={{user `toolset_json_path`}}",
"PSMODULES_ROOT_FOLDER={{user `psmodules_root_folder`}}" "PSMODULES_ROOT_FOLDER={{user `psmodules_root_folder`}}"
], ],
@@ -134,13 +135,6 @@
"type": "windows-restart", "type": "windows-restart",
"restart_timeout": "30m" "restart_timeout": "30m"
}, },
{
"type": "powershell",
"inline": [
"setx ImageVersion {{user `image_version` }} /m",
"setx ImageOS {{user `image_os` }} /m"
]
},
{ {
"type": "powershell", "type": "powershell",
"environment_vars": [ "environment_vars": [
@@ -357,6 +351,7 @@
"pwsh -File '{{user `image_folder`}}\\SoftwareReport\\SoftwareReport.Generator.ps1'" "pwsh -File '{{user `image_folder`}}\\SoftwareReport\\SoftwareReport.Generator.ps1'"
], ],
"environment_vars": [ "environment_vars": [
"IMAGE_VERSION={{user `image_version`}}",
"TOOLSET_JSON_PATH={{user `toolset_json_path`}}" "TOOLSET_JSON_PATH={{user `toolset_json_path`}}"
] ]
}, },

View File

@@ -112,7 +112,8 @@
{ {
"type": "powershell", "type": "powershell",
"environment_vars": [ "environment_vars": [
"ImageVersion={{user `image_version`}}", "IMAGE_VERSION={{user `image_version`}}",
"IMAGE_OS={{user `image_os`}}",
"TOOLSET_JSON_PATH={{user `toolset_json_path`}}", "TOOLSET_JSON_PATH={{user `toolset_json_path`}}",
"PSMODULES_ROOT_FOLDER={{user `psmodules_root_folder`}}" "PSMODULES_ROOT_FOLDER={{user `psmodules_root_folder`}}"
], ],
@@ -138,13 +139,6 @@
"{{ template_dir }}/scripts/Installers/Install-ContainersFeature.ps1" "{{ 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", "type": "windows-restart",
"restart_timeout": "10m" "restart_timeout": "10m"
@@ -350,6 +344,7 @@
"pwsh -File '{{user `image_folder`}}\\SoftwareReport\\SoftwareReport.Generator.ps1'" "pwsh -File '{{user `image_folder`}}\\SoftwareReport\\SoftwareReport.Generator.ps1'"
], ],
"environment_vars": [ "environment_vars": [
"IMAGE_VERSION={{user `image_version`}}",
"TOOLSET_JSON_PATH={{user `toolset_json_path`}}" "TOOLSET_JSON_PATH={{user `toolset_json_path`}}"
] ]
}, },