mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-14 13:56:47 +00:00
install powershell modules
This commit is contained in:
@@ -14,8 +14,8 @@ function Get-SqliteVersion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Get-MySQLVersion {
|
function Get-MySQLVersion {
|
||||||
$mySqlVersion = (mysql --version).Split("/usr/bin/")[1]
|
$mySQLVersion = mysqld --version | Take-OutputPart -Part 2 | Take-OutputPart -Part 0 -Delimiter "-"
|
||||||
return "MySQL ($mySqlVersion)"
|
return "MySQL ($mySQLVersion)"
|
||||||
}
|
}
|
||||||
|
|
||||||
function Build-MySQLSection {
|
function Build-MySQLSection {
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
|
function Get-ToolsetContent
|
||||||
|
{
|
||||||
|
$toolset = Join-Path $env:INSTALLER_SCRIPT_FOLDER "toolset.json"
|
||||||
|
Get-Content $toolset -Raw | ConvertFrom-Json
|
||||||
|
}
|
||||||
|
|
||||||
|
# Specifies the installation policy
|
||||||
|
Set-PSRepository -InstallationPolicy Trusted -Name PSGallery
|
||||||
|
|
||||||
|
# Install PowerShell modules
|
||||||
|
$modules = (Get-ToolsetContent).powershellModules
|
||||||
|
|
||||||
|
foreach($module in $modules)
|
||||||
|
{
|
||||||
|
$moduleName = $module.name
|
||||||
|
Write-Host "Installing ${moduleName} module"
|
||||||
|
|
||||||
|
if ($module.versions)
|
||||||
|
{
|
||||||
|
foreach ($version in $module.versions)
|
||||||
|
{
|
||||||
|
Write-Host " - $version"
|
||||||
|
Install-Module -Name $moduleName -RequiredVersion $version -Scope AllUsers -SkipPublisherCheck -Force
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
Install-Module -Name $moduleName -Scope AllUsers -SkipPublisherCheck -Force
|
||||||
|
}
|
||||||
@@ -91,6 +91,10 @@
|
|||||||
"platform-tools"
|
"platform-tools"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"powershellModules": [
|
||||||
|
{"name": "MarkdownPS"},
|
||||||
|
{"name": "Pester"}
|
||||||
|
],
|
||||||
"azureModules": [
|
"azureModules": [
|
||||||
{
|
{
|
||||||
"name": "az",
|
"name": "az",
|
||||||
|
|||||||
@@ -87,6 +87,10 @@
|
|||||||
"platform-tools"
|
"platform-tools"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"powershellModules": [
|
||||||
|
{"name": "MarkdownPS"},
|
||||||
|
{"name": "Pester"}
|
||||||
|
],
|
||||||
"azureModules": [
|
"azureModules": [
|
||||||
{
|
{
|
||||||
"name": "az",
|
"name": "az",
|
||||||
|
|||||||
@@ -68,6 +68,10 @@
|
|||||||
"platform-tools"
|
"platform-tools"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"powershellModules": [
|
||||||
|
{"name": "MarkdownPS"},
|
||||||
|
{"name": "Pester"}
|
||||||
|
],
|
||||||
"apt": {
|
"apt": {
|
||||||
"common_packages": [
|
"common_packages": [
|
||||||
"dbus",
|
"dbus",
|
||||||
|
|||||||
@@ -292,10 +292,20 @@
|
|||||||
],
|
],
|
||||||
"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": [
|
||||||
"sudo 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`}}"
|
||||||
],
|
],
|
||||||
"environment_vars":[
|
"environment_vars":[
|
||||||
"IMAGE_VERSION={{user `image_version`}}",
|
"IMAGE_VERSION={{user `image_version`}}",
|
||||||
|
|||||||
@@ -296,10 +296,20 @@
|
|||||||
],
|
],
|
||||||
"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": [
|
||||||
"sudo 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`}}"
|
||||||
],
|
],
|
||||||
"environment_vars":[
|
"environment_vars":[
|
||||||
"IMAGE_VERSION={{user `image_version`}}",
|
"IMAGE_VERSION={{user `image_version`}}",
|
||||||
|
|||||||
@@ -298,10 +298,20 @@
|
|||||||
],
|
],
|
||||||
"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": [
|
||||||
"sudo 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`}}"
|
||||||
],
|
],
|
||||||
"environment_vars":[
|
"environment_vars":[
|
||||||
"IMAGE_VERSION={{user `image_version`}}",
|
"IMAGE_VERSION={{user `image_version`}}",
|
||||||
|
|||||||
Reference in New Issue
Block a user