mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 21:38:13 +00:00
[Ubuntu] Implement first Pester tests (#2270)
* implement first pester tests * add comment for azcopy test * remove extra importing and old function * resolve comments * fix typo
This commit is contained in:
committed by
GitHub
parent
be672cb22c
commit
2b93b03377
@@ -1,9 +1,3 @@
|
|||||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Helpers.psm1") -DisableNameChecking
|
|
||||||
|
|
||||||
function Get-OSName {
|
|
||||||
lsb_release -ds
|
|
||||||
}
|
|
||||||
|
|
||||||
function Get-BashVersion {
|
function Get-BashVersion {
|
||||||
$version = bash -c 'echo ${BASH_VERSION}'
|
$version = bash -c 'echo ${BASH_VERSION}'
|
||||||
return "Bash $version"
|
return "Bash $version"
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Browsers.psm1") -DisableN
|
|||||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.CachedTools.psm1") -DisableNameChecking
|
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.CachedTools.psm1") -DisableNameChecking
|
||||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Common.psm1") -DisableNameChecking
|
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Common.psm1") -DisableNameChecking
|
||||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Databases.psm1") -DisableNameChecking
|
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Databases.psm1") -DisableNameChecking
|
||||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Helpers.psm1") -DisableNameChecking
|
Import-Module "$PSScriptRoot/../helpers/SoftwareReport.Helpers.psm1" -DisableNameChecking
|
||||||
|
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" -DisableNameChecking
|
||||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Java.psm1") -DisableNameChecking
|
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Java.psm1") -DisableNameChecking
|
||||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Rust.psm1") -DisableNameChecking
|
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Rust.psm1") -DisableNameChecking
|
||||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Tools.psm1") -DisableNameChecking
|
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Tools.psm1") -DisableNameChecking
|
||||||
|
|||||||
@@ -13,16 +13,8 @@ function Get-CommandResult {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Take-OutputPart {
|
function Get-OSName {
|
||||||
param (
|
lsb_release -ds
|
||||||
[Parameter(ValueFromPipeline)]
|
|
||||||
[string] $toolOutput,
|
|
||||||
[string] $Delimiter = " ",
|
|
||||||
[int[]] $Part
|
|
||||||
)
|
|
||||||
$parts = $toolOutput.Split($Delimiter, [System.StringSplitOptions]::RemoveEmptyEntries)
|
|
||||||
$selectedParts = $parts[$Part]
|
|
||||||
return [string]::Join($Delimiter, $selectedParts)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Test-IsUbuntu16 {
|
function Test-IsUbuntu16 {
|
||||||
@@ -41,15 +33,3 @@ function Get-ToolsetContent {
|
|||||||
$toolset = Join-Path $env:INSTALLER_SCRIPT_FOLDER "toolset.json"
|
$toolset = Join-Path $env:INSTALLER_SCRIPT_FOLDER "toolset.json"
|
||||||
Get-Content $toolset -Raw | ConvertFrom-Json
|
Get-Content $toolset -Raw | ConvertFrom-Json
|
||||||
}
|
}
|
||||||
|
|
||||||
function New-MDNewLine {
|
|
||||||
param (
|
|
||||||
[int] $Count = 1
|
|
||||||
)
|
|
||||||
$newLineSymbol = [System.Environment]::NewLine
|
|
||||||
return $newLineSymbol * $Count
|
|
||||||
}
|
|
||||||
|
|
||||||
function Restore-UserOwner {
|
|
||||||
sudo chown -R ${env:USER}: $env:HOME
|
|
||||||
}
|
|
||||||
23
images/linux/scripts/helpers/SoftwareReport.Helpers.psm1
Normal file
23
images/linux/scripts/helpers/SoftwareReport.Helpers.psm1
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
function Take-OutputPart {
|
||||||
|
param (
|
||||||
|
[Parameter(ValueFromPipeline)]
|
||||||
|
[string] $toolOutput,
|
||||||
|
[string] $Delimiter = " ",
|
||||||
|
[int[]] $Part
|
||||||
|
)
|
||||||
|
$parts = $toolOutput.Split($Delimiter, [System.StringSplitOptions]::RemoveEmptyEntries)
|
||||||
|
$selectedParts = $parts[$Part]
|
||||||
|
return [string]::Join($Delimiter, $selectedParts)
|
||||||
|
}
|
||||||
|
|
||||||
|
function New-MDNewLine {
|
||||||
|
param (
|
||||||
|
[int] $Count = 1
|
||||||
|
)
|
||||||
|
$newLineSymbol = [System.Environment]::NewLine
|
||||||
|
return $newLineSymbol * $Count
|
||||||
|
}
|
||||||
|
|
||||||
|
function Restore-UserOwner {
|
||||||
|
sudo chown -R ${env:USER}: $env:HOME
|
||||||
|
}
|
||||||
67
images/linux/scripts/helpers/Tests.Helpers.psm1
Normal file
67
images/linux/scripts/helpers/Tests.Helpers.psm1
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" -DisableNameChecking
|
||||||
|
|
||||||
|
# Validates that tool is installed and in PATH
|
||||||
|
function Validate-ToolExist($tool) {
|
||||||
|
Get-Command $tool -ErrorAction SilentlyContinue | Should -BeTrue
|
||||||
|
}
|
||||||
|
|
||||||
|
function Invoke-PesterTests {
|
||||||
|
Param(
|
||||||
|
[Parameter(Mandatory)][string] $TestFile,
|
||||||
|
[string] $TestName
|
||||||
|
)
|
||||||
|
|
||||||
|
$testPath = "/imagegeneration/tests/${TestFile}.Tests.ps1"
|
||||||
|
if (-not (Test-Path $testPath)) {
|
||||||
|
throw "Unable to find test file '$TestFile' on '$testPath'."
|
||||||
|
}
|
||||||
|
|
||||||
|
$configuration = [PesterConfiguration] @{
|
||||||
|
Run = @{ Path = $testPath; PassThru = $true }
|
||||||
|
Output = @{ Verbosity = "Detailed" }
|
||||||
|
}
|
||||||
|
if ($TestName) {
|
||||||
|
$configuration.Filter.FullName = $TestName
|
||||||
|
}
|
||||||
|
|
||||||
|
# Switch ErrorActionPreference to Stop temporary to make sure that tests will fail on silent errors too
|
||||||
|
$backupErrorActionPreference = $ErrorActionPreference
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
$results = Invoke-Pester -Configuration $configuration
|
||||||
|
$ErrorActionPreference = $backupErrorActionPreference
|
||||||
|
|
||||||
|
# Fail in case if no tests are run
|
||||||
|
if (-not ($results -and ($results.FailedCount -eq 0) -and ($results.PassedCount -gt 0))) {
|
||||||
|
$results
|
||||||
|
throw "Test run has failed"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function ShouldReturnZeroExitCode {
|
||||||
|
Param(
|
||||||
|
[String] $ActualValue,
|
||||||
|
[switch] $Negate,
|
||||||
|
[string] $Because # This parameter is unused but we need it to match Pester asserts signature
|
||||||
|
)
|
||||||
|
|
||||||
|
$result = Get-CommandResult $ActualValue
|
||||||
|
|
||||||
|
[bool]$succeeded = $result.ExitCode -eq 0
|
||||||
|
if ($Negate) { $succeeded = -not $succeeded }
|
||||||
|
|
||||||
|
if (-not $succeeded)
|
||||||
|
{
|
||||||
|
$commandOutputIndent = " " * 4
|
||||||
|
$commandOutput = ($result.Output | ForEach-Object { "${commandOutputIndent}${_}" }) -join "`n"
|
||||||
|
$failureMessage = "Command '${ActualValue}' has finished with exit code`n${commandOutput}"
|
||||||
|
}
|
||||||
|
|
||||||
|
return [PSCustomObject] @{
|
||||||
|
Succeeded = $succeeded
|
||||||
|
FailureMessage = $failureMessage
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
If (Get-Command -Name Add-AssertionOperator -ErrorAction SilentlyContinue) {
|
||||||
|
Add-AssertionOperator -Name ReturnZeroExitCode -InternalName ShouldReturnZeroExitCode -Test ${function:ShouldReturnZeroExitCode}
|
||||||
|
}
|
||||||
13
images/linux/scripts/helpers/invoke-tests.sh
Normal file
13
images/linux/scripts/helpers/invoke-tests.sh
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash -e
|
||||||
|
################################################################################
|
||||||
|
## File: invoke-tests.sh
|
||||||
|
## Desc: Helper function for invoking tests
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
invoke_tests() {
|
||||||
|
local TEST_FILE="$1"
|
||||||
|
local TEST_NAME="$2"
|
||||||
|
|
||||||
|
pwsh -Command "Import-Module '$HELPER_SCRIPTS/Tests.Helpers.psm1' -DisableNameChecking
|
||||||
|
Invoke-PesterTests -TestFile $TEST_FILE -TestName $TEST_NAME"
|
||||||
|
}
|
||||||
@@ -4,13 +4,11 @@
|
|||||||
## Desc: Installs 7-zip
|
## Desc: Installs 7-zip
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
source $HELPER_SCRIPTS/invoke-tests.sh
|
||||||
|
|
||||||
# Install 7-Zip
|
# Install 7-Zip
|
||||||
apt-get update -y
|
apt-get update -y
|
||||||
apt-get install -y p7zip p7zip-full p7zip-rar
|
apt-get install -y p7zip p7zip-full p7zip-rar
|
||||||
|
|
||||||
# Run tests to determine that the software installed as expected
|
# Run tests to determine that the software installed as expected
|
||||||
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
invoke_tests "Tools" "7-Zip"
|
||||||
if ! command -v 7z; then
|
|
||||||
echo "7-Zip was not installed"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
@@ -4,6 +4,8 @@
|
|||||||
## Desc: Installs AzCopy
|
## Desc: Installs AzCopy
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
source $HELPER_SCRIPTS/invoke-tests.sh
|
||||||
|
|
||||||
# Install AzCopy7
|
# Install AzCopy7
|
||||||
wget -O azcopy.tar.gz https://aka.ms/downloadazcopylinux64
|
wget -O azcopy.tar.gz https://aka.ms/downloadazcopylinux64
|
||||||
tar -xf azcopy.tar.gz
|
tar -xf azcopy.tar.gz
|
||||||
@@ -17,13 +19,4 @@ mv /tmp/azcopy /usr/local/bin/azcopy10
|
|||||||
chmod +x /usr/local/bin/azcopy10
|
chmod +x /usr/local/bin/azcopy10
|
||||||
|
|
||||||
# Run tests to determine that the software installed as expected
|
# Run tests to determine that the software installed as expected
|
||||||
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
invoke_tests "Tools" "azcopy"
|
||||||
if ! command -v azcopy; then
|
|
||||||
echo "azcopy7 was not installed"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! command -v azcopy10; then
|
|
||||||
echo "azcopy10 was not installed"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
3
images/linux/scripts/tests/RunAll-Tests.ps1
Normal file
3
images/linux/scripts/tests/RunAll-Tests.ps1
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking
|
||||||
|
|
||||||
|
Invoke-PesterTests "*"
|
||||||
17
images/linux/scripts/tests/Tools.Tests.ps1
Normal file
17
images/linux/scripts/tests/Tools.Tests.ps1
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
Describe "7-Zip" {
|
||||||
|
It "7z" {
|
||||||
|
"7z" | Should -ReturnZeroExitCode
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Describe "azcopy" {
|
||||||
|
It "azcopy" {
|
||||||
|
#(azcopy --version) command returns exit code 1 (see details: https://github.com/Azure/azure-storage-azcopy/releases)
|
||||||
|
$azcopyVersion = (Get-CommandResult "azcopy --version").Output
|
||||||
|
$azcopyVersion | Should -BeLike "*azcopy*"
|
||||||
|
}
|
||||||
|
|
||||||
|
It "azcopy10" {
|
||||||
|
"azcopy10 --version" | Should -ReturnZeroExitCode
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -99,6 +99,11 @@
|
|||||||
"source": "{{ template_dir }}/post-generation",
|
"source": "{{ template_dir }}/post-generation",
|
||||||
"destination": "{{user `image_folder`}}"
|
"destination": "{{user `image_folder`}}"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"source": "{{template_dir}}/scripts/tests",
|
||||||
|
"destination": "{{user `image_folder`}}"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"source": "{{ template_dir }}/scripts/SoftwareReport",
|
"source": "{{ template_dir }}/scripts/SoftwareReport",
|
||||||
@@ -141,6 +146,23 @@
|
|||||||
],
|
],
|
||||||
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"scripts": [
|
||||||
|
"{{template_dir}}/scripts/installers/powershellcore.sh"
|
||||||
|
],
|
||||||
|
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"scripts": [
|
||||||
|
"{{template_dir}}/scripts/installers/Install-PowerShellModules.ps1"
|
||||||
|
],
|
||||||
|
"environment_vars": [
|
||||||
|
"INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}"
|
||||||
|
],
|
||||||
|
"execute_command": "sudo sh -c '{{ .Vars }} pwsh -f {{ .Path }}'"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"scripts": [
|
"scripts": [
|
||||||
@@ -190,7 +212,6 @@
|
|||||||
"{{template_dir}}/scripts/installers/php.sh",
|
"{{template_dir}}/scripts/installers/php.sh",
|
||||||
"{{template_dir}}/scripts/installers/pollinate.sh",
|
"{{template_dir}}/scripts/installers/pollinate.sh",
|
||||||
"{{template_dir}}/scripts/installers/postgresql.sh",
|
"{{template_dir}}/scripts/installers/postgresql.sh",
|
||||||
"{{template_dir}}/scripts/installers/powershellcore.sh",
|
|
||||||
"{{template_dir}}/scripts/installers/pulumi.sh",
|
"{{template_dir}}/scripts/installers/pulumi.sh",
|
||||||
"{{template_dir}}/scripts/installers/ruby.sh",
|
"{{template_dir}}/scripts/installers/ruby.sh",
|
||||||
"{{template_dir}}/scripts/installers/r.sh",
|
"{{template_dir}}/scripts/installers/r.sh",
|
||||||
@@ -285,20 +306,11 @@
|
|||||||
"script": "{{template_dir}}/scripts/base/apt-mock-remove.sh",
|
"script": "{{template_dir}}/scripts/base/apt-mock-remove.sh",
|
||||||
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "shell",
|
|
||||||
"scripts": [
|
|
||||||
"{{template_dir}}/scripts/installers/Install-PowerShellModules.ps1"
|
|
||||||
],
|
|
||||||
"environment_vars": [
|
|
||||||
"INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}"
|
|
||||||
],
|
|
||||||
"execute_command": "sudo sh -c '{{ .Vars }} pwsh -f {{ .Path }}'"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"inline": [
|
"inline": [
|
||||||
"pwsh -File {{user `image_folder`}}/SoftwareReport/SoftwareReport.Generator.ps1 -OutputDirectory {{user `image_folder`}}"
|
"pwsh -File {{user `image_folder`}}/SoftwareReport/SoftwareReport.Generator.ps1 -OutputDirectory {{user `image_folder`}}",
|
||||||
|
"pwsh -File {{user `image_folder`}}/tests/RunAll-Tests.ps1 -OutputDirectory {{user `image_folder`}}"
|
||||||
],
|
],
|
||||||
"environment_vars": [
|
"environment_vars": [
|
||||||
"IMAGE_VERSION={{user `image_version`}}",
|
"IMAGE_VERSION={{user `image_version`}}",
|
||||||
|
|||||||
@@ -102,6 +102,11 @@
|
|||||||
"source": "{{ template_dir }}/post-generation",
|
"source": "{{ template_dir }}/post-generation",
|
||||||
"destination": "{{user `image_folder`}}"
|
"destination": "{{user `image_folder`}}"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"source": "{{template_dir}}/scripts/tests",
|
||||||
|
"destination": "{{user `image_folder`}}"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"source": "{{ template_dir }}/scripts/SoftwareReport",
|
"source": "{{ template_dir }}/scripts/SoftwareReport",
|
||||||
@@ -144,6 +149,23 @@
|
|||||||
],
|
],
|
||||||
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"scripts": [
|
||||||
|
"{{template_dir}}/scripts/installers/powershellcore.sh"
|
||||||
|
],
|
||||||
|
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"scripts": [
|
||||||
|
"{{template_dir}}/scripts/installers/Install-PowerShellModules.ps1"
|
||||||
|
],
|
||||||
|
"environment_vars": [
|
||||||
|
"INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}"
|
||||||
|
],
|
||||||
|
"execute_command": "sudo sh -c '{{ .Vars }} pwsh -f {{ .Path }}'"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"scripts": [
|
"scripts": [
|
||||||
@@ -194,7 +216,6 @@
|
|||||||
"{{template_dir}}/scripts/installers/php.sh",
|
"{{template_dir}}/scripts/installers/php.sh",
|
||||||
"{{template_dir}}/scripts/installers/pollinate.sh",
|
"{{template_dir}}/scripts/installers/pollinate.sh",
|
||||||
"{{template_dir}}/scripts/installers/postgresql.sh",
|
"{{template_dir}}/scripts/installers/postgresql.sh",
|
||||||
"{{template_dir}}/scripts/installers/powershellcore.sh",
|
|
||||||
"{{template_dir}}/scripts/installers/pulumi.sh",
|
"{{template_dir}}/scripts/installers/pulumi.sh",
|
||||||
"{{template_dir}}/scripts/installers/ruby.sh",
|
"{{template_dir}}/scripts/installers/ruby.sh",
|
||||||
"{{template_dir}}/scripts/installers/r.sh",
|
"{{template_dir}}/scripts/installers/r.sh",
|
||||||
@@ -289,20 +310,11 @@
|
|||||||
"script": "{{template_dir}}/scripts/base/apt-mock-remove.sh",
|
"script": "{{template_dir}}/scripts/base/apt-mock-remove.sh",
|
||||||
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "shell",
|
|
||||||
"scripts": [
|
|
||||||
"{{template_dir}}/scripts/installers/Install-PowerShellModules.ps1"
|
|
||||||
],
|
|
||||||
"environment_vars": [
|
|
||||||
"INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}"
|
|
||||||
],
|
|
||||||
"execute_command": "sudo sh -c '{{ .Vars }} pwsh -f {{ .Path }}'"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"inline": [
|
"inline": [
|
||||||
"pwsh -File {{user `image_folder`}}/SoftwareReport/SoftwareReport.Generator.ps1 -OutputDirectory {{user `image_folder`}}"
|
"pwsh -File {{user `image_folder`}}/SoftwareReport/SoftwareReport.Generator.ps1 -OutputDirectory {{user `image_folder`}}",
|
||||||
|
"pwsh -File {{user `image_folder`}}/tests/RunAll-Tests.ps1 -OutputDirectory {{user `image_folder`}}"
|
||||||
],
|
],
|
||||||
"environment_vars": [
|
"environment_vars": [
|
||||||
"IMAGE_VERSION={{user `image_version`}}",
|
"IMAGE_VERSION={{user `image_version`}}",
|
||||||
|
|||||||
@@ -104,6 +104,11 @@
|
|||||||
"source": "{{ template_dir }}/post-generation",
|
"source": "{{ template_dir }}/post-generation",
|
||||||
"destination": "{{user `image_folder`}}"
|
"destination": "{{user `image_folder`}}"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"source": "{{template_dir}}/scripts/tests",
|
||||||
|
"destination": "{{user `image_folder`}}"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"source": "{{ template_dir }}/scripts/SoftwareReport",
|
"source": "{{ template_dir }}/scripts/SoftwareReport",
|
||||||
@@ -146,6 +151,23 @@
|
|||||||
],
|
],
|
||||||
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"scripts": [
|
||||||
|
"{{template_dir}}/scripts/installers/powershellcore.sh"
|
||||||
|
],
|
||||||
|
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"scripts": [
|
||||||
|
"{{template_dir}}/scripts/installers/Install-PowerShellModules.ps1"
|
||||||
|
],
|
||||||
|
"environment_vars": [
|
||||||
|
"INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}"
|
||||||
|
],
|
||||||
|
"execute_command": "sudo sh -c '{{ .Vars }} pwsh -f {{ .Path }}'"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"scripts": [
|
"scripts": [
|
||||||
@@ -196,7 +218,6 @@
|
|||||||
"{{template_dir}}/scripts/installers/php.sh",
|
"{{template_dir}}/scripts/installers/php.sh",
|
||||||
"{{template_dir}}/scripts/installers/pollinate.sh",
|
"{{template_dir}}/scripts/installers/pollinate.sh",
|
||||||
"{{template_dir}}/scripts/installers/postgresql.sh",
|
"{{template_dir}}/scripts/installers/postgresql.sh",
|
||||||
"{{template_dir}}/scripts/installers/powershellcore.sh",
|
|
||||||
"{{template_dir}}/scripts/installers/pulumi.sh",
|
"{{template_dir}}/scripts/installers/pulumi.sh",
|
||||||
"{{template_dir}}/scripts/installers/ruby.sh",
|
"{{template_dir}}/scripts/installers/ruby.sh",
|
||||||
"{{template_dir}}/scripts/installers/r.sh",
|
"{{template_dir}}/scripts/installers/r.sh",
|
||||||
@@ -291,20 +312,11 @@
|
|||||||
"script": "{{template_dir}}/scripts/base/apt-mock-remove.sh",
|
"script": "{{template_dir}}/scripts/base/apt-mock-remove.sh",
|
||||||
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "shell",
|
|
||||||
"scripts": [
|
|
||||||
"{{template_dir}}/scripts/installers/Install-PowerShellModules.ps1"
|
|
||||||
],
|
|
||||||
"environment_vars": [
|
|
||||||
"INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}"
|
|
||||||
],
|
|
||||||
"execute_command": "sudo sh -c '{{ .Vars }} pwsh -f {{ .Path }}'"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"inline": [
|
"inline": [
|
||||||
"pwsh -File {{user `image_folder`}}/SoftwareReport/SoftwareReport.Generator.ps1 -OutputDirectory {{user `image_folder`}}"
|
"pwsh -File {{user `image_folder`}}/SoftwareReport/SoftwareReport.Generator.ps1 -OutputDirectory {{user `image_folder`}}",
|
||||||
|
"pwsh -File {{user `image_folder`}}/tests/RunAll-Tests.ps1 -OutputDirectory {{user `image_folder`}}"
|
||||||
],
|
],
|
||||||
"environment_vars": [
|
"environment_vars": [
|
||||||
"IMAGE_VERSION={{user `image_version`}}",
|
"IMAGE_VERSION={{user `image_version`}}",
|
||||||
|
|||||||
Reference in New Issue
Block a user