From 3e90bb832a481b3ef1539a1d2b8238f9af78acce Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov Date: Mon, 14 Sep 2020 11:31:41 +0300 Subject: [PATCH] fix environment variable --- .../scripts/SoftwareReport/SoftwareReport.Databases.psm1 | 4 ++-- .../scripts/SoftwareReport/SoftwareReport.Generator.ps1 | 4 ++-- images/linux/ubuntu1604.json | 5 +++-- images/linux/ubuntu1804.json | 5 +++-- images/linux/ubuntu2004.json | 5 +++-- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Databases.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Databases.psm1 index e6c14381e..7c1605ccc 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Databases.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Databases.psm1 @@ -13,7 +13,7 @@ function Get-SqliteVersion { return "sqlite3 $sqliteVersion" } -function Get-MySqlVersion { +function Get-MySQLVersion { $mySqlVersion = (mysql --version).Split("/usr/bin/")[1] return "MySQL ($mySqlVersion)" } @@ -23,7 +23,7 @@ function Build-MySQLSection { $output += New-MDHeader "MySQL" -Level 4 $output += New-MDList -Style Unordered -Lines @( - (Get-MySqlVersion), + (Get-MySQLVersion ), "MySQL Server (user:root password:root)", "MS SQL Server Client Tools" ) diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index 6a252f407..ac23a6deb 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -4,7 +4,7 @@ param ( ) # Install MarkdownPS module for software report generation -Install-Module MarkdownPS -Force -Scope CurrentUser +Install-Module MarkdownPS -Force Import-Module MarkdownPS Import-Module (Join-Path $PSScriptRoot "SoftwareReport.CachedTools.psm1") -DisableNameChecking Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Common.psm1") -DisableNameChecking @@ -28,7 +28,7 @@ $OSName = Get-OSName $markdown += New-MDHeader "$OSName" -Level 1 $markdown += New-MDList -Style Unordered -Lines @( - "Image Version: $env:ImageVersion" + "Image Version: $env:IMAGE_VERSION" ) $markdown += New-MDHeader "Installed Software" -Level 2 diff --git a/images/linux/ubuntu1604.json b/images/linux/ubuntu1604.json index 7ef3122a6..7d180a0a4 100644 --- a/images/linux/ubuntu1604.json +++ b/images/linux/ubuntu1604.json @@ -293,11 +293,12 @@ "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" }, { - "type": "powershell", + "type": "shell", "inline": [ - "pwsh -File '{{user `image_folder`}}/SoftwareReport/SoftwareReport.Generator.ps1' -OutputDirectory '{{user `image_folder`}}'" + "sudo pwsh -File {{user `image_folder`}}/SoftwareReport/SoftwareReport.Generator.ps1 -OutputDirectory {{user `image_folder`}}" ], "environment_vars":[ + "IMAGE_VERSION={{user `image_version`}}", "INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}", "ANNOUNCEMENTS={{user `announcements`}}" ] diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index 5f280636d..c5265b9fa 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -297,11 +297,12 @@ "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" }, { - "type": "powershell", + "type": "shell", "inline": [ - "pwsh -File '{{user `image_folder`}}/SoftwareReport/SoftwareReport.Generator.ps1' -OutputDirectory '{{user `image_folder`}}'" + "sudo pwsh -File {{user `image_folder`}}/SoftwareReport/SoftwareReport.Generator.ps1 -OutputDirectory {{user `image_folder`}}" ], "environment_vars":[ + "IMAGE_VERSION={{user `image_version`}}", "INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}", "ANNOUNCEMENTS={{user `announcements`}}" ] diff --git a/images/linux/ubuntu2004.json b/images/linux/ubuntu2004.json index 604b863a2..eccace5ff 100644 --- a/images/linux/ubuntu2004.json +++ b/images/linux/ubuntu2004.json @@ -299,11 +299,12 @@ "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" }, { - "type": "powershell", + "type": "shell", "inline": [ - "pwsh -File '{{user `image_folder`}}/SoftwareReport/SoftwareReport.Generator.ps1' -OutputDirectory '{{user `image_folder`}}'" + "sudo pwsh -File {{user `image_folder`}}/SoftwareReport/SoftwareReport.Generator.ps1 -OutputDirectory {{user `image_folder`}}" ], "environment_vars":[ + "IMAGE_VERSION={{user `image_version`}}", "INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}", "ANNOUNCEMENTS={{user `announcements`}}" ]