mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 14:17:22 +00:00
Merge branch 'master' of https://github.com/nikita-bykov/virtual-environments into pipx-windows
This commit is contained in:
2
.github/workflows/issue-triager.yml
vendored
2
.github/workflows/issue-triager.yml
vendored
@@ -32,7 +32,7 @@ jobs:
|
|||||||
|
|
||||||
const isAnnouncement = issueLabels.data && issueLabels.data
|
const isAnnouncement = issueLabels.data && issueLabels.data
|
||||||
.map(label => label.name)
|
.map(label => label.name)
|
||||||
.includes('announcement');
|
.includes('Announcement');
|
||||||
|
|
||||||
if (!isAnnouncement) {
|
if (!isAnnouncement) {
|
||||||
github.issues.addLabels({
|
github.issues.addLabels({
|
||||||
|
|||||||
@@ -42,6 +42,15 @@ jobs:
|
|||||||
SourceFolder: 'images/macos/provision/log/'
|
SourceFolder: 'images/macos/provision/log/'
|
||||||
RemoveSourceFolder: true
|
RemoveSourceFolder: true
|
||||||
|
|
||||||
|
- task: PowerShell@2
|
||||||
|
displayName: 'Select datastore'
|
||||||
|
inputs:
|
||||||
|
targetType: 'filePath'
|
||||||
|
filePath: ./images.CI/macos/select-datastore.ps1
|
||||||
|
arguments: -VIServer "$(vcenter-server-v2)" `
|
||||||
|
-VIUserName "$(vcenter-username-v2)" `
|
||||||
|
-VIPassword "$(vcenter-password-v2)"
|
||||||
|
|
||||||
- pwsh: |
|
- pwsh: |
|
||||||
$SensitiveData = @(
|
$SensitiveData = @(
|
||||||
'IP address:',
|
'IP address:',
|
||||||
@@ -54,7 +63,7 @@ jobs:
|
|||||||
-var="vcenter_password=$(vcenter-password-v2)" `
|
-var="vcenter_password=$(vcenter-password-v2)" `
|
||||||
-var="vcenter_datacenter=$(vcenter-datacenter-v2)" `
|
-var="vcenter_datacenter=$(vcenter-datacenter-v2)" `
|
||||||
-var="cluster_or_esxi_host=$(esxi-cluster-v2)" `
|
-var="cluster_or_esxi_host=$(esxi-cluster-v2)" `
|
||||||
-var="esxi_datastore=${{ parameters.target_datastore }}" `
|
-var="esxi_datastore=$(buildDatastore)" `
|
||||||
-var="output_folder=$(output-folder)" `
|
-var="output_folder=$(output-folder)" `
|
||||||
-var="vm_username=$(vm-username)" `
|
-var="vm_username=$(vm-username)" `
|
||||||
-var="vm_password=$(vm-password)" `
|
-var="vm_password=$(vm-password)" `
|
||||||
@@ -106,6 +115,18 @@ jobs:
|
|||||||
displayName: Publish test results
|
displayName: Publish test results
|
||||||
condition: always()
|
condition: always()
|
||||||
|
|
||||||
|
- task: PowerShell@2
|
||||||
|
displayName: 'Move vm to cold storage'
|
||||||
|
condition: succeededOrFailed()
|
||||||
|
inputs:
|
||||||
|
targetType: 'filePath'
|
||||||
|
filePath: ./images.CI/macos/move-vm.ps1
|
||||||
|
arguments: -VMName "${{ variables.VirtualMachineName }}" `
|
||||||
|
-TargetDataStore "${{ parameters.target_datastore }}" `
|
||||||
|
-VIServer "$(vcenter-server-v2)" `
|
||||||
|
-VIUserName "$(vcenter-username-v2)" `
|
||||||
|
-VIPassword "$(vcenter-password-v2)"
|
||||||
|
|
||||||
- task: PowerShell@2
|
- task: PowerShell@2
|
||||||
displayName: 'Destroy VM (if build canceled only)'
|
displayName: 'Destroy VM (if build canceled only)'
|
||||||
condition: eq(variables['Agent.JobStatus'], 'Canceled')
|
condition: eq(variables['Agent.JobStatus'], 'Canceled')
|
||||||
|
|||||||
@@ -1,3 +1,21 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
This script deletes vm from vCenter
|
||||||
|
|
||||||
|
.PARAMETER VMName
|
||||||
|
VM name to delete (Example "macOS-10.15_20201012.4")
|
||||||
|
|
||||||
|
.PARAMETER VIServer
|
||||||
|
vCenter address (Example "10.0.1.16")
|
||||||
|
|
||||||
|
.PARAMETER VIUserName
|
||||||
|
vCenter username (Example "Administrator")
|
||||||
|
|
||||||
|
.PARAMETER VIPassword
|
||||||
|
vCenter password (Example "12345678")
|
||||||
|
#>
|
||||||
|
|
||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory)]
|
[Parameter(Mandatory)]
|
||||||
@@ -17,25 +35,13 @@ param(
|
|||||||
[string]$VIPassword
|
[string]$VIPassword
|
||||||
)
|
)
|
||||||
|
|
||||||
$ProgressPreference = "SilentlyContinue"
|
# Import helpers module
|
||||||
$WarningPreference = "SilentlyContinue"
|
Import-Module $PSScriptRoot\helpers.psm1 -DisableNameChecking
|
||||||
|
|
||||||
# connection to a vCenter Server system
|
# Connection to a vCenter Server system
|
||||||
try
|
Connect-VCServer
|
||||||
{
|
|
||||||
$null = Set-PowerCLIConfiguration -Scope Session -InvalidCertificateAction Ignore -ParticipateInCEIP $false -Confirm:$false -WebOperationTimeoutSeconds 600
|
|
||||||
$securePassword = ConvertTo-SecureString -String $VIPassword -AsPlainText -Force
|
|
||||||
$cred = New-Object System.Management.Automation.PSCredential($VIUserName, $securePassword)
|
|
||||||
$null = Connect-VIServer -Server $VIServer -Credential $cred -ErrorAction Stop
|
|
||||||
Write-Host "Connection to the vSphere server has been established"
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
Write-Host "##vso[task.LogIssue type=error;]Failed to connect to the vSphere server"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# check vm clone status
|
# Check vm clone status
|
||||||
$chainId = (Get-VIEvent -Entity $VMName).ChainId
|
$chainId = (Get-VIEvent -Entity $VMName).ChainId
|
||||||
if ($chainId)
|
if ($chainId)
|
||||||
{
|
{
|
||||||
@@ -45,7 +51,7 @@ if ($chainId)
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Stop-Task -Task $task -Confirm:$false -ErrorAction Stop
|
Stop-Task -Task $task -Confirm:$false -ErrorAction Stop
|
||||||
Write-Host "The vm '$VMName' clone task has been cancelled"
|
Write-Host "The vm '$VMName' clone task has been canceled"
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@@ -54,7 +60,7 @@ if ($chainId)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# remove a vm
|
# Remove a vm
|
||||||
$vm = Get-VM -Name $VMName -ErrorAction SilentlyContinue
|
$vm = Get-VM -Name $VMName -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
if ($vm)
|
if ($vm)
|
||||||
|
|||||||
26
images.CI/macos/helpers.psm1
Normal file
26
images.CI/macos/helpers.psm1
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
Helper functions to use in images.CI scripts
|
||||||
|
#>
|
||||||
|
|
||||||
|
Function Connect-VCServer
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
# Preference
|
||||||
|
$global:ProgressPreference = 'SilentlyContinue'
|
||||||
|
$global:WarningPreference = 'SilentlyContinue'
|
||||||
|
# Ignore SSL
|
||||||
|
$null = Set-PowerCLIConfiguration -Scope Session -InvalidCertificateAction Ignore -ParticipateInCEIP $false -Confirm:$false -WebOperationTimeoutSeconds 600
|
||||||
|
$securePassword = ConvertTo-SecureString -String $VIPassword -AsPlainText -Force
|
||||||
|
$cred = New-Object System.Management.Automation.PSCredential($VIUserName, $securePassword)
|
||||||
|
$null = Connect-VIServer -Server $VIServer -Credential $cred -ErrorAction Stop
|
||||||
|
Write-Host "Connection to the vSphere server has been established"
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
Write-Host "##vso[task.LogIssue type=error;]Failed to connect to the vSphere server"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
}
|
||||||
59
images.CI/macos/move-vm.ps1
Normal file
59
images.CI/macos/move-vm.ps1
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
This script migrates given VM to another datastore
|
||||||
|
|
||||||
|
.PARAMETER VMName
|
||||||
|
VM name to migrate (Example "macOS-10.15_20201012.4")
|
||||||
|
|
||||||
|
.PARAMETER TargetDataStore
|
||||||
|
Target datastore (Example "ds-image")
|
||||||
|
|
||||||
|
.PARAMETER VIServer
|
||||||
|
vCenter address (Example "10.0.1.16")
|
||||||
|
|
||||||
|
.PARAMETER VIUserName
|
||||||
|
vCenter username (Example "Administrator")
|
||||||
|
|
||||||
|
.PARAMETER VIPassword
|
||||||
|
vCenter password (Example "12345678")
|
||||||
|
#>
|
||||||
|
|
||||||
|
[CmdletBinding()]
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory)]
|
||||||
|
[ValidateNotNullOrEmpty()]
|
||||||
|
[string]$VMName,
|
||||||
|
|
||||||
|
[Parameter(Mandatory)]
|
||||||
|
[ValidateNotNullOrEmpty()]
|
||||||
|
[string]$TargetDataStore,
|
||||||
|
|
||||||
|
[Parameter(Mandatory)]
|
||||||
|
[ValidateNotNullOrEmpty()]
|
||||||
|
[string]$VIServer,
|
||||||
|
|
||||||
|
[Parameter(Mandatory)]
|
||||||
|
[ValidateNotNullOrEmpty()]
|
||||||
|
[string]$VIUserName,
|
||||||
|
|
||||||
|
[Parameter(Mandatory)]
|
||||||
|
[ValidateNotNullOrEmpty()]
|
||||||
|
[string]$VIPassword
|
||||||
|
)
|
||||||
|
|
||||||
|
# Import helpers module
|
||||||
|
Import-Module $PSScriptRoot\helpers.psm1 -DisableNameChecking
|
||||||
|
|
||||||
|
# Connection to a vCenter Server system
|
||||||
|
Connect-VCServer
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Get-VM $VMName | Move-VM -Datastore $TargetDataStore -ErrorAction Stop
|
||||||
|
Write-Host "VM has been moved successfully to target datastore '$TargetDataStore'"
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
Write-Host "##vso[task.LogIssue type=error;]Failed to move VM '$VMName' to target datastore '$TargetDataStore'"
|
||||||
|
}
|
||||||
64
images.CI/macos/select-datastore.ps1
Normal file
64
images.CI/macos/select-datastore.ps1
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
|
||||||
|
This script selects local datastore based on the following rules:
|
||||||
|
|
||||||
|
- Name starts with ds-local-Datastore
|
||||||
|
- Datastore FreespaceGB > 400 Gb
|
||||||
|
- VM count on the datastore < 2
|
||||||
|
|
||||||
|
.PARAMETER VIServer
|
||||||
|
vCenter address (Example "10.0.1.16")
|
||||||
|
|
||||||
|
.PARAMETER VIUserName
|
||||||
|
vCenter username (Example "Administrator")
|
||||||
|
|
||||||
|
.PARAMETER VIPassword
|
||||||
|
vCenter password (Example "12345678")
|
||||||
|
#>
|
||||||
|
|
||||||
|
|
||||||
|
[CmdletBinding()]
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory)]
|
||||||
|
[ValidateNotNullOrEmpty()]
|
||||||
|
[string]$VIServer,
|
||||||
|
|
||||||
|
[Parameter(Mandatory)]
|
||||||
|
[ValidateNotNullOrEmpty()]
|
||||||
|
[string]$VIUserName,
|
||||||
|
|
||||||
|
[Parameter(Mandatory)]
|
||||||
|
[ValidateNotNullOrEmpty()]
|
||||||
|
[string]$VIPassword
|
||||||
|
)
|
||||||
|
|
||||||
|
# Import helpers module
|
||||||
|
Import-Module $PSScriptRoot\helpers.psm1 -DisableNameChecking
|
||||||
|
|
||||||
|
# Connection to a vCenter Server system
|
||||||
|
Connect-VCServer
|
||||||
|
|
||||||
|
# Get a target datastore for current deployment
|
||||||
|
# 1. Name starts with ds-local-Datastore
|
||||||
|
# 2. FreespaceGB > 400 Gb
|
||||||
|
# 3. VM count on a datastore < 2
|
||||||
|
$templateDatastore = "ds-local-Datastore-*"
|
||||||
|
$thresholdInGb = 400
|
||||||
|
$vmCount = 2
|
||||||
|
$allDatastores = Get-Datastore -Name $templateDatastore | Where-Object { $_.State -eq "Available" }
|
||||||
|
$buildDatastore = $allDatastores | Where-Object { $_.FreeSpaceGB -ge $thresholdInGb } | Where-Object {
|
||||||
|
$vmOnDatastore = @((Get-ChildItem -Path $_.DatastoreBrowserPath).Name -notmatch "^\.").Count
|
||||||
|
$vmOnDatastore -lt $vmCount
|
||||||
|
} | Select-Object -ExpandProperty Name -First 1
|
||||||
|
|
||||||
|
if ($buildDatastore)
|
||||||
|
{
|
||||||
|
Write-Host "Datastore selected successfully"
|
||||||
|
Write-Host "##vso[task.setvariable variable=buildDatastore;issecret=true]$buildDatastore"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Write-Host "##vso[task.LogIssue type=error;]No datastores found for the condition"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
11
images/linux/post-generation/homebrew-permissions.sh
Normal file
11
images/linux/post-generation/homebrew-permissions.sh
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Fix permissions for Homebrew
|
||||||
|
# https://github.com/actions/virtual-environments/issues/1568
|
||||||
|
brew_folder="/home/linuxbrew/"
|
||||||
|
if [ -d "$brew_folder" ]; then
|
||||||
|
brew_folder_owner=$(ls -ld $brew_folder | awk '{print $3}')
|
||||||
|
if [ "$USER" != "$brew_folder_owner" ]; then
|
||||||
|
chown "$USER":docker -R $brew_folder
|
||||||
|
fi
|
||||||
|
fi
|
||||||
11
images/linux/post-generation/rust-permissions.sh
Normal file
11
images/linux/post-generation/rust-permissions.sh
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Fix permissions for the Rust folder
|
||||||
|
# https://github.com/actions/virtual-environments/issues/572
|
||||||
|
rust_folder="/usr/share/rust"
|
||||||
|
if [ -d "$rust_folder" ]; then
|
||||||
|
rust_folder_owner=$(ls -ld $rust_folder | awk '{print $3}')
|
||||||
|
if [ "$USER" != "$rust_folder_owner" ]; then
|
||||||
|
chown "$USER":docker -R $rust_folder
|
||||||
|
fi
|
||||||
|
fi
|
||||||
@@ -249,5 +249,7 @@ function Get-AptPackages {
|
|||||||
|
|
||||||
function Get-PipxVersion {
|
function Get-PipxVersion {
|
||||||
$result = (Get-CommandResult "pipx --version").Output
|
$result = (Get-CommandResult "pipx --version").Output
|
||||||
return "Pipx $result"
|
$result -match "(?<version>\d+\.\d+\.\d+\.?\d*)" | Out-Null
|
||||||
|
$pipxVersion = $Matches.Version
|
||||||
|
return "Pipx $pipxVersion"
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
|
|
||||||
echo '* soft nofile 65536' >> /etc/security/limits.conf
|
echo '* soft nofile 65536' >> /etc/security/limits.conf
|
||||||
echo '* hard nofile 65536' >> /etc/security/limits.conf
|
echo '* hard nofile 65536' >> /etc/security/limits.conf
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: reboot.sh
|
## File: reboot.sh
|
||||||
## Desc: Reboot VM
|
## Desc: Reboot VM
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
echo "Reboot VM"
|
echo "Reboot VM"
|
||||||
sudo reboot
|
sudo reboot
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: 7-zip.sh
|
## File: 7-zip.sh
|
||||||
## Desc: Installs 7-zip
|
## Desc: Installs 7-zip
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# 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
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: aliyun-cli.sh
|
## File: aliyun-cli.sh
|
||||||
## Desc: Installs Alibaba Cloud CLI
|
## Desc: Installs Alibaba Cloud CLI
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Install Alibaba Cloud CLI
|
# Install Alibaba Cloud CLI
|
||||||
URL=$(curl -s https://api.github.com/repos/aliyun/aliyun-cli/releases/latest | jq -r '.assets[].browser_download_url | select(contains("aliyun-cli-linux"))')
|
URL=$(curl -s https://api.github.com/repos/aliyun/aliyun-cli/releases/latest | jq -r '.assets[].browser_download_url | select(contains("aliyun-cli-linux"))')
|
||||||
wget -P /tmp $URL
|
wget -P /tmp $URL
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: android.sh
|
## File: android.sh
|
||||||
## Desc: Installs Android SDK
|
## Desc: Installs Android SDK
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# Source the helpers for use with the script
|
# Source the helpers for use with the script
|
||||||
source $HELPER_SCRIPTS/os.sh
|
source $HELPER_SCRIPTS/os.sh
|
||||||
source $HELPER_SCRIPTS/install.sh
|
source $HELPER_SCRIPTS/install.sh
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: ansible.sh
|
## File: ansible.sh
|
||||||
## Desc: Installs Ansible
|
## Desc: Installs Ansible
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: aws-sam-cli.sh
|
## File: aws-sam-cli.sh
|
||||||
## Desc: Installs AWS SAM CLI
|
## Desc: Installs AWS SAM CLI
|
||||||
## Requires Python >=3.6, must be run as non-root user after toolset installation
|
## Requires Python >=3.6, must be run as non-root user after toolset installation
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Download latest aws sam cli sources
|
# Download latest aws sam cli sources
|
||||||
TarballUrl=$(curl -s https://api.github.com/repos/aws/aws-sam-cli/releases/latest | jq -r '.tarball_url')
|
TarballUrl=$(curl -s https://api.github.com/repos/aws/aws-sam-cli/releases/latest | jq -r '.tarball_url')
|
||||||
TarballPath="/tmp/aws-sam-cli.tar.gz"
|
TarballPath="/tmp/aws-sam-cli.tar.gz"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: aws.sh
|
## File: aws.sh
|
||||||
## Desc: Installs the AWS CLI
|
## Desc: Installs the AWS CLI
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: azcopy.sh
|
## File: azcopy.sh
|
||||||
## Desc: Installs AzCopy
|
## Desc: Installs AzCopy
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# 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
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: azpowershell.sh
|
## File: azpowershell.sh
|
||||||
## Desc: Installed Azure PowerShell
|
## Desc: Installed Azure PowerShell
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: azure-cli.sh
|
## File: azure-cli.sh
|
||||||
## Desc: Installed Azure CLI (az)
|
## Desc: Installed Azure CLI (az)
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Install Azure CLI (instructions taken from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
|
# Install Azure CLI (instructions taken from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
|
||||||
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
|
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: azure-devops-cli.sh
|
## File: azure-devops-cli.sh
|
||||||
## Desc: Installed Azure DevOps CLI (az devops)
|
## Desc: Installed Azure DevOps CLI (az devops)
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# AZURE_EXTENSION_DIR shell variable defines where modules are installed
|
# AZURE_EXTENSION_DIR shell variable defines where modules are installed
|
||||||
# https://docs.microsoft.com/en-us/cli/azure/azure-cli-extensions-overview
|
# https://docs.microsoft.com/en-us/cli/azure/azure-cli-extensions-overview
|
||||||
export AZURE_EXTENSION_DIR=/opt/az/azcliextensions
|
export AZURE_EXTENSION_DIR=/opt/az/azcliextensions
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: basic.sh
|
## File: basic.sh
|
||||||
## Desc: Installs basic command line utilities and dev packages
|
## Desc: Installs basic command line utilities and dev packages
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
toolset="$INSTALLER_SCRIPT_FOLDER/toolset.json"
|
toolset="$INSTALLER_SCRIPT_FOLDER/toolset.json"
|
||||||
common_packages=$(jq -r ".apt.common_packages[]" $toolset)
|
common_packages=$(jq -r ".apt.common_packages[]" $toolset)
|
||||||
cmd_packages=$(jq -r ".apt.cmd_packages[]" $toolset)
|
cmd_packages=$(jq -r ".apt.cmd_packages[]" $toolset)
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: bazel.sh
|
## File: bazel.sh
|
||||||
## Desc: Installs Bazel and Bazelisk (A user-friendly launcher for Bazel)
|
## Desc: Installs Bazel and Bazelisk (A user-friendly launcher for Bazel)
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Install bazel
|
# Install bazel
|
||||||
curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
|
curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
|
||||||
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
|
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: build-essential.sh
|
## File: build-essential.sh
|
||||||
## Desc: Installs build-essential package
|
## Desc: Installs build-essential package
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
source $HELPER_SCRIPTS/install.sh
|
source $HELPER_SCRIPTS/install.sh
|
||||||
|
|
||||||
PACKAGE=build-essential
|
PACKAGE=build-essential
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: clang.sh
|
## File: clang.sh
|
||||||
## Desc: Installs Clang compiler
|
## Desc: Installs Clang compiler
|
||||||
################################################################################
|
################################################################################
|
||||||
set -e
|
|
||||||
|
|
||||||
# Source the helpers for use with the script
|
# Source the helpers for use with the script
|
||||||
source $HELPER_SCRIPTS/os.sh
|
source $HELPER_SCRIPTS/os.sh
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
|
|
||||||
# before cleanup
|
# before cleanup
|
||||||
before=$(df / -Pm | awk 'NR==2{print $4}')
|
before=$(df / -Pm | awk 'NR==2{print $4}')
|
||||||
@@ -27,4 +27,4 @@ after=$(df / -Pm | awk 'NR==2{print $4}')
|
|||||||
# display size
|
# display size
|
||||||
echo "Before: $before MB"
|
echo "Before: $before MB"
|
||||||
echo "After : $after MB"
|
echo "After : $after MB"
|
||||||
echo "Delta : $(($after-$before)) MB"
|
echo "Delta : $(($after-$before)) MB"
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: cmake.sh
|
## File: cmake.sh
|
||||||
## Desc: Installs CMake
|
## Desc: Installs CMake
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Test to see if the software in question is already installed, if not install it
|
# Test to see if the software in question is already installed, if not install it
|
||||||
echo "Checking to see if the installer script has already been run"
|
echo "Checking to see if the installer script has already been run"
|
||||||
if command -v cmake; then
|
if command -v cmake; then
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: codeql-bundle.sh
|
## File: codeql-bundle.sh
|
||||||
## Desc: Install the CodeQL CLI Bundle to the toolcache.
|
## Desc: Install the CodeQL CLI Bundle to the toolcache.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: snap-environment.sh
|
## File: snap-environment.sh
|
||||||
## Desc: Update /etc/environment to include /snap/bin in PATH
|
## Desc: Update /etc/environment to include /snap/bin in PATH
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
#Set ImageVersion and ImageOS env variables
|
#Set ImageVersion and ImageOS env variables
|
||||||
echo ImageVersion=$IMAGE_VERSION | tee -a /etc/environment
|
echo ImageVersion=$IMAGE_VERSION | tee -a /etc/environment
|
||||||
echo ImageOS=$IMAGE_OS | tee -a /etc/environment
|
echo ImageOS=$IMAGE_OS | tee -a /etc/environment
|
||||||
@@ -22,4 +24,4 @@ chmod -R 777 $AGENT_TOOLSDIRECTORY
|
|||||||
|
|
||||||
# https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html
|
# https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html
|
||||||
# https://www.suse.com/support/kb/doc/?id=000016692
|
# https://www.suse.com/support/kb/doc/?id=000016692
|
||||||
echo 'vm.max_map_count=262144' | tee -a /etc/sysctl.conf
|
echo 'vm.max_map_count=262144' | tee -a /etc/sysctl.conf
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: containers.sh
|
## File: containers.sh
|
||||||
## Desc: Installs container tools: podman, buildah and skopeo onto the image
|
## Desc: Installs container tools: podman, buildah and skopeo onto the image
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
source /etc/os-release
|
source /etc/os-release
|
||||||
sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/x${NAME}_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
|
sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/x${NAME}_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
|
||||||
wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/x${NAME}_${VERSION_ID}/Release.key -O Release.key
|
wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/x${NAME}_${VERSION_ID}/Release.key -O Release.key
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: docker-compose.sh
|
## File: docker-compose.sh
|
||||||
## Desc: Installs Docker Compose
|
## Desc: Installs Docker Compose
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
URL=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r '.assets[].browser_download_url | select(contains("docker-compose-Linux-x86_64"))' | head -1)
|
URL=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r '.assets[].browser_download_url | select(contains("docker-compose-Linux-x86_64"))' | head -1)
|
||||||
|
|
||||||
# Install latest docker-compose from releases
|
# Install latest docker-compose from releases
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: docker-moby.sh
|
## File: docker-moby.sh
|
||||||
## Desc: Installs docker onto the image
|
## Desc: Installs docker onto the image
|
||||||
################################################################################
|
################################################################################
|
||||||
set -e
|
|
||||||
|
|
||||||
# Source the helpers for use with the script
|
# Source the helpers for use with the script
|
||||||
source $HELPER_SCRIPTS/install.sh
|
source $HELPER_SCRIPTS/install.sh
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: dotnetcore-sdk.sh
|
## File: dotnetcore-sdk.sh
|
||||||
## Desc: Installs .NET Core SDK
|
## Desc: Installs .NET Core SDK
|
||||||
@@ -25,7 +25,6 @@ mksamples()
|
|||||||
sample=$2
|
sample=$2
|
||||||
mkdir "$sdk"
|
mkdir "$sdk"
|
||||||
cd "$sdk" || exit
|
cd "$sdk" || exit
|
||||||
set -e
|
|
||||||
dotnet help
|
dotnet help
|
||||||
dotnet new globaljson --sdk-version "$sdk"
|
dotnet new globaljson --sdk-version "$sdk"
|
||||||
dotnet new "$sample"
|
dotnet new "$sample"
|
||||||
@@ -36,8 +35,6 @@ mksamples()
|
|||||||
rm -rf "$sdk"
|
rm -rf "$sdk"
|
||||||
}
|
}
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# Disable telemetry
|
# Disable telemetry
|
||||||
export DOTNET_CLI_TELEMETRY_OPTOUT=1
|
export DOTNET_CLI_TELEMETRY_OPTOUT=1
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
|
|
||||||
# This is the anti-frontend. It never interacts with you at all,
|
# This is the anti-frontend. It never interacts with you at all,
|
||||||
# and makes the default answers be used for all questions. It
|
# and makes the default answers be used for all questions. It
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: erlang.sh
|
## File: erlang.sh
|
||||||
## Desc: Installs erlang
|
## Desc: Installs erlang
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
source_list=/etc/apt/sources.list.d/eslerlang.list
|
source_list=/etc/apt/sources.list.d/eslerlang.list
|
||||||
|
|
||||||
# Install Erlang
|
# Install Erlang
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: example.sh
|
## File: example.sh
|
||||||
## Desc: This is an example script that can be copied to add a new software
|
## Desc: This is an example script that can be copied to add a new software
|
||||||
## installer to the image
|
## installer to the image
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Test to see if the software in question is already installed, if not install it
|
# Test to see if the software in question is already installed, if not install it
|
||||||
echo "Checking to see if the installer script has already been run"
|
echo "Checking to see if the installer script has already been run"
|
||||||
if [ -z $EXAMPLE_VAR ]; then
|
if [ -z $EXAMPLE_VAR ]; then
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: firefox.sh
|
## File: firefox.sh
|
||||||
## Desc: Installs Firefox
|
## Desc: Installs Firefox
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Install Firefox
|
# Install Firefox
|
||||||
apt-get install -y firefox
|
apt-get install -y firefox
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: gcc.sh
|
## File: gcc.sh
|
||||||
## Desc: Installs GNU C++
|
## Desc: Installs GNU C++
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# Source the helpers for use with the script
|
# Source the helpers for use with the script
|
||||||
source $HELPER_SCRIPTS/os.sh
|
source $HELPER_SCRIPTS/os.sh
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: gfortran.sh
|
## File: gfortran.sh
|
||||||
## Desc: Installs GNU Fortran
|
## Desc: Installs GNU Fortran
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
function InstallFortran {
|
function InstallFortran {
|
||||||
version=$1
|
version=$1
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: git.sh
|
## File: git.sh
|
||||||
## Desc: Installs Git
|
## Desc: Installs Git
|
||||||
################################################################################
|
################################################################################
|
||||||
set -e
|
|
||||||
|
|
||||||
# Source the helpers for use with the script
|
# Source the helpers for use with the script
|
||||||
source "$HELPER_SCRIPTS"/install.sh
|
source "$HELPER_SCRIPTS"/install.sh
|
||||||
@@ -52,3 +51,7 @@ else
|
|||||||
echo "[!] Hub CLI was not installed"
|
echo "[!] Hub CLI was not installed"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Add well-known SSH host keys to known_hosts
|
||||||
|
ssh-keyscan -t rsa github.com >> /etc/ssh/ssh_known_hosts
|
||||||
|
ssh-keyscan -t rsa ssh.dev.azure.com >> /etc/ssh/ssh_known_hosts
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: github-cli.sh
|
## File: github-cli.sh
|
||||||
## Desc: Installs GitHub CLI
|
## Desc: Installs GitHub CLI
|
||||||
## Must be run as non-root user after homebrew
|
## Must be run as non-root user after homebrew
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Install GitHub CLI
|
# Install GitHub CLI
|
||||||
url=$(curl -s https://api.github.com/repos/cli/cli/releases/latest | jq -r '.assets[].browser_download_url|select(contains("linux") and contains("amd64") and contains(".deb"))')
|
url=$(curl -s https://api.github.com/repos/cli/cli/releases/latest | jq -r '.assets[].browser_download_url|select(contains("linux") and contains("amd64") and contains(".deb"))')
|
||||||
wget $url
|
wget $url
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: google-chrome.sh
|
## File: google-chrome.sh
|
||||||
## Desc: Installs google-chrome and chromedriver
|
## Desc: Installs google-chrome and chromedriver
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
LSB_RELEASE=$(lsb_release -rs)
|
LSB_RELEASE=$(lsb_release -rs)
|
||||||
|
|
||||||
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
|
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: google-cloud-sdk.sh
|
## File: google-cloud-sdk.sh
|
||||||
## Desc: Installs the Google Cloud SDK
|
## Desc: Installs the Google Cloud SDK
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Install the Google Cloud SDK
|
# Install the Google Cloud SDK
|
||||||
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
|
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
|
||||||
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
|
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: haskell.sh
|
## File: haskell.sh
|
||||||
## Desc: Installs Haskell
|
## Desc: Installs Haskell
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: heroku.sh
|
## File: heroku.sh
|
||||||
## Desc: Installs Heroku CLI
|
## Desc: Installs Heroku CLI
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Install Heroku CLI
|
# Install Heroku CLI
|
||||||
curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
|
curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: hhvm.sh
|
## File: hhvm.sh
|
||||||
## Desc: Installs hhvm
|
## Desc: Installs hhvm
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: homebrew-validate.sh
|
## File: homebrew-validate.sh
|
||||||
## Desc: Validate the Homebrew can run after reboot without extra configuring
|
## Desc: Validate the Homebrew can run after reboot without extra configuring
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: homebrew.sh
|
## File: homebrew.sh
|
||||||
## Desc: Installs the Homebrew on Linux
|
## Desc: Installs the Homebrew on Linux
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: hosted-tool-cache.sh
|
## File: hosted-tool-cache.sh
|
||||||
## Desc: Downloads and installs hosted tools cache
|
## Desc: Downloads and installs hosted tools cache
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Fail out if any setups fail
|
|
||||||
set -e
|
|
||||||
|
|
||||||
TOOLCACHE_REGISTRY="npm.pkg.github.com"
|
TOOLCACHE_REGISTRY="npm.pkg.github.com"
|
||||||
|
|
||||||
echo "Configure npm to use github package registry for '@actions' scope"
|
echo "Configure npm to use github package registry for '@actions' scope"
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: image-magick.sh
|
## File: image-magick.sh
|
||||||
## Desc: Installs ImageMagick
|
## Desc: Installs ImageMagick
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Install ImageMagick
|
# Install ImageMagick
|
||||||
apt-get install -y --no-install-recommends --fix-missing \
|
apt-get install -y --no-install-recommends --fix-missing \
|
||||||
imagemagick \
|
imagemagick \
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: java-tools.sh
|
## File: java-tools.sh
|
||||||
## Desc: Installs Java and related tooling (Ant, Gradle, Maven)
|
## Desc: Installs Java and related tooling (Ant, Gradle, Maven)
|
||||||
@@ -6,8 +6,6 @@
|
|||||||
|
|
||||||
source $HELPER_SCRIPTS/os.sh
|
source $HELPER_SCRIPTS/os.sh
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
function javaTool {
|
function javaTool {
|
||||||
if [[ "$2" =~ ([1]{0,1}.)?$DEFAULT_JDK_VERSION.* ]]; then
|
if [[ "$2" =~ ([1]{0,1}.)?$DEFAULT_JDK_VERSION.* ]]; then
|
||||||
echo "$1 $2 is equal to default one $DEFAULT_JDK_VERSION"
|
echo "$1 $2 is equal to default one $DEFAULT_JDK_VERSION"
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: julia.sh
|
## File: julia.sh
|
||||||
## Desc: Installs Julia, and adds Julia to the path
|
## Desc: Installs Julia, and adds Julia to the path
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# This function fetches the latest Julia release from the GitHub API
|
# This function fetches the latest Julia release from the GitHub API
|
||||||
# Based on https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c
|
# Based on https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c
|
||||||
function GetLatestJuliaRelease () {
|
function GetLatestJuliaRelease () {
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: kind.sh
|
## File: kind.sh
|
||||||
## Desc: Installs kind
|
## Desc: Installs kind
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Install KIND
|
# Install KIND
|
||||||
URL=$(curl -s https://api.github.com/repos/kubernetes-sigs/kind/releases/latest | jq -r '.assets[].browser_download_url | select(contains("kind-linux-amd64"))')
|
URL=$(curl -s https://api.github.com/repos/kubernetes-sigs/kind/releases/latest | jq -r '.assets[].browser_download_url | select(contains("kind-linux-amd64"))')
|
||||||
curl -L -o /usr/local/bin/kind $URL
|
curl -L -o /usr/local/bin/kind $URL
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: kubernetes-tools.sh
|
## File: kubernetes-tools.sh
|
||||||
## Desc: Installs kubectl, helm, kustomize
|
## Desc: Installs kubectl, helm, kustomize
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
## Install kubectl
|
## Install kubectl
|
||||||
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
|
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
|
||||||
touch /etc/apt/sources.list.d/kubernetes.list
|
touch /etc/apt/sources.list.d/kubernetes.list
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: leiningen.sh
|
## File: leiningen.sh
|
||||||
## Desc: Installs Leiningen
|
## Desc: Installs Leiningen
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
LEIN_BIN=/usr/local/bin/lein
|
LEIN_BIN=/usr/local/bin/lein
|
||||||
curl -s https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > $LEIN_BIN
|
curl -s https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > $LEIN_BIN
|
||||||
chmod 0755 $LEIN_BIN
|
chmod 0755 $LEIN_BIN
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: mercurial.sh
|
## File: mercurial.sh
|
||||||
## Desc: Installs Mercurial
|
## Desc: Installs Mercurial
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: miniconda.sh
|
## File: miniconda.sh
|
||||||
## Desc: Installs miniconda
|
## Desc: Installs miniconda
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Install Miniconda
|
# Install Miniconda
|
||||||
curl -sL https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o miniconda.sh \
|
curl -sL https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o miniconda.sh \
|
||||||
&& chmod +x miniconda.sh \
|
&& chmod +x miniconda.sh \
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: homebrew.sh
|
## File: homebrew.sh
|
||||||
## Desc: Installs Mongo DB
|
## Desc: Installs Mongo DB
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: cmake.sh
|
## File: cmake.sh
|
||||||
## Desc: Installs Mono
|
## Desc: Installs Mono
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
LSB_CODENAME=$(lsb_release -cs)
|
LSB_CODENAME=$(lsb_release -cs)
|
||||||
|
|
||||||
# Test to see if the software in question is already installed, if not install it
|
# Test to see if the software in question is already installed, if not install it
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: mysql.sh
|
## File: mysql.sh
|
||||||
## Desc: Installs MySQL Client
|
## Desc: Installs MySQL Client
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
export ACCEPT_EULA=Y
|
export ACCEPT_EULA=Y
|
||||||
|
|
||||||
if isUbuntu16 || isUbuntu18 ; then
|
if isUbuntu16 || isUbuntu18 ; then
|
||||||
@@ -44,7 +43,6 @@ if ! command -v mysql; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set -e
|
|
||||||
mysql -vvv -e 'CREATE DATABASE smoke_test' -uroot -proot
|
mysql -vvv -e 'CREATE DATABASE smoke_test' -uroot -proot
|
||||||
mysql -vvv -e 'DROP DATABASE smoke_test' -uroot -proot
|
mysql -vvv -e 'DROP DATABASE smoke_test' -uroot -proot
|
||||||
set +e
|
set +e
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: netlify.sh
|
## File: netlify.sh
|
||||||
## Desc: Installs the Netlify CLI
|
## Desc: Installs the Netlify CLI
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Install the Netlify CLI
|
# Install the Netlify CLI
|
||||||
npm i -g netlify-cli
|
npm i -g netlify-cli
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: nodejs.sh
|
## File: nodejs.sh
|
||||||
## Desc: Installs Node.js LTS and related tooling (Gulp, Grunt)
|
## Desc: Installs Node.js LTS and related tooling (Gulp, Grunt)
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Install LTS Node.js and related build tools
|
# Install LTS Node.js and related build tools
|
||||||
curl -sL https://raw.githubusercontent.com/mklement0/n-install/stable/bin/n-install | bash -s -- -ny -
|
curl -sL https://raw.githubusercontent.com/mklement0/n-install/stable/bin/n-install | bash -s -- -ny -
|
||||||
~/n/bin/n lts
|
~/n/bin/n lts
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: nvm.sh
|
## File: nvm.sh
|
||||||
## Desc: Installs Nvm
|
## Desc: Installs Nvm
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
export NVM_DIR="/etc/skel/.nvm"
|
export NVM_DIR="/etc/skel/.nvm"
|
||||||
mkdir $NVM_DIR
|
mkdir $NVM_DIR
|
||||||
VERSION=$(curl -s https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r '.tag_name')
|
VERSION=$(curl -s https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r '.tag_name')
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: oc.sh
|
## File: oc.sh
|
||||||
## Desc: Installs the OC CLI
|
## Desc: Installs the OC CLI
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Install the oc CLI
|
# Install the oc CLI
|
||||||
curl "https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/linux/oc.tar.gz" > oc.tar.gz
|
curl "https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/linux/oc.tar.gz" > oc.tar.gz
|
||||||
tar xvzf oc.tar.gz
|
tar xvzf oc.tar.gz
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: oras-cli.sh
|
## File: oras-cli.sh
|
||||||
## Desc: Installs ORAS CLI
|
## Desc: Installs ORAS CLI
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: packer.sh
|
## File: packer.sh
|
||||||
## Desc: Installs packer
|
## Desc: Installs packer
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Install Packer
|
# Install Packer
|
||||||
PACKER_VERSION=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/packer | jq -r .current_version)
|
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"
|
curl -LO "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip"
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: phantomjs.sh
|
## File: phantomjs.sh
|
||||||
## Desc: Installs PhantomJS
|
## Desc: Installs PhantomJS
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# Install PhantomJS
|
# Install PhantomJS
|
||||||
apt-get install -y chrpath libssl-dev libxft-dev libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev
|
apt-get install -y chrpath libssl-dev libxft-dev libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev
|
||||||
PHANTOM_JS=phantomjs-2.1.1-linux-x86_64
|
PHANTOM_JS=phantomjs-2.1.1-linux-x86_64
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: php.sh
|
## File: php.sh
|
||||||
## Desc: Installs php
|
## Desc: Installs php
|
||||||
@@ -8,8 +8,6 @@
|
|||||||
source $HELPER_SCRIPTS/etc-environment.sh
|
source $HELPER_SCRIPTS/etc-environment.sh
|
||||||
source $HELPER_SCRIPTS/os.sh
|
source $HELPER_SCRIPTS/os.sh
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# add repository
|
# add repository
|
||||||
apt-add-repository ppa:ondrej/php -y
|
apt-add-repository ppa:ondrej/php -y
|
||||||
apt-get update
|
apt-get update
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: pollinate.sh
|
## File: pollinate.sh
|
||||||
## Desc: Installs Pollinate
|
## Desc: Installs Pollinate
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Install Pollinate
|
# Install Pollinate
|
||||||
apt-get install -y --no-install-recommends pollinate
|
apt-get install -y --no-install-recommends pollinate
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: post-deployment.sh
|
## File: post-deployment.sh
|
||||||
## Desc: Post deployment actions
|
## Desc: Post deployment actions
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
mv -f /imagegeneration/post-generation /opt
|
||||||
|
|
||||||
# set chmod -R 777 /opt
|
# set chmod -R 777 /opt
|
||||||
if [[ -d "/opt" ]]; then
|
if [[ -d "/opt" ]]; then
|
||||||
echo "chmod -R 777 /opt"
|
echo "chmod -R 777 /opt"
|
||||||
@@ -14,3 +16,11 @@ fi
|
|||||||
rm -rf $HELPER_SCRIPT_FOLDER
|
rm -rf $HELPER_SCRIPT_FOLDER
|
||||||
rm -rf $INSTALLER_SCRIPT_FOLDER
|
rm -rf $INSTALLER_SCRIPT_FOLDER
|
||||||
chmod 755 $IMAGE_FOLDER
|
chmod 755 $IMAGE_FOLDER
|
||||||
|
|
||||||
|
# Check PATH
|
||||||
|
if [[ $PATH == \"*\" ]]
|
||||||
|
then
|
||||||
|
echo "ERROR: PATH contains quotes"
|
||||||
|
echo "PATH = $PATH"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: postgresql.sh
|
## File: postgresql.sh
|
||||||
## Desc: Installs Postgresql
|
## Desc: Installs Postgresql
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
#Preparing repo for PostgreSQL 12.
|
#Preparing repo for PostgreSQL 12.
|
||||||
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
|
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
|
||||||
echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
|
echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
|
||||||
@@ -25,4 +24,4 @@ pg_isready
|
|||||||
|
|
||||||
# Disable postgresql.service
|
# Disable postgresql.service
|
||||||
systemctl is-active --quiet postgresql.service && systemctl stop postgresql.service
|
systemctl is-active --quiet postgresql.service && systemctl stop postgresql.service
|
||||||
systemctl disable postgresql.service
|
systemctl disable postgresql.service
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: powershellcore.sh
|
## File: powershellcore.sh
|
||||||
## Desc: Installs powershellcore
|
## Desc: Installs powershellcore
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
|
|
||||||
imagedata_file=$IMAGEDATA_FILE
|
imagedata_file=$IMAGEDATA_FILE
|
||||||
image_version=$IMAGE_VERSION
|
image_version=$IMAGE_VERSION
|
||||||
@@ -29,4 +29,4 @@ cat <<EOF > $imagedata_file
|
|||||||
"detail": "Environment: ${image_label}\nVersion: ${image_version}\nIncluded Software: ${software_url}"
|
"detail": "Environment: ${image_label}\nVersion: ${image_version}\nIncluded Software: ${software_url}"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: pulumi.sh
|
## File: pulumi.sh
|
||||||
## Desc: Installs Pulumi
|
## Desc: Installs Pulumi
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: pypy.sh
|
## File: pypy.sh
|
||||||
## Desc: Installs PyPy
|
## Desc: Installs PyPy
|
||||||
@@ -76,8 +76,6 @@ pypyVersions="$(cat /tmp/pypyUrls.html | grep 'linux64' | awk -v uri="$uri" -F'>
|
|||||||
toolset="$INSTALLER_SCRIPT_FOLDER/toolset.json"
|
toolset="$INSTALLER_SCRIPT_FOLDER/toolset.json"
|
||||||
toolsetVersions=$(jq -r '.toolcache[] | select(.name | contains("PyPy")) | .versions[]' $toolset)
|
toolsetVersions=$(jq -r '.toolcache[] | select(.name | contains("PyPy")) | .versions[]' $toolset)
|
||||||
|
|
||||||
# Fail out if any setups fail
|
|
||||||
set -e
|
|
||||||
|
|
||||||
for toolsetVersion in $toolsetVersions; do
|
for toolsetVersion in $toolsetVersions; do
|
||||||
latestMajorPyPyVersion=$(echo "${pypyVersions}" | grep -E "pypy${toolsetVersion}-v[0-9]+\.[0-9]+\.[0-9]+-" | head -1)
|
latestMajorPyPyVersion=$(echo "${pypyVersions}" | grep -E "pypy${toolsetVersion}-v[0-9]+\.[0-9]+\.[0-9]+-" | head -1)
|
||||||
@@ -90,4 +88,4 @@ for toolsetVersion in $toolsetVersions; do
|
|||||||
InstallPyPy $latestMajorPyPyVersion
|
InstallPyPy $latestMajorPyPyVersion
|
||||||
done
|
done
|
||||||
|
|
||||||
chown -R "$SUDO_USER:$SUDO_USER" "$AGENT_TOOLSDIRECTORY/PyPy"
|
chown -R "$SUDO_USER:$SUDO_USER" "$AGENT_TOOLSDIRECTORY/PyPy"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: python.sh
|
## File: python.sh
|
||||||
## Desc: Installs Python 2/3
|
## Desc: Installs Python 2/3
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
|
|
||||||
# Source the helpers for use with the script
|
# Source the helpers for use with the script
|
||||||
source $HELPER_SCRIPTS/os.sh
|
source $HELPER_SCRIPTS/os.sh
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: rndgenerator.sh
|
## File: rndgenerator.sh
|
||||||
## Desc: Install random number generator
|
## Desc: Install random number generator
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Install haveged
|
# Install haveged
|
||||||
apt-get -y install haveged
|
apt-get -y install haveged
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: ruby.sh
|
## File: ruby.sh
|
||||||
## Desc: Installs Ruby requirements
|
## Desc: Installs Ruby requirements
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
sudo apt-get install ruby-full
|
sudo apt-get install ruby-full
|
||||||
sudo gem update --system
|
sudo gem update --system
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: rust.sh
|
## File: rust.sh
|
||||||
## Desc: Installs Rust
|
## Desc: Installs Rust
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: scala.sh
|
## File: scala.sh
|
||||||
## Desc: Installs sbt
|
## Desc: Installs sbt
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Install sbt
|
# Install sbt
|
||||||
# https://www.scala-sbt.org/1.x/docs/Installing-sbt-on-Linux.html
|
# https://www.scala-sbt.org/1.x/docs/Installing-sbt-on-Linux.html
|
||||||
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
|
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: selenium.sh
|
## File: selenium.sh
|
||||||
## Desc: Installs selenium server
|
## Desc: Installs selenium server
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Determine latest selenium standalone server version
|
# Determine latest selenium standalone server version
|
||||||
SELENIUM_LATEST_VERSION_URL=https://api.github.com/repos/SeleniumHQ/selenium/releases/latest
|
SELENIUM_LATEST_VERSION_URL=https://api.github.com/repos/SeleniumHQ/selenium/releases/latest
|
||||||
SELENIUM_VERSION=$(curl $SELENIUM_LATEST_VERSION_URL | jq '.name' | tr -d '"' | cut -d ' ' -f 2)
|
SELENIUM_VERSION=$(curl $SELENIUM_LATEST_VERSION_URL | jq '.name' | tr -d '"' | cut -d ' ' -f 2)
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: sphinx.sh
|
## File: sphinx.sh
|
||||||
## Desc: Installs Sphinx
|
## Desc: Installs Sphinx
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Install Sphinx
|
# Install Sphinx
|
||||||
apt-get install -y sphinxsearch
|
apt-get install -y sphinxsearch
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: subversion.sh
|
## File: subversion.sh
|
||||||
## Desc: Installs Subversion client
|
## Desc: Installs Subversion client
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Install Subversion
|
# Install Subversion
|
||||||
apt-get install -y --no-install-recommends subversion
|
apt-get install -y --no-install-recommends subversion
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: swift.sh
|
## File: swift.sh
|
||||||
## Desc: Installs Swift
|
## Desc: Installs Swift
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Install
|
# Install
|
||||||
image_label="$(lsb_release -rs)"
|
image_label="$(lsb_release -rs)"
|
||||||
swift_version=$(curl -s https://swift.org/download/ | grep -m1 "id=\"swift-" | awk -F"[ <]" '{print $4}')
|
swift_version=$(curl -s -L -N https://swift.org/download|awk -F"[ <]" '/id="swift-/ {print $4; exit}')
|
||||||
|
|
||||||
wget -P /tmp https://swift.org/builds/swift-$swift_version-release/ubuntu${image_label//./}/swift-$swift_version-RELEASE/swift-$swift_version-RELEASE-ubuntu$image_label.tar.gz
|
wget -P /tmp https://swift.org/builds/swift-$swift_version-release/ubuntu${image_label//./}/swift-$swift_version-RELEASE/swift-$swift_version-RELEASE-ubuntu$image_label.tar.gz
|
||||||
|
|
||||||
tar xzf /tmp/swift-$swift_version-RELEASE-ubuntu$image_label.tar.gz
|
tar xzf /tmp/swift-$swift_version-RELEASE-ubuntu$image_label.tar.gz
|
||||||
mv swift-$swift_version-RELEASE-ubuntu$image_label /usr/share/swift
|
mv swift-$swift_version-RELEASE-ubuntu$image_label /usr/share/swift
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
|
||||||
# Install Swig
|
# Install Swig
|
||||||
sudo apt-get install -y swig
|
sudo apt-get install -y swig
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: terraform.sh
|
## File: terraform.sh
|
||||||
## Desc: Installs terraform
|
## Desc: Installs terraform
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
|
||||||
# Install Terraform
|
# Install Terraform
|
||||||
TERRAFORM_VERSION=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r .current_version)
|
TERRAFORM_VERSION=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r .current_version)
|
||||||
curl -LO "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip"
|
curl -LO "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: test-toolcache.sh
|
## File: test-toolcache.sh
|
||||||
## Desc: Test Python and Ruby versions in tools cache
|
## Desc: Test Python and Ruby versions in tools cache
|
||||||
@@ -51,9 +51,6 @@ Test_Hostedtoolcache_Tool() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Fail out if any tests fail
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# define dictionary for key_alias and its values
|
# define dictionary for key_alias and its values
|
||||||
declare -A TOOLCACHE_KEY_VALUE
|
declare -A TOOLCACHE_KEY_VALUE
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: validate-disk-space.sh
|
## File: validate-disk-space.sh
|
||||||
## Desc: Validate free disk space
|
## Desc: Validate free disk space
|
||||||
@@ -17,4 +17,4 @@ fi
|
|||||||
if [ $availableSpaceMB -le $minimumFreeSpaceMB ]; then
|
if [ $availableSpaceMB -le $minimumFreeSpaceMB ]; then
|
||||||
echo "Not enough disk space on the image (minimum available space: $minimumFreeSpaceMB MB)"
|
echo "Not enough disk space on the image (minimum available space: $minimumFreeSpaceMB MB)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: vcpkg.sh
|
## File: vcpkg.sh
|
||||||
## Desc: Installs vcpkg
|
## Desc: Installs vcpkg
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
################################################################################
|
################################################################################
|
||||||
## File: vercel.sh
|
## File: vercel.sh
|
||||||
## Desc: Installs the Vercel CLI
|
## Desc: Installs the Vercel CLI
|
||||||
|
|||||||
@@ -89,6 +89,11 @@
|
|||||||
"source": "{{template_dir}}/scripts/installers",
|
"source": "{{template_dir}}/scripts/installers",
|
||||||
"destination": "{{user `installer_script_folder`}}"
|
"destination": "{{user `installer_script_folder`}}"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"source": "{{ template_dir }}/post-generation",
|
||||||
|
"destination": "{{user `image_folder`}}"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"source": "{{ template_dir }}/scripts/SoftwareReport",
|
"source": "{{ template_dir }}/scripts/SoftwareReport",
|
||||||
|
|||||||
@@ -92,6 +92,11 @@
|
|||||||
"source": "{{template_dir}}/scripts/installers",
|
"source": "{{template_dir}}/scripts/installers",
|
||||||
"destination": "{{user `installer_script_folder`}}"
|
"destination": "{{user `installer_script_folder`}}"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"source": "{{ template_dir }}/post-generation",
|
||||||
|
"destination": "{{user `image_folder`}}"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"source": "{{ template_dir }}/scripts/SoftwareReport",
|
"source": "{{ template_dir }}/scripts/SoftwareReport",
|
||||||
|
|||||||
@@ -94,6 +94,11 @@
|
|||||||
"source": "{{template_dir}}/scripts/installers",
|
"source": "{{template_dir}}/scripts/installers",
|
||||||
"destination": "{{user `installer_script_folder`}}"
|
"destination": "{{user `installer_script_folder`}}"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"source": "{{ template_dir }}/post-generation",
|
||||||
|
"destination": "{{user `installer_script_folder`}}"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"source": "{{ template_dir }}/scripts/SoftwareReport",
|
"source": "{{ template_dir }}/scripts/SoftwareReport",
|
||||||
|
|||||||
@@ -1,8 +1,26 @@
|
|||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
source ~/utils/utils.sh
|
source ~/utils/utils.sh
|
||||||
|
|
||||||
ANDROID_PLATFORM_LIST=($(get_toolset_value '.android."platform-list"[]'))
|
function filter_components_by_version {
|
||||||
ANDROID_BUILD_TOOLS=($(get_toolset_value '.android."build-tools"[]'))
|
minimumVersion=$1
|
||||||
|
shift
|
||||||
|
toolsArr=("$@")
|
||||||
|
|
||||||
|
for item in ${toolsArr[@]}
|
||||||
|
do
|
||||||
|
# take the last argument after spliting string by ';'' and '-''
|
||||||
|
version=$(echo "${item##*[-;]}")
|
||||||
|
if verlte $minimumVersion $version
|
||||||
|
then
|
||||||
|
components+=($item)
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
components=()
|
||||||
|
|
||||||
|
ANDROID_PLATFORM=($(get_toolset_value '.android.platform_min_version'))
|
||||||
|
ANDROID_BUILD_TOOL=($(get_toolset_value '.android.build_tools_min_version'))
|
||||||
ANDROID_EXTRA_LIST=($(get_toolset_value '.android."extra-list"[]'))
|
ANDROID_EXTRA_LIST=($(get_toolset_value '.android."extra-list"[]'))
|
||||||
ANDROID_ADDON_LIST=($(get_toolset_value '.android."addon-list"[]'))
|
ANDROID_ADDON_LIST=($(get_toolset_value '.android."addon-list"[]'))
|
||||||
|
|
||||||
@@ -48,17 +66,14 @@ echo y | $SDKMANAGER "cmake;3.6.4111459"
|
|||||||
echo "Installing latest ndk..."
|
echo "Installing latest ndk..."
|
||||||
echo y | $SDKMANAGER "ndk-bundle"
|
echo y | $SDKMANAGER "ndk-bundle"
|
||||||
|
|
||||||
for platform_name in "${ANDROID_PLATFORM_LIST[@]}"
|
availablePlatforms=($(${ANDROID_HOME}/tools/bin/sdkmanager --list | grep "platforms;android-" | cut -d"|" -f 1 | sort -u))
|
||||||
do
|
filter_components_by_version $ANDROID_PLATFORM "${availablePlatforms[@]}"
|
||||||
echo "Installing platform $platform_name ..."
|
|
||||||
echo y | $SDKMANAGER "platforms;$platform_name"
|
|
||||||
done
|
|
||||||
|
|
||||||
for build_tools_version in "${ANDROID_BUILD_TOOLS[@]}"
|
allBuildTools=($(${ANDROID_HOME}/tools/bin/sdkmanager --list --include_obsolete | grep "build-tools;" | cut -d"|" -f 1 | sort -u))
|
||||||
do
|
availableBuildTools=$(echo ${allBuildTools[@]//*rc[0-9]/})
|
||||||
echo "Installing build tools $build_tools_version ..."
|
filter_components_by_version $ANDROID_BUILD_TOOL "${availableBuildTools[@]}"
|
||||||
echo y | $SDKMANAGER "build-tools;$build_tools_version"
|
|
||||||
done
|
echo "y" | ${ANDROID_HOME}/tools/bin/sdkmanager ${components[@]}
|
||||||
|
|
||||||
for extra_name in "${ANDROID_EXTRA_LIST[@]}"
|
for extra_name in "${ANDROID_EXTRA_LIST[@]}"
|
||||||
do
|
do
|
||||||
|
|||||||
@@ -91,4 +91,9 @@ get_latest_xcode_from_toolset() {
|
|||||||
|
|
||||||
get_default_xcode_from_toolset() {
|
get_default_xcode_from_toolset() {
|
||||||
echo $(get_toolset_value '.xcode.default')
|
echo $(get_toolset_value '.xcode.default')
|
||||||
|
}
|
||||||
|
|
||||||
|
verlte() {
|
||||||
|
sortedVersion=$(echo -e "$1\n$2" | sort -V | head -n1)
|
||||||
|
[ "$1" = "$sortedVersion" ]
|
||||||
}
|
}
|
||||||
@@ -28,6 +28,11 @@ function Get-AndroidInstalledPackages {
|
|||||||
return $androidInstalledPackages
|
return $androidInstalledPackages
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Get-AndroidPackages {
|
||||||
|
$androidSDKManagerPath = Get-AndroidSDKManagerPath
|
||||||
|
$androidPackages = & $androidSDKManagerPath --list --verbose
|
||||||
|
return $androidPackages
|
||||||
|
}
|
||||||
|
|
||||||
function Build-AndroidTable {
|
function Build-AndroidTable {
|
||||||
Write-Host "Build-AndroidTable"
|
Write-Host "Build-AndroidTable"
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ $aria2Version = Run-Command "aria2c --version" | Select-Object -First 1 | Take-P
|
|||||||
$azcopyVersion = Run-Command "azcopy --version" | Take-Part -Part 2
|
$azcopyVersion = Run-Command "azcopy --version" | Take-Part -Part 2
|
||||||
$zstdVersion = Run-Command "zstd --version" | Take-Part -Part 1 -Delimiter "v" | Take-Part -Part 0 -Delimiter ","
|
$zstdVersion = Run-Command "zstd --version" | Take-Part -Part 1 -Delimiter "v" | Take-Part -Part 0 -Delimiter ","
|
||||||
$bazelVersion = Run-Command "bazel --version" | Take-Part -Part 0 -Delimiter "-"
|
$bazelVersion = Run-Command "bazel --version" | Take-Part -Part 0 -Delimiter "-"
|
||||||
$bazeliskVersion = Run-Command "bazelisk version" | Select-String "Bazelisk version:" | Take-Part -Part 1 -Delimiter ":"
|
$bazeliskVersion = Run-Command "brew list bazelisk --versions"
|
||||||
$packerVersion = Run-Command "packer --version"
|
$packerVersion = Run-Command "packer --version"
|
||||||
$helmVersion = Run-Command "helm version --short"
|
$helmVersion = Run-Command "helm version --short"
|
||||||
$mongo = Run-Command "mongo --version" | Select-String "MongoDB shell version" | Take-Part -Part 3
|
$mongo = Run-Command "mongo --version" | Select-String "MongoDB shell version" | Take-Part -Part 3
|
||||||
@@ -167,7 +167,7 @@ $markdown += New-MDList -Style Unordered -NoNewLine -Lines @(
|
|||||||
"azcopy $azcopyVersion",
|
"azcopy $azcopyVersion",
|
||||||
"zstd $zstdVersion",
|
"zstd $zstdVersion",
|
||||||
$bazelVersion,
|
$bazelVersion,
|
||||||
"bazelisk $($bazeliskVersion.Trim())",
|
$bazeliskVersion,
|
||||||
"helm $helmVersion",
|
"helm $helmVersion",
|
||||||
"mongo $mongo",
|
"mongo $mongo",
|
||||||
"mongod $mongod",
|
"mongod $mongod",
|
||||||
|
|||||||
@@ -1,10 +1,22 @@
|
|||||||
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
|
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
|
||||||
Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1"
|
Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1"
|
||||||
|
Import-Module "$PSScriptRoot/../software-report/SoftwareReport.Android.psm1"
|
||||||
|
|
||||||
$os = Get-OSVersion
|
$os = Get-OSVersion
|
||||||
|
|
||||||
Describe "Android" {
|
Describe "Android" {
|
||||||
$androidNdkToolchains = @("mips64el-linux-android-4.9", "mipsel-linux-android-4.9")
|
$androidNdkToolchains = @("mips64el-linux-android-4.9", "mipsel-linux-android-4.9")
|
||||||
|
$androidSdkManagerPackages = Get-AndroidPackages
|
||||||
|
[int]$platformMinVersion = Get-ToolsetValue "android.platform_min_version"
|
||||||
|
[version]$buildToolsMinVersion = Get-ToolsetValue "android.build_tools_min_version"
|
||||||
|
|
||||||
|
$platforms = (($androidSdkManagerPackages | Where-Object { "$_".StartsWith("platforms;") }) -replace 'platforms;', '' |
|
||||||
|
Where-Object { [int]$_.Split("-")[1] -ge $platformMinVersion } | Sort-Object { [int]$_.Split("-")[1] } -Unique |
|
||||||
|
ForEach-Object { "platforms/${_}" })
|
||||||
|
|
||||||
|
$buildTools = (($androidSdkManagerPackages | Where-Object { "$_".StartsWith("build-tools;") }) -replace 'build-tools;', '' |
|
||||||
|
Where-Object { [version]$_ -ge $buildToolsMinVersion } | Sort-Object { [version]$_ } -Unique |
|
||||||
|
ForEach-Object { "build-tools/${_}" })
|
||||||
|
|
||||||
$androidPackages = @(
|
$androidPackages = @(
|
||||||
"tools",
|
"tools",
|
||||||
@@ -12,8 +24,8 @@ Describe "Android" {
|
|||||||
"tools/proguard",
|
"tools/proguard",
|
||||||
"ndk-bundle",
|
"ndk-bundle",
|
||||||
"cmake",
|
"cmake",
|
||||||
(Get-ToolsetValue "android.platform-list" | ForEach-Object { "platforms/${_}" }),
|
$platforms,
|
||||||
(Get-ToolsetValue "android.build-tools" | ForEach-Object { "build-tools/${_}" }),
|
$buildTools,
|
||||||
(Get-ToolsetValue "android.extra-list" | ForEach-Object { "extras/${_}" }),
|
(Get-ToolsetValue "android.extra-list" | ForEach-Object { "extras/${_}" }),
|
||||||
(Get-ToolsetValue "android.addon-list" | ForEach-Object { "add-ons/${_}" })
|
(Get-ToolsetValue "android.addon-list" | ForEach-Object { "add-ons/${_}" })
|
||||||
) | ForEach-Object { $_ }
|
) | ForEach-Object { $_ }
|
||||||
@@ -26,7 +38,7 @@ Describe "Android" {
|
|||||||
[Parameter(Mandatory=$true)]
|
[Parameter(Mandatory=$true)]
|
||||||
[string]$PackageName
|
[string]$PackageName
|
||||||
)
|
)
|
||||||
|
|
||||||
# Convert 'm2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-beta1' ->
|
# Convert 'm2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-beta1' ->
|
||||||
# 'm2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-beta1'
|
# 'm2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-beta1'
|
||||||
$PackageName = $PackageName.Replace(";", "/")
|
$PackageName = $PackageName.Replace(";", "/")
|
||||||
@@ -62,14 +74,14 @@ Describe "Android" {
|
|||||||
$rawContent = Get-Content $ndkBundlePath -Raw
|
$rawContent = Get-Content $ndkBundlePath -Raw
|
||||||
$rawContent | Should -BeLikeExactly "*Revision = 21.*"
|
$rawContent | Should -BeLikeExactly "*Revision = 21.*"
|
||||||
}
|
}
|
||||||
|
|
||||||
It "Android NDK version r18b is installed" {
|
It "Android NDK version r18b is installed" {
|
||||||
$ndk18BundlePath = Join-Path $ANDROID_SDK_DIR "ndk" "18.1.5063045" "source.properties"
|
$ndk18BundlePath = Join-Path $ANDROID_SDK_DIR "ndk" "18.1.5063045" "source.properties"
|
||||||
$rawContent = Get-Content $ndk18BundlePath -Raw
|
$rawContent = Get-Content $ndk18BundlePath -Raw
|
||||||
$rawContent | Should -BeLikeExactly "*Revision = 18.*"
|
$rawContent | Should -BeLikeExactly "*Revision = 18.*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
It "HAXM is installed" {
|
It "HAXM is installed" {
|
||||||
$haxmPath = Join-Path $ANDROID_SDK_DIR "extras" "intel" "Hardware_Accelerated_Execution_Manager" "silent_install.sh"
|
$haxmPath = Join-Path $ANDROID_SDK_DIR "extras" "intel" "Hardware_Accelerated_Execution_Manager" "silent_install.sh"
|
||||||
"$haxmPath -v" | Should -ReturnZeroExitCode
|
"$haxmPath -v" | Should -ReturnZeroExitCode
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user