mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 14:17:22 +00:00
* create packer.sh deployment file Copy from terraform.sh * add packer.sh to provisioner add packer.sh script to provisioner to install packer. * add packer.sh to provisioner Add packer.sh script to provisioner to install packer * remove blank lines removed blank lines as requested in feedback by alepauly. * remove additional blank lines * Add Install-Packer.ps1 This script installs packer on Windows through chocolatey * Create Validate-Packer.ps1 This script validates the installation of Packer from Install-Packer.ps1 and adds the software details to the markdown files. * Add Packer install and validate script Added Packer install script and validate script to provisioners. * Add Packer install script and validation script Add Packer install and validation script to provisioners.
This commit is contained in:
25
images/linux/scripts/installers/packer.sh
Normal file
25
images/linux/scripts/installers/packer.sh
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
################################################################################
|
||||||
|
## File: packer.sh
|
||||||
|
## Desc: Installs packer
|
||||||
|
################################################################################
|
||||||
|
# Source the helpers for use with the script
|
||||||
|
source $HELPER_SCRIPTS/document.sh
|
||||||
|
source $HELPER_SCRIPTS/apt.sh
|
||||||
|
|
||||||
|
# Install Packer
|
||||||
|
PACKER_VERSION=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/packer | jq -r .current_version)
|
||||||
|
curl -LO "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip"
|
||||||
|
unzip "packer_${PACKER_VERSION}_linux_amd64.zip" -d /usr/local/bin
|
||||||
|
rm -f "packer_${PACKER_VERSION}_linux_amd64.zip"
|
||||||
|
|
||||||
|
# Run tests to determine that the software installed as expected
|
||||||
|
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
||||||
|
if ! command -v packer; then
|
||||||
|
echo "Packer was not installed or found on PATH"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Document what was added to the image
|
||||||
|
echo "Lastly, documenting what we added to the metadata file"
|
||||||
|
DocumentInstalledItem "Packer ($(packer --version))"
|
||||||
@@ -166,6 +166,7 @@
|
|||||||
"{{template_dir}}/scripts/installers/sphinx.sh",
|
"{{template_dir}}/scripts/installers/sphinx.sh",
|
||||||
"{{template_dir}}/scripts/installers/subversion.sh",
|
"{{template_dir}}/scripts/installers/subversion.sh",
|
||||||
"{{template_dir}}/scripts/installers/terraform.sh",
|
"{{template_dir}}/scripts/installers/terraform.sh",
|
||||||
|
"{{template_dir}}/scripts/installers/packer.sh",
|
||||||
"{{template_dir}}/scripts/installers/vcpkg.sh",
|
"{{template_dir}}/scripts/installers/vcpkg.sh",
|
||||||
"{{template_dir}}/scripts/installers/zeit-now.sh",
|
"{{template_dir}}/scripts/installers/zeit-now.sh",
|
||||||
"{{template_dir}}/scripts/installers/updatepath.sh",
|
"{{template_dir}}/scripts/installers/updatepath.sh",
|
||||||
|
|||||||
@@ -169,6 +169,7 @@
|
|||||||
"{{template_dir}}/scripts/installers/sphinx.sh",
|
"{{template_dir}}/scripts/installers/sphinx.sh",
|
||||||
"{{template_dir}}/scripts/installers/subversion.sh",
|
"{{template_dir}}/scripts/installers/subversion.sh",
|
||||||
"{{template_dir}}/scripts/installers/terraform.sh",
|
"{{template_dir}}/scripts/installers/terraform.sh",
|
||||||
|
"{{template_dir}}/scripts/installers/packer.sh",
|
||||||
"{{template_dir}}/scripts/installers/vcpkg.sh",
|
"{{template_dir}}/scripts/installers/vcpkg.sh",
|
||||||
"{{template_dir}}/scripts/installers/zeit-now.sh",
|
"{{template_dir}}/scripts/installers/zeit-now.sh",
|
||||||
"{{template_dir}}/scripts/installers/updatepath.sh",
|
"{{template_dir}}/scripts/installers/updatepath.sh",
|
||||||
|
|||||||
@@ -282,6 +282,12 @@
|
|||||||
"scripts":[
|
"scripts":[
|
||||||
"{{ template_dir }}/scripts/Installers/Install-7zip.ps1"
|
"{{ template_dir }}/scripts/Installers/Install-7zip.ps1"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "powershell",
|
||||||
|
"scripts":[
|
||||||
|
"{{ template_dir }}/scripts/Installers/Install-Packer.ps1"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "file",
|
"type": "file",
|
||||||
@@ -777,6 +783,12 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Validate-7zip.ps1"
|
"{{ template_dir }}/scripts/Installers/Validate-7zip.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "powershell",
|
||||||
|
"scripts":[
|
||||||
|
"{{ template_dir }}/scripts/Installers/Validate-Packer.ps1"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
"scripts":[
|
"scripts":[
|
||||||
|
|||||||
@@ -252,6 +252,12 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Install-7zip.ps1"
|
"{{ template_dir }}/scripts/Installers/Install-7zip.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "powershell",
|
||||||
|
"scripts":[
|
||||||
|
"{{ template_dir }}/scripts/Installers/Install-Packer.ps1"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"source": "{{template_dir}}/toolcache-2019.json",
|
"source": "{{template_dir}}/toolcache-2019.json",
|
||||||
@@ -745,6 +751,12 @@
|
|||||||
"scripts":[
|
"scripts":[
|
||||||
"{{ template_dir }}/scripts/Installers/Validate-7zip.ps1"
|
"{{ template_dir }}/scripts/Installers/Validate-7zip.ps1"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "powershell",
|
||||||
|
"scripts":[
|
||||||
|
"{{ template_dir }}/scripts/Installers/Validate-Packer.ps1"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
|
|||||||
6
images/win/scripts/Installers/Install-Packer.ps1
Normal file
6
images/win/scripts/Installers/Install-Packer.ps1
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
################################################################################
|
||||||
|
## File: Install-Packer.ps1
|
||||||
|
## Desc: Install Packer
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
choco install packer -y
|
||||||
24
images/win/scripts/Installers/Validate-Packer.ps1
Normal file
24
images/win/scripts/Installers/Validate-Packer.ps1
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
################################################################################
|
||||||
|
## File: Validate-Packer.ps1
|
||||||
|
## Desc: Validate Packer
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
if (Get-Command -Name 'packer')
|
||||||
|
{
|
||||||
|
Write-Host "Packer is on path"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Write-Host 'Packer is not on path'
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Adding description of the software to Markdown
|
||||||
|
$SoftwareName = "Packer"
|
||||||
|
$PackerVersion = (packer version).Split("")
|
||||||
|
|
||||||
|
$Description = @"
|
||||||
|
_Version:_ $PackerVersion.Item(1)<br/>
|
||||||
|
"@
|
||||||
|
|
||||||
|
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||||
Reference in New Issue
Block a user