Another mop up commit to add missing changes from the last mop-up.

This commit is contained in:
Shady Ibraheem
2019-12-13 09:48:00 -05:00
parent 95d3c31f21
commit 1dcd276b1e
188 changed files with 7333 additions and 7393 deletions

View File

@@ -1,72 +1,72 @@
Function CreateAzureVMFromPackerTemplate {
<#
.SYNOPSIS
Creates an Azure VM from a template. Also generates network resources in Azure to make the VM accessible.
.DESCRIPTION
Creates Azure resources and kicks off a packer image generation for the selected image type.
.PARAMETER SubscriptionId
The Azure subscription Id where resources will be created.
.PARAMETER ResourceGroupName
The Azure resource group name where the Azure virtual machine will be created.
.PARAMETER TemplatFilePath
The path for the json template generated by packer during image generation locally.
.PARAMETER VirtualMachineName
The name of the virtual machine to be generated.
.PARAMETER AdminUserName
The administrator username for the virtual machine to be created.
.PARAMETER AdminPassword
The administrator password for the virtual machine to be created.
.PARAMETER AzureLocation
The location where the Azure virtual machine will be provisioned. Example: "eastus"
.EXAMPLE
CreateAzureVMFromPackerTemplate -SubscriptionId {YourSubscriptionId} -ResourceGroupName {ResourceGroupName} -TemplateFile "C:\BuildVmImages\temporaryTemplate.json" -VirtualMachineName "testvm1" -AdminUsername "shady1" -AdminPassword "SomeSecurePassword1" -AzureLocation "eastus"
#>
param (
[Parameter(Mandatory = $True)]
[string] $SubscriptionId,
[Parameter(Mandatory = $True)]
[string] $ResourceGroupName,
[Parameter(Mandatory = $True)]
[string] $TemplateFilePath,
[Parameter(Mandatory = $True)]
[string] $VirtualMachineName,
[Parameter(Mandatory = $True)]
[string] $AdminUsername,
[Parameter(Mandatory = $True)]
[string] $AdminPassword,
[Parameter(Mandatory = $True)]
[string] $AzureLocation
)
$vmSize = "Standard_DS2_v2"
$vnetName = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper()
$subnetName = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper()
$nicName = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper()
$publicIpName = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper()
Write-Host "Creating a Vnet and a Subnet"
az network vnet create -g $ResourceGroupName -l $AzureLocation --name $vnetName --address-prefix 10.0.0.0/16 --subscription $subscriptionId
az network vnet subnet create -g $ResourceGroupName --vnet-name $vnetName -n $subnetName --address-prefix 10.0.1.0/24 --subscription $subscriptionId
Write-Host "Creating a network interface card (NIC)."
$nic = az network nic create -g $ResourceGroupName --vnet-name $vnetName --subnet $subnetName -n $nicName --subscription $subscriptionId
$networkId = ($nic | ConvertFrom-Json).NewNIC.id
Write-Host "create public IP."
az network public-ip create -g $ResourceGroupName -n $publicIpName --subscription $subscriptionId --allocation-method Static --location $AzureLocation --sku Standard --version IPv4
Write-Host "Adding the public IP to the NIC."
az network nic ip-config update --name ipconfig1 --nic-name $nicName --resource-group $ResourceGroupName --subscription $subscriptionId --public-ip-address $publicIpName
Write-Host "Creating the VM"
az group deployment create --resource-group $ResourceGroupName --subscription $subscriptionId --name $VirtualMachineName --template-file $templateFilePath --parameters vmSize=$vmSize vmName=$VirtualMachineName adminUserName=$AdminUsername adminPassword=$AdminPassword networkInterfaceId=$networkId
}
Function CreateAzureVMFromPackerTemplate {
<#
.SYNOPSIS
Creates an Azure VM from a template. Also generates network resources in Azure to make the VM accessible.
.DESCRIPTION
Creates Azure resources and kicks off a packer image generation for the selected image type.
.PARAMETER SubscriptionId
The Azure subscription Id where resources will be created.
.PARAMETER ResourceGroupName
The Azure resource group name where the Azure virtual machine will be created.
.PARAMETER TemplatFilePath
The path for the json template generated by packer during image generation locally.
.PARAMETER VirtualMachineName
The name of the virtual machine to be generated.
.PARAMETER AdminUserName
The administrator username for the virtual machine to be created.
.PARAMETER AdminPassword
The administrator password for the virtual machine to be created.
.PARAMETER AzureLocation
The location where the Azure virtual machine will be provisioned. Example: "eastus"
.EXAMPLE
CreateAzureVMFromPackerTemplate -SubscriptionId {YourSubscriptionId} -ResourceGroupName {ResourceGroupName} -TemplateFile "C:\BuildVmImages\temporaryTemplate.json" -VirtualMachineName "testvm1" -AdminUsername "shady1" -AdminPassword "SomeSecurePassword1" -AzureLocation "eastus"
#>
param (
[Parameter(Mandatory = $True)]
[string] $SubscriptionId,
[Parameter(Mandatory = $True)]
[string] $ResourceGroupName,
[Parameter(Mandatory = $True)]
[string] $TemplateFilePath,
[Parameter(Mandatory = $True)]
[string] $VirtualMachineName,
[Parameter(Mandatory = $True)]
[string] $AdminUsername,
[Parameter(Mandatory = $True)]
[string] $AdminPassword,
[Parameter(Mandatory = $True)]
[string] $AzureLocation
)
$vmSize = "Standard_DS2_v2"
$vnetName = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper()
$subnetName = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper()
$nicName = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper()
$publicIpName = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper()
Write-Host "Creating a Vnet and a Subnet"
az network vnet create -g $ResourceGroupName -l $AzureLocation --name $vnetName --address-prefix 10.0.0.0/16 --subscription $subscriptionId
az network vnet subnet create -g $ResourceGroupName --vnet-name $vnetName -n $subnetName --address-prefix 10.0.1.0/24 --subscription $subscriptionId
Write-Host "Creating a network interface card (NIC)."
$nic = az network nic create -g $ResourceGroupName --vnet-name $vnetName --subnet $subnetName -n $nicName --subscription $subscriptionId
$networkId = ($nic | ConvertFrom-Json).NewNIC.id
Write-Host "create public IP."
az network public-ip create -g $ResourceGroupName -n $publicIpName --subscription $subscriptionId --allocation-method Static --location $AzureLocation --sku Standard --version IPv4
Write-Host "Adding the public IP to the NIC."
az network nic ip-config update --name ipconfig1 --nic-name $nicName --resource-group $ResourceGroupName --subscription $subscriptionId --public-ip-address $publicIpName
Write-Host "Creating the VM"
az group deployment create --resource-group $ResourceGroupName --subscription $subscriptionId --name $VirtualMachineName --template-file $templateFilePath --parameters vmSize=$vmSize vmName=$VirtualMachineName adminUserName=$AdminUsername adminPassword=$AdminPassword networkInterfaceId=$networkId
}

View File

@@ -1,159 +1,159 @@
$ErrorActionPreference = 'Stop'
enum ImageType {
Windows2016 = 0
Windows2019 = 1
Ubuntu1604 = 2
Ubuntu1804 = 3
}
Function Get-PackerTemplatePath {
param (
[Parameter(Mandatory = $True)]
[string] $RepositoryRoot,
[Parameter(Mandatory = $True)]
[ImageType] $ImageType
)
$relativePath = "N/A"
switch ($ImageType) {
([ImageType]::Windows2016) {
$relativePath = "\images\win\Windows2016-Azure.json"
}
([ImageType]::Windows2019) {
$relativePath = "\images\win\Windows2019-Azure.json"
}
([ImageType]::Ubuntu1604) {
$relativePath = "\images\linux\ubuntu1604.json"
}
([ImageType]::Ubuntu1804) {
$relativePath = "\images\linux\ubuntu1804.json"
}
}
return $RepositoryRoot + $relativePath;
}
Function GenerateResourcesAndImage {
<#
.SYNOPSIS
A helper function to help generate an image.
.DESCRIPTION
Creates Azure resources and kicks off a packer image generation for the selected image type.
.PARAMETER SubscriptionId
The Azure subscription Id where resources will be created.
.PARAMETER ResourceGroupName
The Azure resource group name where the Azure resources will be created.
.PARAMETER ImageGenerationRepositoryRoot
The root path of the image generation repository source.
.PARAMETER ImageType
The type of the image being generated. Valid options are: {"Windows2016", "Windows2019", "Ubuntu1604", "Ubuntu1804"}.
.PARAMETER AzureLocation
The location of the resources being created in Azure. For example "East US".
.PARAMETER Force
Delete the resource group if it exists without user confirmation.
.EXAMPLE
GenerateResourcesAndImage -SubscriptionId {YourSubscriptionId} -ResourceGroupName "shsamytest1" -ImageGenerationRepositoryRoot "C:\azure-pipelines-image-generation" -ImageType Ubuntu1604 -AzureLocation "East US"
#>
param (
[Parameter(Mandatory = $True)]
[string] $SubscriptionId,
[Parameter(Mandatory = $True)]
[string] $ResourceGroupName,
[Parameter(Mandatory = $True)]
[string] $ImageGenerationRepositoryRoot,
[Parameter(Mandatory = $True)]
[ImageType] $ImageType,
[Parameter(Mandatory = $True)]
[string] $AzureLocation,
[Parameter(Mandatory = $False)]
[int] $SecondsToWaitForServicePrincipalSetup = 30,
[Parameter(Mandatory = $False)]
[Switch] $Force
)
$builderScriptPath = Get-PackerTemplatePath -RepositoryRoot $ImageGenerationRepositoryRoot -ImageType $ImageType
$ServicePrincipalClientSecret = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper();
$InstallPassword = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper();
Login-AzureRmAccount
Set-AzureRmContext -SubscriptionId $SubscriptionId
$alreadyExists = $true;
try {
Get-AzureRmResourceGroup -Name $ResourceGroupName
Write-Verbose "Resource group was found, will delete and recreate it."
}
catch {
Write-Verbose "Resource group was not found, will create it."
$alreadyExists = $false;
}
if ($alreadyExists) {
if($Force -eq $true) {
# Cleanup the resource group if it already exitsted before
Remove-AzureRmResourceGroup -Name $ResourceGroupName -Force
New-AzureRmResourceGroup -Name $ResourceGroupName -Location $AzureLocation
} else {
$title = "Delete Resource Group"
$message = "The resource group you specified already exists. Do you want to clean it up?"
$yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", `
"Delete the resource group including all resources."
$no = New-Object System.Management.Automation.Host.ChoiceDescription "&No", `
"Keep the resource group and continue."
$stop = New-Object System.Management.Automation.Host.ChoiceDescription "&Stop", `
"Stop the current action."
$options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no, $stop)
$result = $host.ui.PromptForChoice($title, $message, $options, 0)
switch ($result)
{
0 { Remove-AzureRmResourceGroup -Name $ResourceGroupName -Force; New-AzureRmResourceGroup -Name $ResourceGroupName -Location $AzureLocation }
1 { <# Do nothing #> }
2 { exit }
}
}
} else {
New-AzureRmResourceGroup -Name $ResourceGroupName -Location $AzureLocation
}
# This script should follow the recommended naming conventions for azure resources
$storageAccountName = if($ResourceGroupName.EndsWith("-rg")) {
$ResourceGroupName.Substring(0, $ResourceGroupName.Length -3)
} else { $ResourceGroupName }
# Resource group names may contain special characters, that are not allowed in the storage account name
$storageAccountName = $storageAccountName.Replace("-", "").Replace("_", "").Replace("(", "").Replace(")", "").ToLower()
$storageAccountName += "001"
New-AzureRmStorageAccount -ResourceGroupName $ResourceGroupName -AccountName $storageAccountName -Location $AzureLocation -SkuName "Standard_LRS"
$spDisplayName = [System.GUID]::NewGuid().ToString().ToUpper()
$sp = New-AzureRmADServicePrincipal -DisplayName $spDisplayName -Password (ConvertTo-SecureString $ServicePrincipalClientSecret -AsPlainText -Force)
$spAppId = $sp.ApplicationId
$spClientId = $sp.ApplicationId
$spObjectId = $sp.Id
Start-Sleep -Seconds $SecondsToWaitForServicePrincipalSetup
New-AzureRmRoleAssignment -RoleDefinitionName Contributor -ServicePrincipalName $spAppId
Start-Sleep -Seconds $SecondsToWaitForServicePrincipalSetup
$sub = Get-AzureRmSubscription -SubscriptionId $SubscriptionId
$tenantId = $sub.TenantId
# "", "Note this variable-setting script for running Packer with these Azure resources in the future:", "==============================================================================================", "`$spClientId = `"$spClientId`"", "`$ServicePrincipalClientSecret = `"$ServicePrincipalClientSecret`"", "`$SubscriptionId = `"$SubscriptionId`"", "`$tenantId = `"$tenantId`"", "`$spObjectId = `"$spObjectId`"", "`$AzureLocation = `"$AzureLocation`"", "`$ResourceGroupName = `"$ResourceGroupName`"", "`$storageAccountName = `"$storageAccountName`"", "`$install_password = `"$install_password`"", ""
packer.exe build -on-error=ask -var "client_id=$($spClientId)" -var "client_secret=$($ServicePrincipalClientSecret)" -var "subscription_id=$($SubscriptionId)" -var "tenant_id=$($tenantId)" -var "object_id=$($spObjectId)" -var "location=$($AzureLocation)" -var "resource_group=$($ResourceGroupName)" -var "storage_account=$($storageAccountName)" -var "install_password=$($InstallPassword)" $builderScriptPath
}
$ErrorActionPreference = 'Stop'
enum ImageType {
Windows2016 = 0
Windows2019 = 1
Ubuntu1604 = 2
Ubuntu1804 = 3
}
Function Get-PackerTemplatePath {
param (
[Parameter(Mandatory = $True)]
[string] $RepositoryRoot,
[Parameter(Mandatory = $True)]
[ImageType] $ImageType
)
$relativePath = "N/A"
switch ($ImageType) {
([ImageType]::Windows2016) {
$relativePath = "\images\win\Windows2016-Azure.json"
}
([ImageType]::Windows2019) {
$relativePath = "\images\win\Windows2019-Azure.json"
}
([ImageType]::Ubuntu1604) {
$relativePath = "\images\linux\ubuntu1604.json"
}
([ImageType]::Ubuntu1804) {
$relativePath = "\images\linux\ubuntu1804.json"
}
}
return $RepositoryRoot + $relativePath;
}
Function GenerateResourcesAndImage {
<#
.SYNOPSIS
A helper function to help generate an image.
.DESCRIPTION
Creates Azure resources and kicks off a packer image generation for the selected image type.
.PARAMETER SubscriptionId
The Azure subscription Id where resources will be created.
.PARAMETER ResourceGroupName
The Azure resource group name where the Azure resources will be created.
.PARAMETER ImageGenerationRepositoryRoot
The root path of the image generation repository source.
.PARAMETER ImageType
The type of the image being generated. Valid options are: {"Windows2016", "Windows2019", "Ubuntu1604", "Ubuntu1804"}.
.PARAMETER AzureLocation
The location of the resources being created in Azure. For example "East US".
.PARAMETER Force
Delete the resource group if it exists without user confirmation.
.EXAMPLE
GenerateResourcesAndImage -SubscriptionId {YourSubscriptionId} -ResourceGroupName "shsamytest1" -ImageGenerationRepositoryRoot "C:\azure-pipelines-image-generation" -ImageType Ubuntu1604 -AzureLocation "East US"
#>
param (
[Parameter(Mandatory = $True)]
[string] $SubscriptionId,
[Parameter(Mandatory = $True)]
[string] $ResourceGroupName,
[Parameter(Mandatory = $True)]
[string] $ImageGenerationRepositoryRoot,
[Parameter(Mandatory = $True)]
[ImageType] $ImageType,
[Parameter(Mandatory = $True)]
[string] $AzureLocation,
[Parameter(Mandatory = $False)]
[int] $SecondsToWaitForServicePrincipalSetup = 30,
[Parameter(Mandatory = $False)]
[Switch] $Force
)
$builderScriptPath = Get-PackerTemplatePath -RepositoryRoot $ImageGenerationRepositoryRoot -ImageType $ImageType
$ServicePrincipalClientSecret = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper();
$InstallPassword = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper();
Login-AzureRmAccount
Set-AzureRmContext -SubscriptionId $SubscriptionId
$alreadyExists = $true;
try {
Get-AzureRmResourceGroup -Name $ResourceGroupName
Write-Verbose "Resource group was found, will delete and recreate it."
}
catch {
Write-Verbose "Resource group was not found, will create it."
$alreadyExists = $false;
}
if ($alreadyExists) {
if($Force -eq $true) {
# Cleanup the resource group if it already exitsted before
Remove-AzureRmResourceGroup -Name $ResourceGroupName -Force
New-AzureRmResourceGroup -Name $ResourceGroupName -Location $AzureLocation
} else {
$title = "Delete Resource Group"
$message = "The resource group you specified already exists. Do you want to clean it up?"
$yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", `
"Delete the resource group including all resources."
$no = New-Object System.Management.Automation.Host.ChoiceDescription "&No", `
"Keep the resource group and continue."
$stop = New-Object System.Management.Automation.Host.ChoiceDescription "&Stop", `
"Stop the current action."
$options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no, $stop)
$result = $host.ui.PromptForChoice($title, $message, $options, 0)
switch ($result)
{
0 { Remove-AzureRmResourceGroup -Name $ResourceGroupName -Force; New-AzureRmResourceGroup -Name $ResourceGroupName -Location $AzureLocation }
1 { <# Do nothing #> }
2 { exit }
}
}
} else {
New-AzureRmResourceGroup -Name $ResourceGroupName -Location $AzureLocation
}
# This script should follow the recommended naming conventions for azure resources
$storageAccountName = if($ResourceGroupName.EndsWith("-rg")) {
$ResourceGroupName.Substring(0, $ResourceGroupName.Length -3)
} else { $ResourceGroupName }
# Resource group names may contain special characters, that are not allowed in the storage account name
$storageAccountName = $storageAccountName.Replace("-", "").Replace("_", "").Replace("(", "").Replace(")", "").ToLower()
$storageAccountName += "001"
New-AzureRmStorageAccount -ResourceGroupName $ResourceGroupName -AccountName $storageAccountName -Location $AzureLocation -SkuName "Standard_LRS"
$spDisplayName = [System.GUID]::NewGuid().ToString().ToUpper()
$sp = New-AzureRmADServicePrincipal -DisplayName $spDisplayName -Password (ConvertTo-SecureString $ServicePrincipalClientSecret -AsPlainText -Force)
$spAppId = $sp.ApplicationId
$spClientId = $sp.ApplicationId
$spObjectId = $sp.Id
Start-Sleep -Seconds $SecondsToWaitForServicePrincipalSetup
New-AzureRmRoleAssignment -RoleDefinitionName Contributor -ServicePrincipalName $spAppId
Start-Sleep -Seconds $SecondsToWaitForServicePrincipalSetup
$sub = Get-AzureRmSubscription -SubscriptionId $SubscriptionId
$tenantId = $sub.TenantId
# "", "Note this variable-setting script for running Packer with these Azure resources in the future:", "==============================================================================================", "`$spClientId = `"$spClientId`"", "`$ServicePrincipalClientSecret = `"$ServicePrincipalClientSecret`"", "`$SubscriptionId = `"$SubscriptionId`"", "`$tenantId = `"$tenantId`"", "`$spObjectId = `"$spObjectId`"", "`$AzureLocation = `"$AzureLocation`"", "`$ResourceGroupName = `"$ResourceGroupName`"", "`$storageAccountName = `"$storageAccountName`"", "`$install_password = `"$install_password`"", ""
packer.exe build -on-error=ask -var "client_id=$($spClientId)" -var "client_secret=$($ServicePrincipalClientSecret)" -var "subscription_id=$($SubscriptionId)" -var "tenant_id=$($tenantId)" -var "object_id=$($spObjectId)" -var "location=$($AzureLocation)" -var "resource_group=$($ResourceGroupName)" -var "storage_account=$($storageAccountName)" -var "install_password=$($InstallPassword)" $builderScriptPath
}

View File

@@ -1,4 +1,8 @@
#!/bin/bash
################################################################################
## File: containercache.sh
## Desc: Prepulls Docker images used in build tasks and templates
################################################################################
source $HELPER_SCRIPTS/apt.sh
source $HELPER_SCRIPTS/document.sh

View File

@@ -57,4 +57,4 @@ DocumentInstalledItem "Az Module (1.6.0)"
DocumentInstalledItem "Az Module (2.3.2)"
DocumentInstalledItem "Az Module (2.6.0)"
DocumentInstalledItem "Az Module (2.8.0)"
DocumentInstalledItem "Az Module (3.1.0)"
DocumentInstalledItem "Az Module (3.1.0)"

View File

@@ -85,4 +85,4 @@ DocumentInstalledItemIndent "time"
DocumentInstalledItemIndent "unzip"
DocumentInstalledItemIndent "wget"
DocumentInstalledItemIndent "zip"
DocumentInstalledItemIndent "tzdata"
DocumentInstalledItemIndent "tzdata"

View File

@@ -1,36 +1,36 @@
#!/bin/bash
################################################################################
## File: go.sh
## Desc: Installs go, configures GOROOT, and adds go to the path
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# This function installs Go using the specified arguments:
# $1=MajorVersion (1.11)
# $2=MajorAndMinorVersion (1.11.1)
# $3=IsDefaultVersion (true or false)
function InstallGo () {
curl -sL https://dl.google.com/go/go$2.linux-amd64.tar.gz -o go$2.linux-amd64.tar.gz
mkdir -p /usr/local/go$1
tar -C /usr/local/go$1 -xzf go$2.linux-amd64.tar.gz --strip-components=1 go
rm go$2.linux-amd64.tar.gz
echo "GOROOT_${1//./_}_X64=/usr/local/go$1" | tee -a /etc/environment
DocumentInstalledItem "Go $1 ($(/usr/local/go$1/bin/go version))"
# If this version of Go is to be the default version,
# symlink it into the path and point GOROOT to it.
if [ $3 = true ]
then
ln -s /usr/local/go$1/bin/* /usr/bin/
echo "GOROOT=/usr/local/go$1" | tee -a /etc/environment
fi
}
# Install Go versions
InstallGo 1.9 1.9.7 false
InstallGo 1.10 1.10.8 false
InstallGo 1.11 1.11.12 false
InstallGo 1.12 1.12.7 true
InstallGo 1.13 1.13 false
#!/bin/bash
################################################################################
## File: go.sh
## Desc: Installs go, configures GOROOT, and adds go to the path
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# This function installs Go using the specified arguments:
# $1=MajorVersion (1.11)
# $2=MajorAndMinorVersion (1.11.1)
# $3=IsDefaultVersion (true or false)
function InstallGo () {
curl -sL https://dl.google.com/go/go$2.linux-amd64.tar.gz -o go$2.linux-amd64.tar.gz
mkdir -p /usr/local/go$1
tar -C /usr/local/go$1 -xzf go$2.linux-amd64.tar.gz --strip-components=1 go
rm go$2.linux-amd64.tar.gz
echo "GOROOT_${1//./_}_X64=/usr/local/go$1" | tee -a /etc/environment
DocumentInstalledItem "Go $1 ($(/usr/local/go$1/bin/go version))"
# If this version of Go is to be the default version,
# symlink it into the path and point GOROOT to it.
if [ $3 = true ]
then
ln -s /usr/local/go$1/bin/* /usr/bin/
echo "GOROOT=/usr/local/go$1" | tee -a /etc/environment
fi
}
# Install Go versions
InstallGo 1.9 1.9.7 false
InstallGo 1.10 1.10.8 false
InstallGo 1.11 1.11.12 false
InstallGo 1.12 1.12.7 true
InstallGo 1.13 1.13 false

View File

@@ -27,13 +27,13 @@ for setup in $setups; do
cd $original_directory;
done;
DocumentInstalledItem "Python (available through the [setup-python](https://github.com/actions/setup-python/blob/master/README.md) task)"
DocumentInstalledItem "Python (available through the [Use Python Version](https://go.microsoft.com/fwlink/?linkid=871498) task)"
pythons=$(ls $AGENT_TOOLSDIRECTORY/Python)
for python in $pythons; do
DocumentInstalledItemIndent "Python $python"
done;
DocumentInstalledItem "Ruby (available through the [setup-ruby](https://github.com/actions/setup-ruby/blob/master/README.md) task)"
DocumentInstalledItem "Ruby (available through the [Use Ruby Version](https://go.microsoft.com/fwlink/?linkid=2005989) task)"
rubys=$(ls $AGENT_TOOLSDIRECTORY/Ruby)
for ruby in $rubys; do
DocumentInstalledItemIndent "Ruby $ruby"

View File

@@ -1,40 +1,40 @@
#!/bin/bash
################################################################################
## File: kubernetes-tools.sh
## Desc: Installs kubectl, helm
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
## Install kubectl
apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
touch /etc/apt/sources.list.d/kubernetes.list
echo "deb http://apt.kubernetes.io/ kubernetes-$(lsb_release -cs) main" | tee -a /etc/apt/sources.list.d/kubernetes.list
apt-get update
apt-get install -y kubectl
# Install Helm
curl -L https://git.io/get_helm.sh | bash
# 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 kubectl; then
echo "kubectl was not installed"
exit 1
fi
if ! command -v helm; then
echo "helm was not installed"
exit 1
fi
echo "Initializing helm"
helm init --client-only
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "kubectl ($(kubectl version --short |& head -n 1))"
DocumentInstalledItem "helm ($(helm version --short |& head -n 1))"
#!/bin/bash
################################################################################
## File: kubernetes-tools.sh
## Desc: Installs kubectl, helm
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
## Install kubectl
apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
touch /etc/apt/sources.list.d/kubernetes.list
echo "deb http://apt.kubernetes.io/ kubernetes-$(lsb_release -cs) main" | tee -a /etc/apt/sources.list.d/kubernetes.list
apt-get update
apt-get install -y kubectl
# Install Helm
curl -L https://git.io/get_helm.sh | bash
# 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 kubectl; then
echo "kubectl was not installed"
exit 1
fi
if ! command -v helm; then
echo "helm was not installed"
exit 1
fi
echo "Initializing helm"
helm init --client-only
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "kubectl ($(kubectl version --short |& head -n 1))"
DocumentInstalledItem "helm ($(helm version --short |& head -n 1))"

View File

@@ -1,25 +1,25 @@
#!/bin/bash
################################################################################
## File: mercurial.sh
## Desc: Installs Mercurial
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
# Install Mercurial from the mercurial-ppa/releases repository for the latest version.
# https://www.mercurial-scm.org/wiki/Download
add-apt-repository ppa:mercurial-ppa/releases -y
apt-get update
apt-get install -y --no-install-recommends mercurial
# 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 hg; then
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Mercurial ($(hg --version | head -n 1))"
#!/bin/bash
################################################################################
## File: mercurial.sh
## Desc: Installs Mercurial
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
# Install Mercurial from the mercurial-ppa/releases repository for the latest version.
# https://www.mercurial-scm.org/wiki/Download
add-apt-repository ppa:mercurial-ppa/releases -y
apt-get update
apt-get install -y --no-install-recommends mercurial
# 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 hg; then
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Mercurial ($(hg --version | head -n 1))"

View File

@@ -1,302 +1,268 @@
#!/bin/bash
################################################################################
## File: php.sh
## Desc: Installs php
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
LSB_RELEASE=$(lsb_release -rs)
set -e
apt-add-repository ppa:ondrej/php -y
# Install php5.6
apt-get update
apt-fast install -y --no-install-recommends \
php5.6 \
php5.6-bcmath \
php5.6-bz2 \
php5.6-cgi \
php5.6-cli \
php5.6-common \
php5.6-curl \
php5.6-dba \
php5.6-dev \
php5.6-enchant \
php5.6-fpm \
php5.6-gd \
php5.6-gmp \
php5.6-imap \
php5.6-interbase \
php5.6-intl \
php5.6-json \
php5.6-ldap \
php5.6-mbstring \
php5.6-mcrypt \
php5.6-mysql \
php5.6-odbc \
php5.6-opcache \
php5.6-pgsql \
php5.6-phpdbg \
php5.6-pspell \
php5.6-readline \
php5.6-recode \
php5.6-snmp \
php5.6-soap \
php5.6-sqlite3 \
php5.6-sybase \
php5.6-tidy \
php5.6-xml \
php5.6-xmlrpc \
php5.6-xsl \
php5.6-zip
apt-get remove --purge -yq php5.6-dev
# Install php7.0
apt-fast install -y --no-install-recommends \
php7.0 \
php7.0-bcmath \
php7.0-bz2 \
php7.0-cgi \
php7.0-cli \
php7.0-common \
php7.0-curl \
php7.0-dba \
php7.0-dev \
php7.0-enchant \
php7.0-fpm \
php7.0-gd \
php7.0-gmp \
php7.0-imap \
php7.0-interbase \
php7.0-intl \
php7.0-json \
php7.0-ldap \
php7.0-mbstring \
php7.0-mcrypt \
php7.0-mysql \
php7.0-odbc \
php7.0-opcache \
php7.0-pgsql \
php7.0-phpdbg \
php7.0-pspell \
php7.0-readline \
php7.0-recode \
php7.0-snmp \
php7.0-soap \
php7.0-sqlite3 \
php7.0-sybase \
php7.0-tidy \
php7.0-xml \
php7.0-xmlrpc \
php7.0-xsl \
php7.0-zip
apt-get remove --purge -yq php7.0-dev
# Install php7.1
apt-fast install -y --no-install-recommends \
php7.1 \
php7.1-bcmath \
php7.1-bz2 \
php7.1-cgi \
php7.1-cli \
php7.1-common \
php7.1-curl \
php7.1-dba \
php7.1-dev \
php7.1-enchant \
php7.1-fpm \
php7.1-gd \
php7.1-gmp \
php7.1-imap \
php7.1-interbase \
php7.1-intl \
php7.1-json \
php7.1-ldap \
php7.1-mbstring \
php7.1-mcrypt \
php7.1-mysql \
php7.1-odbc \
php7.1-opcache \
php7.1-pgsql \
php7.1-phpdbg \
php7.1-pspell \
php7.1-readline \
php7.1-recode \
php7.1-snmp \
php7.1-soap \
php7.1-sqlite3 \
php7.1-sybase \
php7.1-tidy \
php7.1-xml \
php7.1-xmlrpc \
php7.1-xsl \
php7.1-zip
apt-get remove --purge -yq php7.1-dev
# Install php7.2
apt-fast install -y --no-install-recommends \
php7.2 \
php7.2-bcmath \
php7.2-bz2 \
php7.2-cgi \
php7.2-cli \
php7.2-common \
php7.2-curl \
php7.2-dba \
php7.2-dev \
php7.2-enchant \
php7.2-fpm \
php7.2-gd \
php7.2-gmp \
php7.2-imap \
php7.2-interbase \
php7.2-intl \
php7.2-json \
php7.2-ldap \
php7.2-mbstring \
php7.2-mysql \
php7.2-odbc \
php7.2-opcache \
php7.2-pgsql \
php7.2-phpdbg \
php7.2-pspell \
php7.2-readline \
php7.2-recode \
php7.2-snmp \
php7.2-soap \
php7.2-sqlite3 \
php7.2-sybase \
php7.2-tidy \
php7.2-xml \
php7.2-xmlrpc \
php7.2-xsl \
php7.2-zip
# Install php7.3
apt-fast install -y --no-install-recommends \
php7.3 \
php7.3-bcmath \
php7.3-bz2 \
php7.3-cgi \
php7.3-cli \
php7.3-common \
php7.3-curl \
php7.3-dba \
php7.3-dev \
php7.3-enchant \
php7.3-fpm \
php7.3-gd \
php7.3-gmp \
php7.3-imap \
php7.3-interbase \
php7.3-intl \
php7.3-json \
php7.3-ldap \
php7.3-mbstring \
php7.3-mysql \
php7.3-odbc \
php7.3-opcache \
php7.3-pgsql \
php7.3-phpdbg \
php7.3-pspell \
php7.3-readline \
php7.3-recode \
php7.3-snmp \
php7.3-soap \
php7.3-sqlite3 \
php7.3-sybase \
php7.3-tidy \
php7.3-xml \
php7.3-xmlrpc \
php7.3-xsl \
php7.3-zip
# Install php7.4
apt-fast install -y --no-install-recommends \
php7.4 \
php7.4-bcmath \
php7.4-bz2 \
php7.4-cgi \
php7.4-cli \
php7.4-common \
php7.4-curl \
php7.4-dba \
php7.4-dev \
php7.4-enchant \
php7.4-fpm \
php7.4-gd \
php7.4-gmp \
php7.4-imap \
php7.4-interbase \
php7.4-intl \
php7.4-json \
php7.4-ldap \
php7.4-mbstring \
php7.4-mysql \
php7.4-odbc \
php7.4-opcache \
php7.4-pgsql \
php7.4-phpdbg \
php7.4-pspell \
php7.4-readline \
php7.4-snmp \
php7.4-soap \
php7.4-sqlite3 \
php7.4-sybase \
php7.4-tidy \
php7.4-xml \
php7.4-xmlrpc \
php7.4-xsl \
php7.4-zip
apt-fast install -y --no-install-recommends \
php-amqp \
php-apcu \
php-igbinary \
php-memcache \
php-memcached \
php-mongodb \
php-redis \
php-xdebug \
php-yaml \
php-zmq
apt-get remove --purge -yq php7.2-dev
apt-fast install -y --no-install-recommends snmp
# Install composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
sudo mv composer.phar /usr/bin/composer
php -r "unlink('composer-setup.php');"
# Install phpunit (for PHP)
wget -q -O phpunit https://phar.phpunit.de/phpunit-7.phar
chmod +x phpunit
mv phpunit /usr/local/bin/phpunit
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
for cmd in php php5.6 php7.0 php7.1 php7.2 php7.3 php7.4 composer phpunit; do
if ! command -v $cmd; then
echo "$cmd was not installed"
exit 1
fi
done
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "PHP 5.6 ($(php5.6 --version | head -n 1))"
DocumentInstalledItem "PHP 7.0 ($(php7.0 --version | head -n 1))"
DocumentInstalledItem "PHP 7.1 ($(php7.1 --version | head -n 1))"
DocumentInstalledItem "PHP 7.2 ($(php7.2 --version | head -n 1))"
DocumentInstalledItem "PHP 7.3 ($(php7.3 --version | head -n 1))"
DocumentInstalledItem "PHP 7.4 ($(php7.4 --version | head -n 1))"
DocumentInstalledItem "Composer ($(composer --version))"
DocumentInstalledItem "PHPUnit ($(phpunit --version))"
#!/bin/bash
################################################################################
## File: php.sh
## Desc: Installs php
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
LSB_RELEASE=$(lsb_release -rs)
set -e
apt-add-repository ppa:ondrej/php -y
# Install php5.6
apt-get update
apt-fast install -y --no-install-recommends \
php5.6 \
php5.6-amqp \
php5.6-bcmath \
php5.6-bz2 \
php5.6-cgi \
php5.6-cli \
php5.6-common \
php5.6-curl \
php5.6-dba \
php5.6-dev \
php5.6-enchant \
php5.6-fpm \
php5.6-gd \
php5.6-gmp \
php5.6-imap \
php5.6-interbase \
php5.6-intl \
php5.6-json \
php5.6-ldap \
php5.6-mbstring \
php5.6-mcrypt \
php5.6-mysql \
php5.6-odbc \
php5.6-opcache \
php5.6-pgsql \
php5.6-phpdbg \
php5.6-pspell \
php5.6-readline \
php5.6-recode \
php5.6-snmp \
php5.6-soap \
php5.6-sqlite3 \
php5.6-sybase \
php5.6-tidy \
php5.6-xml \
php5.6-xmlrpc \
php5.6-xsl \
php5.6-zip
apt-get remove --purge -yq php5.6-dev
# Install php7.0
apt-fast install -y --no-install-recommends \
php7.0 \
php7.0-amqp \
php7.0-bcmath \
php7.0-bz2 \
php7.0-cgi \
php7.0-cli \
php7.0-common \
php7.0-curl \
php7.0-dba \
php7.0-dev \
php7.0-enchant \
php7.0-fpm \
php7.0-gd \
php7.0-gmp \
php7.0-imap \
php7.0-interbase \
php7.0-intl \
php7.0-json \
php7.0-ldap \
php7.0-mbstring \
php7.0-mcrypt \
php7.0-mysql \
php7.0-odbc \
php7.0-opcache \
php7.0-pgsql \
php7.0-phpdbg \
php7.0-pspell \
php7.0-readline \
php7.0-recode \
php7.0-snmp \
php7.0-soap \
php7.0-sqlite3 \
php7.0-sybase \
php7.0-tidy \
php7.0-xml \
php7.0-xmlrpc \
php7.0-xsl \
php7.0-zip
apt-get remove --purge -yq php7.0-dev
# Install php7.1
apt-fast install -y --no-install-recommends \
php7.1 \
php7.1-amqp \
php7.1-bcmath \
php7.1-bz2 \
php7.1-cgi \
php7.1-cli \
php7.1-common \
php7.1-curl \
php7.1-dba \
php7.1-dev \
php7.1-enchant \
php7.1-fpm \
php7.1-gd \
php7.1-gmp \
php7.1-imap \
php7.1-interbase \
php7.1-intl \
php7.1-json \
php7.1-ldap \
php7.1-mbstring \
php7.1-mcrypt \
php7.1-mysql \
php7.1-odbc \
php7.1-opcache \
php7.1-pgsql \
php7.1-phpdbg \
php7.1-pspell \
php7.1-readline \
php7.1-recode \
php7.1-snmp \
php7.1-soap \
php7.1-sqlite3 \
php7.1-sybase \
php7.1-tidy \
php7.1-xml \
php7.1-xmlrpc \
php7.1-xsl \
php7.1-zip
apt-get remove --purge -yq php7.1-dev
# Install php7.2
apt-fast install -y --no-install-recommends \
php7.2 \
php7.2-apcu \
php7.2-amqp \
php7.2-bcmath \
php7.2-bz2 \
php7.2-cgi \
php7.2-cli \
php7.2-common \
php7.2-curl \
php7.2-dba \
php7.2-dev \
php7.2-enchant \
php7.2-fpm \
php7.2-gd \
php7.2-gmp \
php7.2-imap \
php7.2-interbase \
php7.2-intl \
php7.2-json \
php7.2-ldap \
php7.2-mbstring \
php7.2-mysql \
php7.2-odbc \
php7.2-opcache \
php7.2-pgsql \
php7.2-phpdbg \
php7.2-pspell \
php7.2-readline \
php7.2-recode \
php7.2-snmp \
php7.2-soap \
php7.2-sqlite3 \
php7.2-sybase \
php7.2-tidy \
php7.2-xml \
php7.2-xmlrpc \
php7.2-xsl \
php7.2-zip
# Install php7.3
apt-fast install -y --no-install-recommends \
php7.3 \
php7.3-apcu \
php7.3-amqp \
php7.3-bcmath \
php7.3-bz2 \
php7.3-cgi \
php7.3-cli \
php7.3-common \
php7.3-curl \
php7.3-dba \
php7.3-dev \
php7.3-enchant \
php7.3-fpm \
php7.3-gd \
php7.3-gmp \
php7.3-imap \
php7.3-interbase \
php7.3-intl \
php7.3-json \
php7.3-ldap \
php7.3-mbstring \
php7.3-mysql \
php7.3-odbc \
php7.3-opcache \
php7.3-pgsql \
php7.3-phpdbg \
php7.3-pspell \
php7.3-readline \
php7.3-recode \
php7.3-snmp \
php7.3-soap \
php7.3-sqlite3 \
php7.3-sybase \
php7.3-tidy \
php7.3-xml \
php7.3-xmlrpc \
php7.3-xsl \
php7.3-zip
apt-fast install -y --no-install-recommends \
php-igbinary \
php-memcache \
php-memcached \
php-mongodb \
php-redis \
php-xdebug \
php-yaml \
php-zmq
apt-get remove --purge -yq php7.2-dev
apt-fast install -y --no-install-recommends snmp
# Install composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
sudo mv composer.phar /usr/bin/composer
php -r "unlink('composer-setup.php');"
# Install phpunit (for PHP)
wget -q -O phpunit https://phar.phpunit.de/phpunit-7.phar
chmod +x phpunit
mv phpunit /usr/local/bin/phpunit
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
for cmd in php php5.6 php7.0 php7.1 php7.2 php7.3 composer phpunit; do
if ! command -v $cmd; then
echo "$cmd was not installed"
exit 1
fi
done
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "PHP 5.6 ($(php5.6 --version | head -n 1))"
DocumentInstalledItem "PHP 7.0 ($(php7.0 --version | head -n 1))"
DocumentInstalledItem "PHP 7.1 ($(php7.1 --version | head -n 1))"
DocumentInstalledItem "PHP 7.2 ($(php7.2 --version | head -n 1))"
DocumentInstalledItem "PHP 7.3 ($(php7.3 --version | head -n 1))"
DocumentInstalledItem "Composer ($(composer --version))"
DocumentInstalledItem "PHPUnit ($(phpunit --version))"

View File

@@ -1,28 +1,28 @@
#!/bin/bash
################################################################################
## File: powershellcore.sh
## Desc: Installs powershellcore
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
LSB_RELEASE=$(lsb_release -rs)
# Install Powershell
apt-get install -y powershell
# 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 pwsh; then
echo "pwsh was not installed"
exit 1
fi
if ! pwsh -c 'Write-Host Hello world'; then
echo "pwsh failed to run"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Powershell ($(pwsh --version))"
#!/bin/bash
################################################################################
## File: powershellcore.sh
## Desc: Installs powershellcore
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
LSB_RELEASE=$(lsb_release -rs)
# Install Powershell
apt-get install -y powershell
# 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 pwsh; then
echo "pwsh was not installed"
exit 1
fi
if ! pwsh -c 'Write-Host Hello world'; then
echo "pwsh failed to run"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Powershell ($(pwsh --version))"

View File

@@ -1,12 +1,12 @@
#!/bin/bash
################################################################################
## File: preparemetadata.sh
## Desc: This script adds a image title information to the metadata
## document
################################################################################
source $HELPER_SCRIPTS/document.sh
AddTitle "Hosted Ubuntu 1604 Image ($(lsb_release -ds))"
WriteItem "The following software is installed on machines in the Hosted Ubuntu 1604 ($IMAGE_VERSION) pool"
WriteItem "***"
#!/bin/bash
################################################################################
## File: preparemetadata.sh
## Desc: This script adds a image title information to the metadata
## document
################################################################################
source $HELPER_SCRIPTS/document.sh
AddTitle "Hosted Ubuntu 1604 Image ($(lsb_release -ds))"
WriteItem "The following software is installed on machines in the Hosted Ubuntu 1604 ($IMAGE_VERSION) pool"
WriteItem "***"

View File

@@ -1,133 +1,133 @@
#!/bin/bash
################################################################################
## File: android.sh
## Desc: Installs Android SDK
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
# Set env variable for SDK Root (https://developer.android.com/studio/command-line/variables)
ANDROID_ROOT=/usr/local/lib/android
ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk
echo "ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT}" | tee -a /etc/environment
# ANDROID_HOME is deprecated, but older versions of Gradle rely on it
echo "ANDROID_HOME=${ANDROID_SDK_ROOT}" | tee -a /etc/environment
# Download the latest command line tools so that we can accept all of the licenses.
# See https://developer.android.com/studio/#command-tools
wget -O android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip android-sdk.zip -d ${ANDROID_ROOT}
rm -f android-sdk.zip
# Install the following SDKs and build tools, passing in "y" to accept licenses.
echo "y" | ${ANDROID_ROOT}/tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} \
"ndk-bundle" \
"platform-tools" \
"platforms;android-29" \
"platforms;android-28" \
"platforms;android-27" \
"platforms;android-26" \
"platforms;android-25" \
"platforms;android-24" \
"platforms;android-23" \
"platforms;android-22" \
"platforms;android-21" \
"platforms;android-19" \
"platforms;android-17" \
"build-tools;29.0.2" \
"build-tools;29.0.0" \
"build-tools;28.0.3" \
"build-tools;28.0.2" \
"build-tools;28.0.1" \
"build-tools;28.0.0" \
"build-tools;27.0.3" \
"build-tools;27.0.2" \
"build-tools;27.0.1" \
"build-tools;27.0.0" \
"build-tools;26.0.3" \
"build-tools;26.0.2" \
"build-tools;26.0.1" \
"build-tools;26.0.0" \
"build-tools;25.0.3" \
"build-tools;25.0.2" \
"build-tools;25.0.1" \
"build-tools;25.0.0" \
"build-tools;24.0.3" \
"build-tools;24.0.2" \
"build-tools;24.0.1" \
"build-tools;24.0.0" \
"build-tools;23.0.3" \
"build-tools;23.0.2" \
"build-tools;23.0.1" \
"build-tools;22.0.1" \
"build-tools;21.1.2" \
"build-tools;20.0.0" \
"build-tools;19.1.0" \
"build-tools;17.0.0" \
"extras;android;m2repository" \
"extras;google;m2repository" \
"extras;google;google_play_services" \
"add-ons;addon-google_apis-google-24" \
"add-ons;addon-google_apis-google-23" \
"add-ons;addon-google_apis-google-22" \
"add-ons;addon-google_apis-google-21" \
"cmake;3.6.4111459" \
"patcher;v4"
# Document what was added to the image
echo "Lastly, document what was added to the metadata file"
DocumentInstalledItem "Google Repository $(cat ${ANDROID_SDK_ROOT}/extras/google/m2repository/source.properties 2>&1 | grep Pkg.Revision | cut -d '=' -f 2)"
DocumentInstalledItem "Google Play services $(cat ${ANDROID_SDK_ROOT}/extras/google/google_play_services/source.properties 2>&1 | grep Pkg.Revision | cut -d '=' -f 2)"
DocumentInstalledItem "Google APIs 24"
DocumentInstalledItem "Google APIs 23"
DocumentInstalledItem "Google APIs 22"
DocumentInstalledItem "Google APIs 21"
DocumentInstalledItem "CMake $(ls ${ANDROID_SDK_ROOT}/cmake 2>&1)"
DocumentInstalledItem "Android Support Repository 47.0.0"
DocumentInstalledItem "Android SDK Platform-Tools $(cat ${ANDROID_SDK_ROOT}/platform-tools/source.properties 2>&1 | grep Pkg.Revision | cut -d '=' -f 2)"
DocumentInstalledItem "Android SDK Platform 29"
DocumentInstalledItem "Android SDK Platform 28"
DocumentInstalledItem "Android SDK Platform 27"
DocumentInstalledItem "Android SDK Platform 26"
DocumentInstalledItem "Android SDK Platform 25"
DocumentInstalledItem "Android SDK Platform 24"
DocumentInstalledItem "Android SDK Platform 23"
DocumentInstalledItem "Android SDK Platform 22"
DocumentInstalledItem "Android SDK Platform 21"
DocumentInstalledItem "Android SDK Platform 19"
DocumentInstalledItem "Android SDK Platform 17"
DocumentInstalledItem "Android SDK Patch Applier v4"
DocumentInstalledItem "Android SDK Build-Tools 29.0.2"
DocumentInstalledItem "Android SDK Build-Tools 29.0.0"
DocumentInstalledItem "Android SDK Build-Tools 28.0.3"
DocumentInstalledItem "Android SDK Build-Tools 28.0.2"
DocumentInstalledItem "Android SDK Build-Tools 28.0.1"
DocumentInstalledItem "Android SDK Build-Tools 28.0.0"
DocumentInstalledItem "Android SDK Build-Tools 27.0.3"
DocumentInstalledItem "Android SDK Build-Tools 27.0.2"
DocumentInstalledItem "Android SDK Build-Tools 27.0.1"
DocumentInstalledItem "Android SDK Build-Tools 27.0.0"
DocumentInstalledItem "Android SDK Build-Tools 26.0.3"
DocumentInstalledItem "Android SDK Build-Tools 26.0.2"
DocumentInstalledItem "Android SDK Build-Tools 26.0.1"
DocumentInstalledItem "Android SDK Build-Tools 26.0.0"
DocumentInstalledItem "Android SDK Build-Tools 25.0.3"
DocumentInstalledItem "Android SDK Build-Tools 25.0.2"
DocumentInstalledItem "Android SDK Build-Tools 25.0.1"
DocumentInstalledItem "Android SDK Build-Tools 25.0.0"
DocumentInstalledItem "Android SDK Build-Tools 24.0.3"
DocumentInstalledItem "Android SDK Build-Tools 24.0.2"
DocumentInstalledItem "Android SDK Build-Tools 24.0.1"
DocumentInstalledItem "Android SDK Build-Tools 24.0.0"
DocumentInstalledItem "Android SDK Build-Tools 23.0.3"
DocumentInstalledItem "Android SDK Build-Tools 23.0.2"
DocumentInstalledItem "Android SDK Build-Tools 23.0.1"
DocumentInstalledItem "Android SDK Build-Tools 22.0.1"
DocumentInstalledItem "Android SDK Build-Tools 21.1.2"
DocumentInstalledItem "Android SDK Build-Tools 20.0.0"
DocumentInstalledItem "Android SDK Build-Tools 19.1.0"
DocumentInstalledItem "Android SDK Build-Tools 17.0.0"
DocumentInstalledItem "Android NDK $(cat ${ANDROID_SDK_ROOT}/ndk-bundle/source.properties 2>&1 | grep Pkg.Revision | cut -d ' ' -f 3)"
#!/bin/bash
################################################################################
## File: android.sh
## Desc: Installs Android SDK
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
# Set env variable for SDK Root (https://developer.android.com/studio/command-line/variables)
ANDROID_ROOT=/usr/local/lib/android
ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk
echo "ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT}" | tee -a /etc/environment
# ANDROID_HOME is deprecated, but older versions of Gradle rely on it
echo "ANDROID_HOME=${ANDROID_SDK_ROOT}" | tee -a /etc/environment
# Download the latest command line tools so that we can accept all of the licenses.
# See https://developer.android.com/studio/#command-tools
wget -O android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip android-sdk.zip -d ${ANDROID_ROOT}
rm -f android-sdk.zip
# Install the following SDKs and build tools, passing in "y" to accept licenses.
echo "y" | ${ANDROID_ROOT}/tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} \
"ndk-bundle" \
"platform-tools" \
"platforms;android-29" \
"platforms;android-28" \
"platforms;android-27" \
"platforms;android-26" \
"platforms;android-25" \
"platforms;android-24" \
"platforms;android-23" \
"platforms;android-22" \
"platforms;android-21" \
"platforms;android-19" \
"platforms;android-17" \
"build-tools;29.0.2" \
"build-tools;29.0.0" \
"build-tools;28.0.3" \
"build-tools;28.0.2" \
"build-tools;28.0.1" \
"build-tools;28.0.0" \
"build-tools;27.0.3" \
"build-tools;27.0.2" \
"build-tools;27.0.1" \
"build-tools;27.0.0" \
"build-tools;26.0.3" \
"build-tools;26.0.2" \
"build-tools;26.0.1" \
"build-tools;26.0.0" \
"build-tools;25.0.3" \
"build-tools;25.0.2" \
"build-tools;25.0.1" \
"build-tools;25.0.0" \
"build-tools;24.0.3" \
"build-tools;24.0.2" \
"build-tools;24.0.1" \
"build-tools;24.0.0" \
"build-tools;23.0.3" \
"build-tools;23.0.2" \
"build-tools;23.0.1" \
"build-tools;22.0.1" \
"build-tools;21.1.2" \
"build-tools;20.0.0" \
"build-tools;19.1.0" \
"build-tools;17.0.0" \
"extras;android;m2repository" \
"extras;google;m2repository" \
"extras;google;google_play_services" \
"add-ons;addon-google_apis-google-24" \
"add-ons;addon-google_apis-google-23" \
"add-ons;addon-google_apis-google-22" \
"add-ons;addon-google_apis-google-21" \
"cmake;3.6.4111459" \
"patcher;v4"
# Document what was added to the image
echo "Lastly, document what was added to the metadata file"
DocumentInstalledItem "Google Repository $(cat ${ANDROID_SDK_ROOT}/extras/google/m2repository/source.properties 2>&1 | grep Pkg.Revision | cut -d '=' -f 2)"
DocumentInstalledItem "Google Play services $(cat ${ANDROID_SDK_ROOT}/extras/google/google_play_services/source.properties 2>&1 | grep Pkg.Revision | cut -d '=' -f 2)"
DocumentInstalledItem "Google APIs 24"
DocumentInstalledItem "Google APIs 23"
DocumentInstalledItem "Google APIs 22"
DocumentInstalledItem "Google APIs 21"
DocumentInstalledItem "CMake $(ls ${ANDROID_SDK_ROOT}/cmake 2>&1)"
DocumentInstalledItem "Android Support Repository 47.0.0"
DocumentInstalledItem "Android SDK Platform-Tools $(cat ${ANDROID_SDK_ROOT}/platform-tools/source.properties 2>&1 | grep Pkg.Revision | cut -d '=' -f 2)"
DocumentInstalledItem "Android SDK Platform 29"
DocumentInstalledItem "Android SDK Platform 28"
DocumentInstalledItem "Android SDK Platform 27"
DocumentInstalledItem "Android SDK Platform 26"
DocumentInstalledItem "Android SDK Platform 25"
DocumentInstalledItem "Android SDK Platform 24"
DocumentInstalledItem "Android SDK Platform 23"
DocumentInstalledItem "Android SDK Platform 22"
DocumentInstalledItem "Android SDK Platform 21"
DocumentInstalledItem "Android SDK Platform 19"
DocumentInstalledItem "Android SDK Platform 17"
DocumentInstalledItem "Android SDK Patch Applier v4"
DocumentInstalledItem "Android SDK Build-Tools 29.0.2"
DocumentInstalledItem "Android SDK Build-Tools 29.0.0"
DocumentInstalledItem "Android SDK Build-Tools 28.0.3"
DocumentInstalledItem "Android SDK Build-Tools 28.0.2"
DocumentInstalledItem "Android SDK Build-Tools 28.0.1"
DocumentInstalledItem "Android SDK Build-Tools 28.0.0"
DocumentInstalledItem "Android SDK Build-Tools 27.0.3"
DocumentInstalledItem "Android SDK Build-Tools 27.0.2"
DocumentInstalledItem "Android SDK Build-Tools 27.0.1"
DocumentInstalledItem "Android SDK Build-Tools 27.0.0"
DocumentInstalledItem "Android SDK Build-Tools 26.0.3"
DocumentInstalledItem "Android SDK Build-Tools 26.0.2"
DocumentInstalledItem "Android SDK Build-Tools 26.0.1"
DocumentInstalledItem "Android SDK Build-Tools 26.0.0"
DocumentInstalledItem "Android SDK Build-Tools 25.0.3"
DocumentInstalledItem "Android SDK Build-Tools 25.0.2"
DocumentInstalledItem "Android SDK Build-Tools 25.0.1"
DocumentInstalledItem "Android SDK Build-Tools 25.0.0"
DocumentInstalledItem "Android SDK Build-Tools 24.0.3"
DocumentInstalledItem "Android SDK Build-Tools 24.0.2"
DocumentInstalledItem "Android SDK Build-Tools 24.0.1"
DocumentInstalledItem "Android SDK Build-Tools 24.0.0"
DocumentInstalledItem "Android SDK Build-Tools 23.0.3"
DocumentInstalledItem "Android SDK Build-Tools 23.0.2"
DocumentInstalledItem "Android SDK Build-Tools 23.0.1"
DocumentInstalledItem "Android SDK Build-Tools 22.0.1"
DocumentInstalledItem "Android SDK Build-Tools 21.1.2"
DocumentInstalledItem "Android SDK Build-Tools 20.0.0"
DocumentInstalledItem "Android SDK Build-Tools 19.1.0"
DocumentInstalledItem "Android SDK Build-Tools 17.0.0"
DocumentInstalledItem "Android NDK $(cat ${ANDROID_SDK_ROOT}/ndk-bundle/source.properties 2>&1 | grep Pkg.Revision | cut -d ' ' -f 3)"

View File

@@ -57,4 +57,4 @@ DocumentInstalledItem "Az Module (1.6.0)"
DocumentInstalledItem "Az Module (2.3.2)"
DocumentInstalledItem "Az Module (2.6.0)"
DocumentInstalledItem "Az Module (2.8.0)"
DocumentInstalledItem "Az Module (3.1.0)"
DocumentInstalledItem "Az Module (3.1.0)"

View File

@@ -1,154 +1,154 @@
#!/bin/bash
################################################################################
## File: basic.sh
## Desc: Installs basic command line utilities and dev packages
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
set -e
echo "Install curl"
apt-get install -y --no-install-recommends curl
echo "Install dnsutils"
apt-get install -y --no-install-recommends dnsutils
echo "Install file"
apt-get install -y --no-install-recommends file
echo "Install ftp"
apt-get install -y --no-install-recommends ftp
echo "Install iproute2"
apt-get install -y --no-install-recommends iproute2
echo "Install iputils-ping"
apt-get install -y --no-install-recommends iputils-ping
echo "Install jq"
apt-get install -y --no-install-recommends jq
echo "Install libcurl3"
apt-get install -y --no-install-recommends libcurl3
echo "Install libunwind8"
apt-get install -y --no-install-recommends libunwind8
echo "Install locales"
apt-get install -y --no-install-recommends locales
echo "Install netcat"
apt-get install -y --no-install-recommends netcat
echo "Install openssh-client"
apt-get install -y --no-install-recommends openssh-client
echo "Install rsync"
apt-get install -y --no-install-recommends rsync
echo "Install shellcheck"
apt-get install -y --no-install-recommends shellcheck
echo "Install sudo"
apt-get install -y --no-install-recommends sudo
echo "Install telnet"
apt-get install -y --no-install-recommends telnet
echo "Install time"
apt-get install -y --no-install-recommends time
echo "Install unzip"
apt-get install -y --no-install-recommends unzip
echo "Install wget"
apt-get install -y --no-install-recommends wget
echo "Install zip"
apt-get install -y --no-install-recommends zip
echo "Install tzdata"
apt-get install -y --no-install-recommends tzdata
echo "Install libxkbfile"
apt-get install -y --no-install-recommends libxkbfile-dev
echo "Install pkg-config"
apt-get install -y --no-install-recommends pkg-config
echo "Install libsecret-1-dev"
apt-get install -y --no-install-recommends libsecret-1-dev
echo "Install libxss1"
apt-get install -y --no-install-recommends libxss1
echo "Install libgconf-2-4"
apt-get install -y --no-install-recommends libgconf-2-4
echo "Install dbus"
apt-get install -y --no-install-recommends dbus
echo "Install xvfb"
apt-get install -y --no-install-recommends xvfb
echo "Install libgtk"
apt-get install -y --no-install-recommends libgtk-3-0
echo "Install fakeroot"
apt-get install -y --no-install-recommends fakeroot
echo "Install dpkg"
apt-get install -y --no-install-recommends dpkg
echo "Install rpm"
apt-get install -y --no-install-recommends rpm
echo "Install xz-utils"
apt-get install -y --no-install-recommends xz-utils
echo "Install xorriso"
apt-get install -y --no-install-recommends xorriso
echo "Install zsync"
apt-get install -y --no-install-recommends zsync
echo "Install curl"
apt-get install -y --no-install-recommends curl
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
for cmd in curl file ftp jq netcat ssh rsync shellcheck sudo telnet time unzip wget zip; do
if ! command -v $cmd; then
echo "$cmd was not installed"
exit 1
fi
done
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Basic CLI:"
DocumentInstalledItemIndent "curl"
DocumentInstalledItemIndent "dnsutils"
DocumentInstalledItemIndent "file"
DocumentInstalledItemIndent "ftp"
DocumentInstalledItemIndent "iproute2"
DocumentInstalledItemIndent "iputils-ping"
DocumentInstalledItemIndent "jq"
DocumentInstalledItemIndent "libcurl3"
DocumentInstalledItemIndent "libicu55"
DocumentInstalledItemIndent "libunwind8"
DocumentInstalledItemIndent "locales"
DocumentInstalledItemIndent "netcat"
DocumentInstalledItemIndent "openssh-client"
DocumentInstalledItemIndent "rsync"
DocumentInstalledItemIndent "shellcheck"
DocumentInstalledItemIndent "sudo"
DocumentInstalledItemIndent "telnet"
DocumentInstalledItemIndent "time"
DocumentInstalledItemIndent "unzip"
DocumentInstalledItemIndent "wget"
DocumentInstalledItemIndent "zip"
DocumentInstalledItemIndent "tzdata"
#!/bin/bash
################################################################################
## File: basic.sh
## Desc: Installs basic command line utilities and dev packages
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
set -e
echo "Install curl"
apt-get install -y --no-install-recommends curl
echo "Install dnsutils"
apt-get install -y --no-install-recommends dnsutils
echo "Install file"
apt-get install -y --no-install-recommends file
echo "Install ftp"
apt-get install -y --no-install-recommends ftp
echo "Install iproute2"
apt-get install -y --no-install-recommends iproute2
echo "Install iputils-ping"
apt-get install -y --no-install-recommends iputils-ping
echo "Install jq"
apt-get install -y --no-install-recommends jq
echo "Install libcurl3"
apt-get install -y --no-install-recommends libcurl3
echo "Install libunwind8"
apt-get install -y --no-install-recommends libunwind8
echo "Install locales"
apt-get install -y --no-install-recommends locales
echo "Install netcat"
apt-get install -y --no-install-recommends netcat
echo "Install openssh-client"
apt-get install -y --no-install-recommends openssh-client
echo "Install rsync"
apt-get install -y --no-install-recommends rsync
echo "Install shellcheck"
apt-get install -y --no-install-recommends shellcheck
echo "Install sudo"
apt-get install -y --no-install-recommends sudo
echo "Install telnet"
apt-get install -y --no-install-recommends telnet
echo "Install time"
apt-get install -y --no-install-recommends time
echo "Install unzip"
apt-get install -y --no-install-recommends unzip
echo "Install wget"
apt-get install -y --no-install-recommends wget
echo "Install zip"
apt-get install -y --no-install-recommends zip
echo "Install tzdata"
apt-get install -y --no-install-recommends tzdata
echo "Install libxkbfile"
apt-get install -y --no-install-recommends libxkbfile-dev
echo "Install pkg-config"
apt-get install -y --no-install-recommends pkg-config
echo "Install libsecret-1-dev"
apt-get install -y --no-install-recommends libsecret-1-dev
echo "Install libxss1"
apt-get install -y --no-install-recommends libxss1
echo "Install libgconf-2-4"
apt-get install -y --no-install-recommends libgconf-2-4
echo "Install dbus"
apt-get install -y --no-install-recommends dbus
echo "Install xvfb"
apt-get install -y --no-install-recommends xvfb
echo "Install libgtk"
apt-get install -y --no-install-recommends libgtk-3-0
echo "Install fakeroot"
apt-get install -y --no-install-recommends fakeroot
echo "Install dpkg"
apt-get install -y --no-install-recommends dpkg
echo "Install rpm"
apt-get install -y --no-install-recommends rpm
echo "Install xz-utils"
apt-get install -y --no-install-recommends xz-utils
echo "Install xorriso"
apt-get install -y --no-install-recommends xorriso
echo "Install zsync"
apt-get install -y --no-install-recommends zsync
echo "Install curl"
apt-get install -y --no-install-recommends curl
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
for cmd in curl file ftp jq netcat ssh rsync shellcheck sudo telnet time unzip wget zip; do
if ! command -v $cmd; then
echo "$cmd was not installed"
exit 1
fi
done
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Basic CLI:"
DocumentInstalledItemIndent "curl"
DocumentInstalledItemIndent "dnsutils"
DocumentInstalledItemIndent "file"
DocumentInstalledItemIndent "ftp"
DocumentInstalledItemIndent "iproute2"
DocumentInstalledItemIndent "iputils-ping"
DocumentInstalledItemIndent "jq"
DocumentInstalledItemIndent "libcurl3"
DocumentInstalledItemIndent "libicu55"
DocumentInstalledItemIndent "libunwind8"
DocumentInstalledItemIndent "locales"
DocumentInstalledItemIndent "netcat"
DocumentInstalledItemIndent "openssh-client"
DocumentInstalledItemIndent "rsync"
DocumentInstalledItemIndent "shellcheck"
DocumentInstalledItemIndent "sudo"
DocumentInstalledItemIndent "telnet"
DocumentInstalledItemIndent "time"
DocumentInstalledItemIndent "unzip"
DocumentInstalledItemIndent "wget"
DocumentInstalledItemIndent "zip"
DocumentInstalledItemIndent "tzdata"

View File

@@ -1,7 +1,6 @@
#!/bin/bash
################################################################################
## File: dotnetcore-sdk.sh
## Team: CI-Platform
## Desc: Installs .NET Core SDK
################################################################################

View File

@@ -1,34 +1,34 @@
#!/bin/bash
################################################################################
## File: go.sh
## Desc: Installs go, configures GOROOT, and adds go to the path
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# This function installs Go using the specified arguments:
# $1=MajorVersion (1.11)
# $2=MajorAndMinorVersion (1.11.1)
# $3=IsDefaultVersion (true or false)
function InstallGo () {
curl -sL https://dl.google.com/go/go$2.linux-amd64.tar.gz -o go$2.linux-amd64.tar.gz
mkdir -p /usr/local/go$1
tar -C /usr/local/go$1 -xzf go$2.linux-amd64.tar.gz --strip-components=1 go
rm go$2.linux-amd64.tar.gz
echo "GOROOT_${1//./_}_X64=/usr/local/go$1" | tee -a /etc/environment
DocumentInstalledItem "Go $1 ($(/usr/local/go$1/bin/go version))"
# If this version of Go is to be the default version,
# symlink it into the path and point GOROOT to it.
if [ $3 = true ]
then
ln -s /usr/local/go$1/bin/* /usr/bin/
echo "GOROOT=/usr/local/go$1" | tee -a /etc/environment
fi
}
# Install Go versions
InstallGo 1.11 1.11.12 false
InstallGo 1.12 1.12.7 true
InstallGo 1.13 1.13 false
#!/bin/bash
################################################################################
## File: go.sh
## Desc: Installs go, configures GOROOT, and adds go to the path
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# This function installs Go using the specified arguments:
# $1=MajorVersion (1.11)
# $2=MajorAndMinorVersion (1.11.1)
# $3=IsDefaultVersion (true or false)
function InstallGo () {
curl -sL https://dl.google.com/go/go$2.linux-amd64.tar.gz -o go$2.linux-amd64.tar.gz
mkdir -p /usr/local/go$1
tar -C /usr/local/go$1 -xzf go$2.linux-amd64.tar.gz --strip-components=1 go
rm go$2.linux-amd64.tar.gz
echo "GOROOT_${1//./_}_X64=/usr/local/go$1" | tee -a /etc/environment
DocumentInstalledItem "Go $1 ($(/usr/local/go$1/bin/go version))"
# If this version of Go is to be the default version,
# symlink it into the path and point GOROOT to it.
if [ $3 = true ]
then
ln -s /usr/local/go$1/bin/* /usr/bin/
echo "GOROOT=/usr/local/go$1" | tee -a /etc/environment
fi
}
# Install Go versions
InstallGo 1.11 1.11.12 false
InstallGo 1.12 1.12.7 true
InstallGo 1.13 1.13 false

View File

@@ -27,13 +27,13 @@ for setup in $setups; do
cd $original_directory;
done;
DocumentInstalledItem "Python (available through the [setup-python](https://github.com/actions/setup-python/blob/master/README.md) task)"
DocumentInstalledItem "Python (available through the [Use Python Version](https://go.microsoft.com/fwlink/?linkid=871498) task)"
pythons=$(ls $AGENT_TOOLSDIRECTORY/Python)
for python in $pythons; do
DocumentInstalledItemIndent "Python $python"
done;
DocumentInstalledItem "Ruby (available through the [setup-ruby](https://github.com/actions/setup-ruby/blob/master/README.md) task)"
DocumentInstalledItem "Ruby (available through the [Use Ruby Version](https://go.microsoft.com/fwlink/?linkid=2005989) task)"
rubys=$(ls $AGENT_TOOLSDIRECTORY/Ruby)
for ruby in $rubys; do
DocumentInstalledItemIndent "Ruby $ruby"

View File

@@ -1,42 +1,42 @@
#!/bin/bash
################################################################################
## File: kubernetes-tools.sh
## Desc: Installs kubectl, helm
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
## Install kubectl
apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
touch /etc/apt/sources.list.d/kubernetes.list
# Based on https://kubernetes.io/docs/tasks/tools/install-kubectl/, package is still called xenial
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | tee -a /etc/apt/sources.list.d/kubernetes.list
apt-get update
apt-get install -y kubectl
# Install Helm
curl -L https://git.io/get_helm.sh | bash
# 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 kubectl; then
echo "kubectl was not installed"
exit 1
fi
if ! command -v helm; then
echo "helm was not installed"
exit 1
fi
echo "Initializing helm"
helm init --client-only
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "kubectl ($(kubectl version --short |& head -n 1))"
DocumentInstalledItem "helm ($(helm version --short |& head -n 1))"
#!/bin/bash
################################################################################
## File: kubernetes-tools.sh
## Desc: Installs kubectl, helm
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
## Install kubectl
apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
touch /etc/apt/sources.list.d/kubernetes.list
# Based on https://kubernetes.io/docs/tasks/tools/install-kubectl/, package is still called xenial
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | tee -a /etc/apt/sources.list.d/kubernetes.list
apt-get update
apt-get install -y kubectl
# Install Helm
curl -L https://git.io/get_helm.sh | bash
# 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 kubectl; then
echo "kubectl was not installed"
exit 1
fi
if ! command -v helm; then
echo "helm was not installed"
exit 1
fi
echo "Initializing helm"
helm init --client-only
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "kubectl ($(kubectl version --short |& head -n 1))"
DocumentInstalledItem "helm ($(helm version --short |& head -n 1))"

View File

@@ -1,21 +1,21 @@
#!/bin/bash
################################################################################
## File: mercurial.sh
## Desc: Installs Mercurial
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
apt-get install -y --no-install-recommends mercurial
# 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 hg; then
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Mercurial ($(hg --version | head -n 1))"
#!/bin/bash
################################################################################
## File: mercurial.sh
## Desc: Installs Mercurial
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
apt-get install -y --no-install-recommends mercurial
# 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 hg; then
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Mercurial ($(hg --version | head -n 1))"

View File

@@ -1,217 +1,181 @@
#!/bin/bash
################################################################################
## File: php.sh
## Desc: Installs php
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
LSB_RELEASE=$(lsb_release -rs)
set -e
apt-add-repository ppa:ondrej/php -y
# Install php7.1
apt-fast install -y --no-install-recommends \
php7.1 \
php7.1-bcmath \
php7.1-bz2 \
php7.1-cgi \
php7.1-cli \
php7.1-common \
php7.1-curl \
php7.1-dba \
php7.1-dev \
php7.1-enchant \
php7.1-fpm \
php7.1-gd \
php7.1-gmp \
php7.1-imap \
php7.1-interbase \
php7.1-intl \
php7.1-json \
php7.1-ldap \
php7.1-mbstring \
php7.1-mcrypt \
php7.1-mysql \
php7.1-odbc \
php7.1-opcache \
php7.1-pgsql \
php7.1-phpdbg \
php7.1-pspell \
php7.1-readline \
php7.1-recode \
php7.1-snmp \
php7.1-soap \
php7.1-sqlite3 \
php7.1-sybase \
php7.1-tidy \
php7.1-xml \
php7.1-xmlrpc \
php7.1-xsl \
php7.1-zip
apt-get remove --purge -yq php7.1-dev
# Install php7.2
apt-fast install -y --no-install-recommends \
php7.2 \
php7.2-bcmath \
php7.2-bz2 \
php7.2-cgi \
php7.2-cli \
php7.2-common \
php7.2-curl \
php7.2-dba \
php7.2-dev \
php7.2-enchant \
php7.2-fpm \
php7.2-gd \
php7.2-gmp \
php7.2-imap \
php7.2-interbase \
php7.2-intl \
php7.2-json \
php7.2-ldap \
php7.2-mbstring \
php7.2-mysql \
php7.2-odbc \
php7.2-opcache \
php7.2-pgsql \
php7.2-phpdbg \
php7.2-pspell \
php7.2-readline \
php7.2-recode \
php7.2-snmp \
php7.2-soap \
php7.2-sqlite3 \
php7.2-sybase \
php7.2-tidy \
php7.2-xml \
php7.2-xmlrpc \
php7.2-xsl \
php7.2-zip
# Install php7.3
apt-fast install -y --no-install-recommends \
php7.3 \
php7.3-bcmath \
php7.3-bz2 \
php7.3-cgi \
php7.3-cli \
php7.3-common \
php7.3-curl \
php7.3-dba \
php7.3-dev \
php7.3-enchant \
php7.3-fpm \
php7.3-gd \
php7.3-gmp \
php7.3-imap \
php7.3-interbase \
php7.3-intl \
php7.3-json \
php7.3-ldap \
php7.3-mbstring \
php7.3-mysql \
php7.3-odbc \
php7.3-opcache \
php7.3-pgsql \
php7.3-phpdbg \
php7.3-pspell \
php7.3-readline \
php7.3-recode \
php7.3-snmp \
php7.3-soap \
php7.3-sqlite3 \
php7.3-sybase \
php7.3-tidy \
php7.3-xml \
php7.3-xmlrpc \
php7.3-xsl \
php7.3-zip
# Install php7.4
apt-fast install -y --no-install-recommends \
php7.4 \
php7.4-bcmath \
php7.4-bz2 \
php7.4-cgi \
php7.4-cli \
php7.4-common \
php7.4-curl \
php7.4-dba \
php7.4-dev \
php7.4-enchant \
php7.4-fpm \
php7.4-gd \
php7.4-gmp \
php7.4-imap \
php7.4-interbase \
php7.4-intl \
php7.4-json \
php7.4-ldap \
php7.4-mbstring \
php7.4-mysql \
php7.4-odbc \
php7.4-opcache \
php7.4-pgsql \
php7.4-phpdbg \
php7.4-pspell \
php7.4-readline \
php7.4-snmp \
php7.4-soap \
php7.4-sqlite3 \
php7.4-sybase \
php7.4-tidy \
php7.4-xml \
php7.4-xmlrpc \
php7.4-xsl \
php7.4-zip
apt-fast install -y --no-install-recommends \
php-amqp \
php-apcu \
php-igbinary \
php-memcache \
php-memcached \
php-mongodb \
php-redis \
php-xdebug \
php-yaml \
php-zmq
apt-get remove --purge -yq php7.2-dev
apt-fast install -y --no-install-recommends snmp
# Install composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
sudo mv composer.phar /usr/bin/composer
php -r "unlink('composer-setup.php');"
# Install phpunit (for PHP)
wget -q -O phpunit https://phar.phpunit.de/phpunit-7.phar
chmod +x phpunit
mv phpunit /usr/local/bin/phpunit
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
for cmd in php php7.1 php7.2 php7.3 php7.4 composer phpunit; do
if ! command -v $cmd; then
echo "$cmd was not installed"
exit 1
fi
done
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "PHP 7.1 ($(php7.1 --version | head -n 1))"
DocumentInstalledItem "PHP 7.2 ($(php7.2 --version | head -n 1))"
DocumentInstalledItem "PHP 7.3 ($(php7.3 --version | head -n 1))"
DocumentInstalledItem "PHP 7.4 ($(php7.4 --version | head -n 1))"
DocumentInstalledItem "Composer ($(composer --version))"
DocumentInstalledItem "PHPUnit ($(phpunit --version))"
#!/bin/bash
################################################################################
## File: php.sh
## Desc: Installs php
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
LSB_RELEASE=$(lsb_release -rs)
set -e
apt-add-repository ppa:ondrej/php -y
# Install php7.1
apt-fast install -y --no-install-recommends \
php7.1 \
php7.1-amqp \
php7.1-bcmath \
php7.1-bz2 \
php7.1-cgi \
php7.1-cli \
php7.1-common \
php7.1-curl \
php7.1-dba \
php7.1-dev \
php7.1-enchant \
php7.1-fpm \
php7.1-gd \
php7.1-gmp \
php7.1-imap \
php7.1-interbase \
php7.1-intl \
php7.1-json \
php7.1-ldap \
php7.1-mbstring \
php7.1-mcrypt \
php7.1-mysql \
php7.1-odbc \
php7.1-opcache \
php7.1-pgsql \
php7.1-phpdbg \
php7.1-pspell \
php7.1-readline \
php7.1-recode \
php7.1-snmp \
php7.1-soap \
php7.1-sqlite3 \
php7.1-sybase \
php7.1-tidy \
php7.1-xml \
php7.1-xmlrpc \
php7.1-xsl \
php7.1-zip
apt-get remove --purge -yq php7.1-dev
# Install php7.2
apt-fast install -y --no-install-recommends \
php7.2 \
php7.2-apcu \
php7.2-amqp \
php7.2-bcmath \
php7.2-bz2 \
php7.2-cgi \
php7.2-cli \
php7.2-common \
php7.2-curl \
php7.2-dba \
php7.2-dev \
php7.2-enchant \
php7.2-fpm \
php7.2-gd \
php7.2-gmp \
php7.2-imap \
php7.2-interbase \
php7.2-intl \
php7.2-json \
php7.2-ldap \
php7.2-mbstring \
php7.2-mysql \
php7.2-odbc \
php7.2-opcache \
php7.2-pgsql \
php7.2-phpdbg \
php7.2-pspell \
php7.2-readline \
php7.2-recode \
php7.2-snmp \
php7.2-soap \
php7.2-sqlite3 \
php7.2-sybase \
php7.2-tidy \
php7.2-xml \
php7.2-xmlrpc \
php7.2-xsl \
php7.2-zip
# Install php7.3
apt-fast install -y --no-install-recommends \
php7.3 \
php7.3-apcu \
php7.3-amqp \
php7.3-bcmath \
php7.3-bz2 \
php7.3-cgi \
php7.3-cli \
php7.3-common \
php7.3-curl \
php7.3-dba \
php7.3-dev \
php7.3-enchant \
php7.3-fpm \
php7.3-gd \
php7.3-gmp \
php7.3-imap \
php7.3-interbase \
php7.3-intl \
php7.3-json \
php7.3-ldap \
php7.3-mbstring \
php7.3-mysql \
php7.3-odbc \
php7.3-opcache \
php7.3-pgsql \
php7.3-phpdbg \
php7.3-pspell \
php7.3-readline \
php7.3-recode \
php7.3-snmp \
php7.3-soap \
php7.3-sqlite3 \
php7.3-sybase \
php7.3-tidy \
php7.3-xml \
php7.3-xmlrpc \
php7.3-xsl \
php7.3-zip
apt-fast install -y --no-install-recommends \
php-igbinary \
php-memcache \
php-memcached \
php-mongodb \
php-redis \
php-xdebug \
php-yaml \
php-zmq
apt-get remove --purge -yq php7.2-dev
apt-fast install -y --no-install-recommends snmp
# Install composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
sudo mv composer.phar /usr/bin/composer
php -r "unlink('composer-setup.php');"
# Install phpunit (for PHP)
wget -q -O phpunit https://phar.phpunit.de/phpunit-7.phar
chmod +x phpunit
mv phpunit /usr/local/bin/phpunit
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
for cmd in php php7.1 php7.2 php7.3 composer phpunit; do
if ! command -v $cmd; then
echo "$cmd was not installed"
exit 1
fi
done
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "PHP 7.1 ($(php7.1 --version | head -n 1))"
DocumentInstalledItem "PHP 7.2 ($(php7.2 --version | head -n 1))"
DocumentInstalledItem "PHP 7.3 ($(php7.3 --version | head -n 1))"
DocumentInstalledItem "Composer ($(composer --version))"
DocumentInstalledItem "PHPUnit ($(phpunit --version))"

View File

@@ -1,31 +1,31 @@
#!/bin/bash
################################################################################
## File: powershellcore.sh
## Desc: Installs powershellcore
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
LSB_RELEASE=$(lsb_release -rs)
# Install Powershell
apt-get install -y powershell
# Temp fix based on: https://github.com/PowerShell/PowerShell/issues/9746
sudo apt remove libicu64
# 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 pwsh; then
echo "pwsh was not installed"
exit 1
fi
if ! pwsh -c 'Write-Host Hello world'; then
echo "pwsh failed to run"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Powershell ($(pwsh --version))"
#!/bin/bash
################################################################################
## File: powershellcore.sh
## Desc: Installs powershellcore
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
LSB_RELEASE=$(lsb_release -rs)
# Install Powershell
apt-get install -y powershell
# Temp fix based on: https://github.com/PowerShell/PowerShell/issues/9746
sudo apt remove libicu64
# 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 pwsh; then
echo "pwsh was not installed"
exit 1
fi
if ! pwsh -c 'Write-Host Hello world'; then
echo "pwsh failed to run"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Powershell ($(pwsh --version))"

View File

@@ -1,12 +1,12 @@
#!/bin/bash
################################################################################
## File: preparemetadata.sh
## Desc: This script adds a image title information to the metadata
## document
################################################################################
source $HELPER_SCRIPTS/document.sh
AddTitle "Hosted Ubuntu 1804 Image ($(lsb_release -ds))"
WriteItem "The following software is installed on machines in the Hosted Ubuntu 1804 (v$IMAGE_VERSION) pool"
WriteItem "***"
#!/bin/bash
################################################################################
## File: preparemetadata.sh
## Desc: This script adds a image title information to the metadata
## document
################################################################################
source $HELPER_SCRIPTS/document.sh
AddTitle "Hosted Ubuntu 1804 Image ($(lsb_release -ds))"
WriteItem "The following software is installed on machines in the Hosted Ubuntu 1804 (v$IMAGE_VERSION) pool"
WriteItem "***"

View File

@@ -1,23 +1,23 @@
#!/bin/bash
################################################################################
## File: 7-zip.sh
## Desc: Installs 7-zip
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Install 7-Zip
apt-get update -y
apt-get install -y p7zip p7zip-full p7zip-rar
# 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 7z; then
echo "7-Zip was not installed"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "7-Zip $(7z i | head --lines=2 | cut -d ' ' -f 3 | tr -d '\n')"
#!/bin/bash
################################################################################
## File: 7-zip.sh
## Desc: Installs 7-zip
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Install 7-Zip
apt-get update -y
apt-get install -y p7zip p7zip-full p7zip-rar
# 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 7z; then
echo "7-Zip was not installed"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "7-Zip $(7z i | head --lines=2 | cut -d ' ' -f 3 | tr -d '\n')"

View File

@@ -1,25 +1,25 @@
#!/bin/bash
################################################################################
## File: ansible.sh
## Desc: Installs Ansible
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
# Install Ansible PPA and latest Ansible
add-apt-repository ppa:ansible/ansible
apt-get update
apt-get install -y --no-install-recommends ansible
# 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 ansible; then
echo "Ansible 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 "Ansible ($(ansible --version |& head -n 1))"
#!/bin/bash
################################################################################
## File: ansible.sh
## Desc: Installs Ansible
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
# Install Ansible PPA and latest Ansible
add-apt-repository ppa:ansible/ansible
apt-get update
apt-get install -y --no-install-recommends ansible
# 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 ansible; then
echo "Ansible 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 "Ansible ($(ansible --version |& head -n 1))"

View File

@@ -1,26 +1,26 @@
#!/bin/bash
################################################################################
## File: aws.sh
## Desc: Installs the AWS CLI
################################################################################
# Source the helpers
source $HELPER_SCRIPTS/document.sh
# Install the AWS CLI
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
unzip awscli-bundle.zip
./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
rm awscli-bundle.zip
rm -rf awscli-bundle
# Validate the installation
echo "Validate the installation"
if ! command -v aws; then
echo "aws was not installed"
exit 1
fi
# Document the installed version
echo "Document the installed version"
DocumentInstalledItem "AWS CLI ($(aws --version 2>&1))"
#!/bin/bash
################################################################################
## File: aws.sh
## Desc: Installs the AWS CLI
################################################################################
# Source the helpers
source $HELPER_SCRIPTS/document.sh
# Install the AWS CLI
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
unzip awscli-bundle.zip
./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
rm awscli-bundle.zip
rm -rf awscli-bundle
# Validate the installation
echo "Validate the installation"
if ! command -v aws; then
echo "aws was not installed"
exit 1
fi
# Document the installed version
echo "Document the installed version"
DocumentInstalledItem "AWS CLI ($(aws --version 2>&1))"

View File

@@ -1,25 +1,25 @@
#!/bin/bash
################################################################################
## File: azcopy.sh
## Desc: Installs AzCopy
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Install AzCopy
wget -O azcopy.tar.gz https://aka.ms/downloadazcopylinux64
tar -xf azcopy.tar.gz
rm azcopy.tar.gz
./install.sh
# 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 azcopy; then
echo "azcopy was not installed"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "AzCopy ($(azcopy --version))"
#!/bin/bash
################################################################################
## File: azcopy.sh
## Desc: Installs AzCopy
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Install AzCopy
wget -O azcopy.tar.gz https://aka.ms/downloadazcopylinux64
tar -xf azcopy.tar.gz
rm azcopy.tar.gz
./install.sh
# 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 azcopy; then
echo "azcopy was not installed"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "AzCopy ($(azcopy --version))"

View File

@@ -1,26 +1,26 @@
#!/bin/bash
################################################################################
## File: azure-cli.sh
## Desc: Installed Azure CLI (az)
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
LSB_CODENAME=$(lsb_release -cs)
# Install Azure CLI (instructions taken from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $LSB_CODENAME main" | tee /etc/apt/sources.list.d/azure-cli.list
apt-key adv --keyserver packages.microsoft.com --recv-keys B02C46DF417A0893
apt-get update
apt-get install -y --no-install-recommends apt-transport-https azure-cli
# 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 az; then
echo "azure-cli was not installed"
exit 1
fi
# Document what was added to the image
DocumentInstalledItem "Azure CLI ($(az -v | head -n 1))"
#!/bin/bash
################################################################################
## File: azure-cli.sh
## Desc: Installed Azure CLI (az)
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
LSB_CODENAME=$(lsb_release -cs)
# Install Azure CLI (instructions taken from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $LSB_CODENAME main" | tee /etc/apt/sources.list.d/azure-cli.list
apt-key adv --keyserver packages.microsoft.com --recv-keys B02C46DF417A0893
apt-get update
apt-get install -y --no-install-recommends apt-transport-https azure-cli
# 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 az; then
echo "azure-cli was not installed"
exit 1
fi
# Document what was added to the image
DocumentInstalledItem "Azure CLI ($(az -v | head -n 1))"

View File

@@ -1,23 +1,23 @@
#!/bin/bash
################################################################################
## File: azure-devops-cli.sh
## Desc: Installed Azure DevOps CLI (az devops)
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# install azure devops Cli extension
az extension add -n azure-devops
# check to determine if extension was installed or not
if [ $? -eq 0 ]
then
echo "azure DevOps Cli extension was installed"
else
echo "azure DevOps Cli extension was not installed"
exit 1
fi
# Document what was added to the image
DocumentInstalledItem "Azure CLI ($(az -v | grep azure-devops))"
#!/bin/bash
################################################################################
## File: azure-devops-cli.sh
## Desc: Installed Azure DevOps CLI (az devops)
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# install azure devops Cli extension
az extension add -n azure-devops
# check to determine if extension was installed or not
if [ $? -eq 0 ]
then
echo "azure DevOps Cli extension was installed"
else
echo "azure DevOps Cli extension was not installed"
exit 1
fi
# Document what was added to the image
DocumentInstalledItem "Azure CLI ($(az -v | grep azure-devops))"

View File

@@ -1,31 +1,31 @@
#!/bin/bash
################################################################################
## File: boost.sh
## Desc: Installs Boost C++ Libraries
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
BOOST_ZIP_PATH=/opt/hostedtoolcache/Boost
BOOST_LIB=/usr/local/share/boost
# Install Boost
for BOOST_VERSION in ${BOOST_VERSIONS//,/ }
do
BOOST_SYMLINK_VER=`echo "${BOOST_VERSION//[.]/_}"`
BOOST_ROOT="BOOST_ROOT_$BOOST_SYMLINK_VER"
BOOST_ZIP="boost_`echo $BOOST_VERSION`_gcc.zip"
unzip $BOOST_ZIP_PATH/$BOOST_ZIP -d $BOOST_LIB
echo "$BOOST_ROOT=$BOOST_LIB/$BOOST_VERSION" | tee -a /etc/environment
if [[ $BOOST_VERSION == $BOOST_DEFAULT ]]; then
echo "BOOST_ROOT=$BOOST_LIB/$BOOST_VERSION" | tee -a /etc/environment
fi
DocumentInstalledItem "Boost C++ Libraries $BOOST_VERSION"
done
# Deleting archives with Boost Libraries
rm -rf $BOOST_ZIP_PATH
#!/bin/bash
################################################################################
## File: boost.sh
## Desc: Installs Boost C++ Libraries
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
BOOST_ZIP_PATH=/opt/hostedtoolcache/Boost
BOOST_LIB=/usr/local/share/boost
# Install Boost
for BOOST_VERSION in ${BOOST_VERSIONS//,/ }
do
BOOST_SYMLINK_VER=`echo "${BOOST_VERSION//[.]/_}"`
BOOST_ROOT="BOOST_ROOT_$BOOST_SYMLINK_VER"
BOOST_ZIP="boost_`echo $BOOST_VERSION`_gcc.zip"
unzip $BOOST_ZIP_PATH/$BOOST_ZIP -d $BOOST_LIB
echo "$BOOST_ROOT=$BOOST_LIB/$BOOST_VERSION" | tee -a /etc/environment
if [[ $BOOST_VERSION == $BOOST_DEFAULT ]]; then
echo "BOOST_ROOT=$BOOST_LIB/$BOOST_VERSION" | tee -a /etc/environment
fi
DocumentInstalledItem "Boost C++ Libraries $BOOST_VERSION"
done
# Deleting archives with Boost Libraries
rm -rf $BOOST_ZIP_PATH

View File

@@ -1,24 +1,24 @@
#!/bin/bash
################################################################################
## File: build-essential.sh
## Desc: Installs build-essential package
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
PACKAGE=build-essential
# 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"
if ! IsInstalled $PACKAGE; then
echo "Installing $PACKAGE"
apt-get install -y --no-install-recommends $PACKAGE
else
echo "$PACKAGE is already installed"
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "$PACKAGE"
#!/bin/bash
################################################################################
## File: build-essential.sh
## Desc: Installs build-essential package
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
PACKAGE=build-essential
# 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"
if ! IsInstalled $PACKAGE; then
echo "Installing $PACKAGE"
apt-get install -y --no-install-recommends $PACKAGE
else
echo "$PACKAGE is already installed"
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "$PACKAGE"

View File

@@ -1,31 +1,31 @@
#!/bin/bash
################################################################################
## File: example.sh
## Desc: This is an example script that can be copied to add a new software
## installer to the image
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
apt-add-repository "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-6.0 main"
apt-get update
apt-get install -y clang-6.0 lldb-6.0 lld-6.0
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-6.0 100
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 100
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
for cmd in clang clang++ clang-6.0 clang++-6.0; do
if ! command -v $cmd; then
echo "$cmd was not installed"
exit 1
fi
done
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Clang 6.0 ($(clang-6.0 --version | head -n 1))"
#!/bin/bash
################################################################################
## File: example.sh
## Desc: This is an example script that can be copied to add a new software
## installer to the image
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
apt-add-repository "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-6.0 main"
apt-get update
apt-get install -y clang-6.0 lldb-6.0 lld-6.0
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-6.0 100
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 100
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
for cmd in clang clang++ clang-6.0 clang++-6.0; do
if ! command -v $cmd; then
echo "$cmd was not installed"
exit 1
fi
done
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Clang 6.0 ($(clang-6.0 --version | head -n 1))"

View File

@@ -1,30 +1,30 @@
#!/bin/bash
################################################################################
## File: cmake.sh
## Desc: Installs CMake
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# 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"
if command -v cmake; then
echo "Example variable already set to $EXAMPLE_VAR"
else
curl -sL https://cmake.org/files/v3.12/cmake-3.12.4-Linux-x86_64.sh -o cmakeinstall.sh \
&& chmod +x cmakeinstall.sh \
&& ./cmakeinstall.sh --prefix=/usr/local --exclude-subdir \
&& rm cmakeinstall.sh
fi
# 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 cmake; then
echo "cmake was not installed"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "CMake ($(cmake --version | head -n 1))"
#!/bin/bash
################################################################################
## File: cmake.sh
## Desc: Installs CMake
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# 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"
if command -v cmake; then
echo "Example variable already set to $EXAMPLE_VAR"
else
curl -sL https://cmake.org/files/v3.12/cmake-3.12.4-Linux-x86_64.sh -o cmakeinstall.sh \
&& chmod +x cmakeinstall.sh \
&& ./cmakeinstall.sh --prefix=/usr/local --exclude-subdir \
&& rm cmakeinstall.sh
fi
# 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 cmake; then
echo "cmake was not installed"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "CMake ($(cmake --version | head -n 1))"

View File

@@ -1,26 +1,26 @@
#!/bin/bash
################################################################################
## File: docker-compose.sh
## Desc: Installs Docker Compose
################################################################################
source $HELPER_SCRIPTS/apt.sh
source $HELPER_SCRIPTS/document.sh
version="1.22.0"
# Install latest docker-compose from releases
curl -L "https://github.com/docker/compose/releases/download/$version/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
# 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 docker-compose; then
echo "docker-compose was not installed"
exit 1
fi
## Add version information to the metadata file
echo "Documenting Docker Compose version"
docker_compose_version=$(docker-compose -v)
DocumentInstalledItem "Docker Compose (${docker_compose_version})"
#!/bin/bash
################################################################################
## File: docker-compose.sh
## Desc: Installs Docker Compose
################################################################################
source $HELPER_SCRIPTS/apt.sh
source $HELPER_SCRIPTS/document.sh
version="1.22.0"
# Install latest docker-compose from releases
curl -L "https://github.com/docker/compose/releases/download/$version/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
# 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 docker-compose; then
echo "docker-compose was not installed"
exit 1
fi
## Add version information to the metadata file
echo "Documenting Docker Compose version"
docker_compose_version=$(docker-compose -v)
DocumentInstalledItem "Docker Compose (${docker_compose_version})"

View File

@@ -1,43 +1,43 @@
#!/bin/bash
################################################################################
## File: docker-ce.sh
## Desc: Installs docker onto the image, but does not pre-pull any images
################################################################################
source $HELPER_SCRIPTS/apt.sh
source $HELPER_SCRIPTS/document.sh
docker_package=moby
## Check to see if docker is already installed
echo "Determing if Docker ($docker_package) is installed"
if ! IsInstalled $docker_package; then
echo "Docker ($docker_package) was not found. Installing..."
apt-get remove -y moby-engine moby-cli
apt-get update
apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/microsoft-prod.list
apt-get update
apt-get install -y moby-engine moby-cli
else
echo "Docker ($docker_package) is already installed"
fi
# 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 docker; then
echo "docker was not installed"
exit 1
else
# Docker daemon takes time to come up after installing
sleep 10
set -e
docker info
set +e
fi
## Add version information to the metadata file
echo "Documenting Docker version"
docker_version=$(docker -v)
DocumentInstalledItem "Docker ($docker_version)"
#!/bin/bash
################################################################################
## File: docker-ce.sh
## Desc: Installs docker onto the image, but does not pre-pull any images
################################################################################
source $HELPER_SCRIPTS/apt.sh
source $HELPER_SCRIPTS/document.sh
docker_package=moby
## Check to see if docker is already installed
echo "Determing if Docker ($docker_package) is installed"
if ! IsInstalled $docker_package; then
echo "Docker ($docker_package) was not found. Installing..."
apt-get remove -y moby-engine moby-cli
apt-get update
apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/microsoft-prod.list
apt-get update
apt-get install -y moby-engine moby-cli
else
echo "Docker ($docker_package) is already installed"
fi
# 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 docker; then
echo "docker was not installed"
exit 1
else
# Docker daemon takes time to come up after installing
sleep 10
set -e
docker info
set +e
fi
## Add version information to the metadata file
echo "Documenting Docker version"
docker_version=$(docker -v)
DocumentInstalledItem "Docker ($docker_version)"

View File

@@ -1,34 +1,34 @@
#!/bin/bash
################################################################################
## File: docker.sh
## Desc: Installs the correct version of docker onto the image, and pulls
## down the default docker image used for building on ubuntu
################################################################################
source $HELPER_SCRIPTS/apt.sh
source $HELPER_SCRIPTS/document.sh
DOCKER_PACKAGE=moby
apt-get remove -y moby-engine mobi-cli
apt-get update
apt-get install -y apt-transport-https ca-certificates curl software-properties-common
apt-get update
apt-get install -y moby-engine mobi-cli
docker pull node:10
docker pull node:12
docker pull buildpack-deps:stretch
docker pull node:10-alpine
docker pull node:12-alpine
docker pull debian:8
docker pull debian:9
docker pull alpine:3.7
docker pull alpine:3.8
docker pull alpine:3.9
docker pull alpine:3.10
## Add version information to the metadata file
echo "Documenting Docker version"
DOCKER_VERSION=`docker -v`
DocumentInstalledItem "Docker ($DOCKER_VERSION)"
#!/bin/bash
################################################################################
## File: docker.sh
## Desc: Installs the correct version of docker onto the image, and pulls
## down the default docker image used for building on ubuntu
################################################################################
source $HELPER_SCRIPTS/apt.sh
source $HELPER_SCRIPTS/document.sh
DOCKER_PACKAGE=moby
apt-get remove -y moby-engine mobi-cli
apt-get update
apt-get install -y apt-transport-https ca-certificates curl software-properties-common
apt-get update
apt-get install -y moby-engine mobi-cli
docker pull node:10
docker pull node:12
docker pull buildpack-deps:stretch
docker pull node:10-alpine
docker pull node:12-alpine
docker pull debian:8
docker pull debian:9
docker pull alpine:3.7
docker pull alpine:3.8
docker pull alpine:3.9
docker pull alpine:3.10
## Add version information to the metadata file
echo "Documenting Docker version"
DOCKER_VERSION=`docker -v`
DocumentInstalledItem "Docker ($DOCKER_VERSION)"

View File

@@ -0,0 +1,29 @@
#!/bin/bash
################################################################################
## File: dotnetcore.sh
## Desc: Installs .NET Core onto the image for running the provisioner
################################################################################
source $HELPER_SCRIPTS/apt.sh
source $HELPER_SCRIPTS/document.sh
DOTNET_PACKAGE=dotnet-dev-1.0.4
echo "Determing if .NET Core ($DOTNET_PACKAGE) is installed"
if ! IsInstalled $DOTNET_PACKAGE; then
echo "Could not find .NET Core ($DOTNET_PACKAGE), installing..."
echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893
apt-get update
apt-get install $DOTNET_PACKAGE -y
else
echo ".NET Core ($DOTNET_PACKAGE) is already installed"
fi
echo "Testing .NET Core ($DOTNET_PACKAGE)"
echo "Pulling down initial dependencies"
dotnet help
echo "Documenting .NET Core ($DOTNET_PACKAGE)"
DOTNET_VERSION=`dotnet --version`
DocumentInstalledItem ".NET Core $DOTNET_VERSION"

View File

@@ -1,39 +1,39 @@
#!/bin/bash
################################################################################
## File: erlang.sh
## Desc: Installs erlang
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
source_list=/etc/apt/sources.list.d/eslerlang.list
# Install Erlang
echo "deb http://binaries.erlang-solutions.com/debian $(lsb_release -cs) contrib" > $source_list
wget -O - http://binaries.erlang-solutions.com/debian/erlang_solutions.asc | apt-key add -
apt-get update
apt-get install -y --no-install-recommends esl-erlang
# Install rebar3
wget -q -O rebar3 https://s3.amazonaws.com/rebar3/rebar3
chmod +x rebar3
mv rebar3 /usr/local/bin/rebar3
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
for cmd in erl erlc rebar3; do
if ! command -v $cmd; then
echo "$cmd was not installed or not found on PATH"
exit 1
fi
done
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
erlang_version="$(erl -version 2>&1 | tr -d '\n' | tr -d '\r')"
DocumentInstalledItem "Erlang ($erlang_version)"
# Clean up source list
rm $source_list
#!/bin/bash
################################################################################
## File: erlang.sh
## Desc: Installs erlang
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
source_list=/etc/apt/sources.list.d/eslerlang.list
# Install Erlang
echo "deb http://binaries.erlang-solutions.com/debian $(lsb_release -cs) contrib" > $source_list
wget -O - http://binaries.erlang-solutions.com/debian/erlang_solutions.asc | apt-key add -
apt-get update
apt-get install -y --no-install-recommends esl-erlang
# Install rebar3
wget -q -O rebar3 https://s3.amazonaws.com/rebar3/rebar3
chmod +x rebar3
mv rebar3 /usr/local/bin/rebar3
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
for cmd in erl erlc rebar3; do
if ! command -v $cmd; then
echo "$cmd was not installed or not found on PATH"
exit 1
fi
done
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
erlang_version="$(erl -version 2>&1 | tr -d '\n' | tr -d '\r')"
DocumentInstalledItem "Erlang ($erlang_version)"
# Clean up source list
rm $source_list

View File

@@ -1,31 +1,31 @@
#!/bin/bash
################################################################################
## File: example.sh
## Desc: This is an example script that can be copied to add a new software
## installer to the image
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
# 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"
if [ -z $EXAMPLE_VAR ]; then
$EXAMPLE_VAR=1.0.0
else
echo "Example variable already set to $EXAMPLE_VAR"
fi
# 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 [ -z $EXAMPLE_VAR ]; then
echo "EXAMPLE_VAR variable was not set as expected"
exit 1
else
echo "EXAMPLE_VAR was set properly"
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Example Var ($EXAMPLE_VAR)"
#!/bin/bash
################################################################################
## File: example.sh
## Desc: This is an example script that can be copied to add a new software
## installer to the image
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
# 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"
if [ -z $EXAMPLE_VAR ]; then
$EXAMPLE_VAR=1.0.0
else
echo "Example variable already set to $EXAMPLE_VAR"
fi
# 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 [ -z $EXAMPLE_VAR ]; then
echo "EXAMPLE_VAR variable was not set as expected"
exit 1
else
echo "EXAMPLE_VAR was set properly"
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Example Var ($EXAMPLE_VAR)"

View File

@@ -1,25 +1,25 @@
#!/bin/bash
################################################################################
## File: firefox.sh
## Desc: Installs Firefox
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
# Install Firefox
apt-get install -y firefox
# 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 firefox; then
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
# Resolves: Running Firefox as root in a regular user's session is not supported.
# ($HOME is /home/packer which is owned by packer.)
HOME=/root
DocumentInstalledItem "Firefox ($(firefox --version))"
#!/bin/bash
################################################################################
## File: firefox.sh
## Desc: Installs Firefox
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
# Install Firefox
apt-get install -y firefox
# 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 firefox; then
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
# Resolves: Running Firefox as root in a regular user's session is not supported.
# ($HOME is /home/packer which is owned by packer.)
HOME=/root
DocumentInstalledItem "Firefox ($(firefox --version))"

View File

@@ -1,25 +1,25 @@
#!/bin/bash
################################################################################
## File: gcc.sh
## Desc: Installs GNU C++
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Install GNU C++ compiler
add-apt-repository ppa:ubuntu-toolchain-r/test -y
apt-get update -y
apt-get install g++-7 -y
# 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 g++-7; then
echo "GNU C++ was not installed"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "GNU C++ $(g++-7 --version | head -n 1 | cut -d ' ' -f 4)"
#!/bin/bash
################################################################################
## File: gcc.sh
## Desc: Installs GNU C++
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Install GNU C++ compiler
add-apt-repository ppa:ubuntu-toolchain-r/test -y
apt-get update -y
apt-get install g++-7 -y
# 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 g++-7; then
echo "GNU C++ was not installed"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "GNU C++ $(g++-7 --version | head -n 1 | cut -d ' ' -f 4)"

View File

@@ -1,37 +1,37 @@
#!/bin/bash
################################################################################
## File: git.sh
## Desc: Installs Git
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
## Install git
add-apt-repository ppa:git-core/ppa -y
apt-get update
apt-get install git -y
git --version
# Install git-lfs
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
apt-get install -y --no-install-recommends git-lfs
# Run tests to determine that the software installed as expected
echo "Testing git installation"
if ! command -v git; then
echo "git was not installed"
exit 1
fi
echo "Testing git-lfs installation"
if ! command -v git-lfs; then
echo "git-lfs was not installed"
exit 1
fi
# Document what was added to the image
echo "Lastly, document the installed versions"
# git version 2.20.1
DocumentInstalledItem "Git ($(git --version 2>&1 | cut -d ' ' -f 3))"
# git-lfs/2.6.1 (GitHub; linux amd64; go 1.11.1)
DocumentInstalledItem "Git Large File Storage (LFS) ($(git-lfs --version 2>&1 | cut -d ' ' -f 1 | cut -d '/' -f 2))"
#!/bin/bash
################################################################################
## File: git.sh
## Desc: Installs Git
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
## Install git
add-apt-repository ppa:git-core/ppa -y
apt-get update
apt-get install git -y
git --version
# Install git-lfs
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
apt-get install -y --no-install-recommends git-lfs
# Run tests to determine that the software installed as expected
echo "Testing git installation"
if ! command -v git; then
echo "git was not installed"
exit 1
fi
echo "Testing git-lfs installation"
if ! command -v git-lfs; then
echo "git-lfs was not installed"
exit 1
fi
# Document what was added to the image
echo "Lastly, document the installed versions"
# git version 2.20.1
DocumentInstalledItem "Git ($(git --version 2>&1 | cut -d ' ' -f 3))"
# git-lfs/2.6.1 (GitHub; linux amd64; go 1.11.1)
DocumentInstalledItem "Git Large File Storage (LFS) ($(git-lfs --version 2>&1 | cut -d ' ' -f 1 | cut -d '/' -f 2))"

View File

@@ -1,27 +1,27 @@
#!/bin/bash
################################################################################
## File: google-chrome.sh
## Desc: Installs google-chrome
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
LSB_RELEASE=$(lsb_release -rs)
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.list
apt-get update
apt-get install -y google-chrome-stable
echo "CHROME_BIN=/usr/bin/google-chrome" | tee -a /etc/environment
# 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 google-chrome; then
echo "google-chrome was not installed"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Google Chrome ($(google-chrome --version))"
#!/bin/bash
################################################################################
## File: google-chrome.sh
## Desc: Installs google-chrome
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
LSB_RELEASE=$(lsb_release -rs)
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.list
apt-get update
apt-get install -y google-chrome-stable
echo "CHROME_BIN=/usr/bin/google-chrome" | tee -a /etc/environment
# 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 google-chrome; then
echo "google-chrome was not installed"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Google Chrome ($(google-chrome --version))"

View File

@@ -1,25 +1,25 @@
#!/bin/bash
################################################################################
## File: google-cloud-sdk.sh
## Desc: Installs the Google Cloud SDK
################################################################################
# Source the helpers
source $HELPER_SCRIPTS/document.sh
# 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
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
sudo apt-get update -y
sudo apt-get install -y google-cloud-sdk
# Validate the installation
echo "Validate the installation"
if ! command -v gcloud; then
echo "gcloud was not installed"
exit 1
fi
# Document the installed version
echo "Document the installed version"
DocumentInstalledItem "Google Cloud SDK ($(gcloud --version | head -n 1 | cut -d ' ' -f 4))"
#!/bin/bash
################################################################################
## File: google-cloud-sdk.sh
## Desc: Installs the Google Cloud SDK
################################################################################
# Source the helpers
source $HELPER_SCRIPTS/document.sh
# 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
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
sudo apt-get update -y
sudo apt-get install -y google-cloud-sdk
# Validate the installation
echo "Validate the installation"
if ! command -v gcloud; then
echo "gcloud was not installed"
exit 1
fi
# Document the installed version
echo "Document the installed version"
DocumentInstalledItem "Google Cloud SDK ($(gcloud --version | head -n 1 | cut -d ' ' -f 4))"

View File

@@ -1,64 +1,64 @@
#!/bin/bash
################################################################################
## File: haskell.sh
## Desc: Installs Haskell
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
# Install Herbert V. Riedel's PPA for managing multiple version of ghc on ubuntu.
# https://launchpad.net/~hvr/+archive/ubuntu/ghc
apt-get install -y software-properties-common
add-apt-repository -y ppa:hvr/ghc
apt-get update
# Install various versions of ghc and cabal
apt-get install -y \
ghc-8.0.2 \
ghc-8.2.2 \
ghc-8.4.4 \
ghc-8.6.2 \
ghc-8.6.3 \
ghc-8.6.4 \
ghc-8.6.5 \
ghc-8.8.1 \
cabal-install-2.0 \
cabal-install-2.2 \
cabal-install-2.4 \
cabal-install-3.0
# Install haskell stack, pinned to v2.1.3
curl -sSL https://raw.githubusercontent.com/commercialhaskell/stack/v2.1.3/etc/scripts/get-stack.sh | sh
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
# Check all ghc versions
for version in 8.0.2 8.2.2 8.4.4 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1; do
if ! command -v /opt/ghc/$version/bin/ghc; then
echo "ghc $version was not installed"
exit 1
fi
done
# Check all cabal versions
for version in 2.0 2.2 2.4 3.0; do
if ! command -v /opt/cabal/$version/bin/cabal; then
echo "cabal $version was not installed"
exit 1
fi
done
# Check stack
if ! command -v stack; then
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
for version in 2.0 2.2 2.4 3.0; do
DocumentInstalledItem "Haskell Cabal ($(/opt/cabal/$version/bin/cabal --version))"
done
for version in 8.0.2 8.2.2 8.4.4 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1; do
DocumentInstalledItem "GHC ($(/opt/ghc/$version/bin/ghc --version))"
done
DocumentInstalledItem "Haskell Stack ($(stack --version))"
#!/bin/bash
################################################################################
## File: haskell.sh
## Desc: Installs Haskell
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
# Install Herbert V. Riedel's PPA for managing multiple version of ghc on ubuntu.
# https://launchpad.net/~hvr/+archive/ubuntu/ghc
apt-get install -y software-properties-common
add-apt-repository -y ppa:hvr/ghc
apt-get update
# Install various versions of ghc and cabal
apt-get install -y \
ghc-8.0.2 \
ghc-8.2.2 \
ghc-8.4.4 \
ghc-8.6.2 \
ghc-8.6.3 \
ghc-8.6.4 \
ghc-8.6.5 \
ghc-8.8.1 \
cabal-install-2.0 \
cabal-install-2.2 \
cabal-install-2.4 \
cabal-install-3.0
# Install haskell stack, pinned to v2.1.3
curl -sSL https://raw.githubusercontent.com/commercialhaskell/stack/v2.1.3/etc/scripts/get-stack.sh | sh
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
# Check all ghc versions
for version in 8.0.2 8.2.2 8.4.4 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1; do
if ! command -v /opt/ghc/$version/bin/ghc; then
echo "ghc $version was not installed"
exit 1
fi
done
# Check all cabal versions
for version in 2.0 2.2 2.4 3.0; do
if ! command -v /opt/cabal/$version/bin/cabal; then
echo "cabal $version was not installed"
exit 1
fi
done
# Check stack
if ! command -v stack; then
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
for version in 2.0 2.2 2.4 3.0; do
DocumentInstalledItem "Haskell Cabal ($(/opt/cabal/$version/bin/cabal --version))"
done
for version in 8.0.2 8.2.2 8.4.4 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1; do
DocumentInstalledItem "GHC ($(/opt/ghc/$version/bin/ghc --version))"
done
DocumentInstalledItem "Haskell Stack ($(stack --version))"

View File

@@ -1,22 +1,22 @@
#!/bin/bash
################################################################################
## File: heroku.sh
## Desc: Installs Heroku CLI
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
# Install Heroku CLI
curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
# 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 heroku; then
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Heroku ($(heroku version))"
#!/bin/bash
################################################################################
## File: heroku.sh
## Desc: Installs Heroku CLI
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
# Install Heroku CLI
curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
# 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 heroku; then
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Heroku ($(heroku version))"

View File

@@ -1,37 +1,37 @@
#!/bin/bash
################################################################################
## File: hhvm.sh
## Desc: Installs hhvm
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
hhvm_package=hhvm
# 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"
if ! IsInstalled ${hhvm_package}; then
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xB4112585D386EB94
add-apt-repository https://dl.hhvm.com/ubuntu
apt-get update
apt-get -qq install -y hhvm
else
echo "${hhvm_package} already installed"
fi
# 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 ! IsInstalled ${hhvm_package}; then
echo "${hhvm_package} was not installed"
exit 1
fi
if ! command -v hhvm; then
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "HHVM ($(hhvm --version | head -n 1))"
#!/bin/bash
################################################################################
## File: hhvm.sh
## Desc: Installs hhvm
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
hhvm_package=hhvm
# 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"
if ! IsInstalled ${hhvm_package}; then
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xB4112585D386EB94
add-apt-repository https://dl.hhvm.com/ubuntu
apt-get update
apt-get -qq install -y hhvm
else
echo "${hhvm_package} already installed"
fi
# 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 ! IsInstalled ${hhvm_package}; then
echo "${hhvm_package} was not installed"
exit 1
fi
if ! command -v hhvm; then
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "HHVM ($(hhvm --version | head -n 1))"

View File

@@ -1,20 +1,20 @@
#!/bin/bash
################################################################################
## File: image-magick.sh
## Desc: Installs ImageMagick
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
# Install ImageMagick
apt-get install -y --no-install-recommends --fix-missing \
imagemagick \
libmagickcore-dev \
libmagickwand-dev \
libmagic-dev
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "ImageMagick"
#!/bin/bash
################################################################################
## File: image-magick.sh
## Desc: Installs ImageMagick
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
# Install ImageMagick
apt-get install -y --no-install-recommends --fix-missing \
imagemagick \
libmagickcore-dev \
libmagickwand-dev \
libmagic-dev
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "ImageMagick"

View File

@@ -1,7 +1,6 @@
#!/bin/bash
################################################################################
## File: java-tools.sh
## Team: CI-Platform
## Desc: Installs Java and related tooling (Ant, Gradle, Maven)
################################################################################
@@ -34,11 +33,11 @@ apt-fast install -y --no-install-recommends ant ant-optional
echo "ANT_HOME=/usr/share/ant" | tee -a /etc/environment
# Install Maven
curl -sL https://www-eu.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip -o maven.zip
curl -sL https://www-eu.apache.org/dist/maven/maven-3/3.6.2/binaries/apache-maven-3.6.2-bin.zip -o maven.zip
unzip -d /usr/share maven.zip
rm maven.zip
ln -s /usr/share/apache-maven-3.6.3/bin/mvn /usr/bin/mvn
echo "M2_HOME=/usr/share/apache-maven-3.6.3" | tee -a /etc/environment
ln -s /usr/share/apache-maven-3.6.2/bin/mvn /usr/bin/mvn
echo "M2_HOME=/usr/share/apache-maven-3.6.2" | tee -a /etc/environment
# Install Gradle
# This script downloads the latest HTML list of releases at https://gradle.org/releases/.

View File

@@ -1,26 +1,26 @@
#!/bin/bash
################################################################################
## File: kind.sh
## Desc: Installs kind
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
# Install KIND
KIND_VERSION="v0.5.1"
curl -L -o /usr/local/bin/kind "https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-linux-amd64"
chmod +x /usr/local/bin/kind
# 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 kind; then
echo "Kind 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 "Kind ($(kind version))"
#!/bin/bash
################################################################################
## File: kind.sh
## Desc: Installs kind
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
# Install KIND
KIND_VERSION="v0.5.1"
curl -L -o /usr/local/bin/kind "https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-linux-amd64"
chmod +x /usr/local/bin/kind
# 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 kind; then
echo "Kind 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 "Kind ($(kind version))"

View File

@@ -1,35 +1,35 @@
#!/bin/bash
################################################################################
## File: leiningen.sh
## Desc: Installs Leiningen
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
set -e
LEIN_BIN=/usr/local/bin/lein
curl -s https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > $LEIN_BIN
chmod 0755 $LEIN_BIN
# Run lein to trigger self-install
export LEIN_HOME=/usr/local/lib/lein
lein
LEIN_JAR=$(find $LEIN_HOME -name "leiningen-*-standalone.jar")
echo "LEIN_JAR=$LEIN_JAR" | tee -a /etc/environment
echo "LEIN_HOME=$LEIN_HOME" | tee -a /etc/environment
# 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 lein; then
echo "lein was not installed"
exit 1
else
lein new app testapp && rm -rf testapp
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Leiningen ($(lein -v))"
#!/bin/bash
################################################################################
## File: leiningen.sh
## Desc: Installs Leiningen
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
set -e
LEIN_BIN=/usr/local/bin/lein
curl -s https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > $LEIN_BIN
chmod 0755 $LEIN_BIN
# Run lein to trigger self-install
export LEIN_HOME=/usr/local/lib/lein
lein
LEIN_JAR=$(find $LEIN_HOME -name "leiningen-*-standalone.jar")
echo "LEIN_JAR=$LEIN_JAR" | tee -a /etc/environment
echo "LEIN_HOME=$LEIN_HOME" | tee -a /etc/environment
# 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 lein; then
echo "lein was not installed"
exit 1
else
lein new app testapp && rm -rf testapp
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Leiningen ($(lein -v))"

View File

@@ -1,23 +1,23 @@
#!/bin/bash
################################################################################
## File: miniconda.sh
## Desc: Installs miniconda
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Install Miniconda
curl -sL https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o miniconda.sh \
&& chmod +x miniconda.sh \
&& ./miniconda.sh -b -p /usr/share/miniconda \
&& rm miniconda.sh
CONDA=/usr/share/miniconda
echo "CONDA=$CONDA" | tee -a /etc/environment
ln -s $CONDA/bin/conda /usr/bin/conda
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Miniconda ($($CONDA/bin/conda --version))"
#!/bin/bash
################################################################################
## File: miniconda.sh
## Desc: Installs miniconda
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Install Miniconda
curl -sL https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o miniconda.sh \
&& chmod +x miniconda.sh \
&& ./miniconda.sh -b -p /usr/share/miniconda \
&& rm miniconda.sh
CONDA=/usr/share/miniconda
echo "CONDA=$CONDA" | tee -a /etc/environment
ln -s $CONDA/bin/conda /usr/bin/conda
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Miniconda ($($CONDA/bin/conda --version))"

View File

@@ -1,29 +1,29 @@
#!/bin/bash
################################################################################
## File: cmake.sh
## Desc: Installs Mono
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
LSB_CODENAME=$(lsb_release -cs)
# Test to see if the software in question is already installed, if not install it
# wget "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" -O out && sudo apt-key add out && rm out
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu stable-$LSB_CODENAME main" | tee /etc/apt/sources.list.d/mono-official-stable.list
apt-get update
apt-get install -y --no-install-recommends apt-transport-https mono-complete
# 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 mono; then
echo "mono was not installed"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Mono ($(mono --version | head -n 1))"
#!/bin/bash
################################################################################
## File: cmake.sh
## Desc: Installs Mono
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
LSB_CODENAME=$(lsb_release -cs)
# Test to see if the software in question is already installed, if not install it
# wget "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" -O out && sudo apt-key add out && rm out
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu stable-$LSB_CODENAME main" | tee /etc/apt/sources.list.d/mono-official-stable.list
apt-get update
apt-get install -y --no-install-recommends apt-transport-https mono-complete
# 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 mono; then
echo "mono was not installed"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Mono ($(mono --version | head -n 1))"

View File

@@ -1,43 +1,43 @@
#!/bin/bash
################################################################################
## File: mysql.sh
## Desc: Installs MySQL Client
################################################################################
## Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
export ACCEPT_EULA=Y
# Install MySQL Client
apt-get install mysql-client -y
# Install MySQL Server
MYSQL_ROOT_PASSWORD=root
echo "mysql-server mysql-server/root_password password $MYSQL_ROOT_PASSWORD" | debconf-set-selections
echo "mysql-server mysql-server/root_password_again password $MYSQL_ROOT_PASSWORD" | debconf-set-selections
apt-get install -y mysql-server
# Install MS SQL Server client tools (https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-tools?view=sql-server-2017)
apt-get install -y mssql-tools unixodbc-dev
apt-get -f install
ln -s /opt/mssql-tools/bin/* /usr/local/bin/
# 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 mysql; then
echo "mysql was not installed"
exit 1
fi
set -e
mysql -vvv -e 'CREATE DATABASE smoke_test' -uroot -proot
mysql -vvv -e 'DROP DATABASE smoke_test' -uroot -proot
set +e
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "MySQL ($(mysql --version))"
DocumentInstalledItem "MySQL Server (user:root password:root)"
DocumentInstalledItem "MS SQL Server Client Tools"
#!/bin/bash
################################################################################
## File: mysql.sh
## Desc: Installs MySQL Client
################################################################################
## Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
export ACCEPT_EULA=Y
# Install MySQL Client
apt-get install mysql-client -y
# Install MySQL Server
MYSQL_ROOT_PASSWORD=root
echo "mysql-server mysql-server/root_password password $MYSQL_ROOT_PASSWORD" | debconf-set-selections
echo "mysql-server mysql-server/root_password_again password $MYSQL_ROOT_PASSWORD" | debconf-set-selections
apt-get install -y mysql-server
# Install MS SQL Server client tools (https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-tools?view=sql-server-2017)
apt-get install -y mssql-tools unixodbc-dev
apt-get -f install
ln -s /opt/mssql-tools/bin/* /usr/local/bin/
# 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 mysql; then
echo "mysql was not installed"
exit 1
fi
set -e
mysql -vvv -e 'CREATE DATABASE smoke_test' -uroot -proot
mysql -vvv -e 'DROP DATABASE smoke_test' -uroot -proot
set +e
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "MySQL ($(mysql --version))"
DocumentInstalledItem "MySQL Server (user:root password:root)"
DocumentInstalledItem "MS SQL Server Client Tools"

View File

@@ -1,8 +1,7 @@
#!/bin/bash
################################################################################
## File: nodejs.sh
## Team: CI-Platform
## Desc: Installs Node.js LTS and related tooling (Gulp, Bower, Grunt)
## Desc: Installs Node.js LTS and related tooling (Gulp, Grunt)
################################################################################
# Source the helpers for use with the script
@@ -11,7 +10,7 @@ source $HELPER_SCRIPTS/document.sh
# Install LTS Node.js and related build tools
curl -sL https://git.io/n-install | bash -s -- -ny -
~/n/bin/n lts
npm install -g bower grunt gulp n parcel-bundler typescript
npm install -g grunt gulp n parcel-bundler typescript
npm install -g --save-dev webpack webpack-cli
npm install -g npm
rm -rf ~/n
@@ -26,7 +25,7 @@ apt-get install -y --no-install-recommends yarn
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
for cmd in node bower grunt gulp webpack parcel yarn; do
for cmd in node grunt gulp webpack parcel yarn; do
if ! command -v $cmd; then
echo "$cmd was not installed"
exit 1
@@ -36,7 +35,6 @@ done
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Node.js ($(node --version))"
DocumentInstalledItem "Bower ($(bower --version))"
DocumentInstalledItem "Grunt ($(grunt --version))"
DocumentInstalledItem "Gulp ($(gulp --version))"
DocumentInstalledItem "n ($(n --version))"

View File

@@ -1,29 +1,29 @@
#!/bin/bash
################################################################################
## File: phantomjs.sh
## Desc: Installs PhantomJS
################################################################################
set -e
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Install PhantomJS
apt-get install -y chrpath libssl-dev libxft-dev libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev
PHANTOM_JS=phantomjs-2.1.1-linux-x86_64
wget https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2
tar xvjf $PHANTOM_JS.tar.bz2
mv $PHANTOM_JS /usr/local/share
ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
# 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 phantomjs; then
echo "phantomjs was not installed"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "PhantomJS ($(phantomjs --version))"
#!/bin/bash
################################################################################
## File: phantomjs.sh
## Desc: Installs PhantomJS
################################################################################
set -e
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Install PhantomJS
apt-get install -y chrpath libssl-dev libxft-dev libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev
PHANTOM_JS=phantomjs-2.1.1-linux-x86_64
wget https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2
tar xvjf $PHANTOM_JS.tar.bz2
mv $PHANTOM_JS /usr/local/share
ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
# 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 phantomjs; then
echo "phantomjs was not installed"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "PhantomJS ($(phantomjs --version))"

View File

@@ -1,22 +1,22 @@
#!/bin/bash
################################################################################
## File: pollinate.sh
## Desc: Installs Pollinate
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Install Pollinate
apt-get install -y --no-install-recommends pollinate
# 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 pollinate; then
echo "pollinate was not installed"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Pollinate"
#!/bin/bash
################################################################################
## File: pollinate.sh
## Desc: Installs Pollinate
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Install Pollinate
apt-get install -y --no-install-recommends pollinate
# 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 pollinate; then
echo "pollinate was not installed"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Pollinate"

View File

@@ -1,67 +1,67 @@
#!/bin/bash
################################################################################
## File: python.sh
## Desc: Installs Python 2/3 and related tools (pip, pypy)
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Install Python, Python 3, pip, pip3
apt-get install -y --no-install-recommends python python-dev python-pip python3 python3-dev python3-pip
# Install PyPy 2.7 to $AGENT_TOOLSDIRECTORY
wget -q -P /tmp https://bitbucket.org/pypy/pypy/downloads/pypy2.7-v7.1.0-linux64.tar.bz2
tar -x -C /tmp -f /tmp/pypy2.7-v7.1.0-linux64.tar.bz2
rm /tmp/pypy2.7-v7.1.0-linux64.tar.bz2
mkdir -p $AGENT_TOOLSDIRECTORY/PyPy/2.7.13
mv /tmp/pypy2.7-v7.1.0-linux64 $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64
touch $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64.complete
# add pypy to PATH by default
ln -s $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/pypy /usr/local/bin/pypy
# pypy will be the python in PATH when its tools cache directory is prepended to PATH
# PEP 394-style symlinking; don't bother with minor version
ln -s $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/pypy $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/python2
ln -s $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/python2 $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/python
# Install latest Pip for PyPy2
$AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/pypy -m ensurepip
$AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/pypy -m pip install --ignore-installed pip
# Install PyPy 3.5 to $AGENT_TOOLSDIRECTORY
wget -q -P /tmp https://bitbucket.org/pypy/pypy/downloads/pypy3.5-v7.0.0-linux64.tar.bz2
tar -x -C /tmp -f /tmp/pypy3.5-v7.0.0-linux64.tar.bz2
rm /tmp/pypy3.5-v7.0.0-linux64.tar.bz2
mkdir -p $AGENT_TOOLSDIRECTORY/PyPy/3.5.3
mv /tmp/pypy3.5-v7.0.0-linux64 $AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64
touch $AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64.complete
# add pypy3 to PATH by default
ln -s $AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64/bin/pypy3 /usr/local/bin/pypy3
# pypy3 will be the python in PATH when its tools cache directory is prepended to PATH
# PEP 394-style symlinking; don't bother with minor version
ln -s $AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64/bin/pypy3 $AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64/bin/python3
ln -s $AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64/bin/python3 $AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64/bin/python
# Install latest Pip for PyPy3
$AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64/bin/pypy3 -m ensurepip
$AGENT_TOOLSDIRECTORY/PyPy/3.5.3/x64/bin/pypy3 -m pip install --ignore-installed pip
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
for cmd in python pip pypy python3 pip3 pypy3; do
if ! command -v $cmd; then
echo "$cmd was not installed or not found on PATH"
exit 1
fi
done
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Python ($(python --version 2>&1))"
DocumentInstalledItem "pip ($(pip --version))"
DocumentInstalledItem "Python3 ($(python3 --version))"
DocumentInstalledItem "pip3 ($(pip3 --version))"
DocumentInstalledItem "PyPy2 ($(pypy --version 2>&1 | grep PyPy))"
DocumentInstalledItem "PyPy3 ($(pypy3 --version 2>&1 | grep PyPy))"
#!/bin/bash
################################################################################
## File: python.sh
## Desc: Installs Python 2/3 and related tools (pip, pypy)
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Install Python, Python 3, pip, pip3
apt-get install -y --no-install-recommends python python-dev python-pip python3 python3-dev python3-pip
# Install PyPy 2.7 to $AGENT_TOOLSDIRECTORY
wget -q -P /tmp https://bitbucket.org/pypy/pypy/downloads/pypy2.7-v7.1.0-linux64.tar.bz2
tar -x -C /tmp -f /tmp/pypy2.7-v7.1.0-linux64.tar.bz2
rm /tmp/pypy2.7-v7.1.0-linux64.tar.bz2
mkdir -p $AGENT_TOOLSDIRECTORY/PyPy/2.7.13
mv /tmp/pypy2.7-v7.1.0-linux64 $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64
touch $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64.complete
# add pypy to PATH by default
ln -s $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/pypy /usr/local/bin/pypy
# pypy will be the python in PATH when its tools cache directory is prepended to PATH
# PEP 394-style symlinking; don't bother with minor version
ln -s $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/pypy $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/python2
ln -s $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/python2 $AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/python
# Install latest Pip for PyPy2
$AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/pypy -m ensurepip
$AGENT_TOOLSDIRECTORY/PyPy/2.7.13/x64/bin/pypy -m pip install --ignore-installed pip
# Install PyPy 3.5 to $AGENT_TOOLSDIRECTORY
wget -q -P /tmp https://bitbucket.org/pypy/pypy/downloads/pypy3.6-v7.2.0-linux64.tar.bz2
tar -x -C /tmp -f /tmp/pypy3.6-v7.2.0-linux64.tar.bz2
rm /tmp/pypy3.6-v7.2.0-linux64.tar.bz2
mkdir -p $AGENT_TOOLSDIRECTORY/PyPy/3.6.9
mv /tmp/pypy3.6-v7.2.0-linux64 $AGENT_TOOLSDIRECTORY/PyPy/3.6.9/x64
touch $AGENT_TOOLSDIRECTORY/PyPy/3.6.9/x64.complete
# add pypy3 to PATH by default
ln -s $AGENT_TOOLSDIRECTORY/PyPy/3.6.9/x64/bin/pypy3 /usr/local/bin/pypy3
# pypy3 will be the python in PATH when its tools cache directory is prepended to PATH
# PEP 394-style symlinking; don't bother with minor version
ln -s $AGENT_TOOLSDIRECTORY/PyPy/3.6.9/x64/bin/pypy3 $AGENT_TOOLSDIRECTORY/PyPy/3.6.9/x64/bin/python3
ln -s $AGENT_TOOLSDIRECTORY/PyPy/3.6.9/x64/bin/python3 $AGENT_TOOLSDIRECTORY/PyPy/3.6.9/x64/bin/python
# Install latest Pip for PyPy3
$AGENT_TOOLSDIRECTORY/PyPy/3.6.9/x64/bin/pypy3 -m ensurepip
$AGENT_TOOLSDIRECTORY/PyPy/3.6.9/x64/bin/pypy3 -m pip install --ignore-installed pip
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
for cmd in python pip pypy python3 pip3 pypy3; do
if ! command -v $cmd; then
echo "$cmd was not installed or not found on PATH"
exit 1
fi
done
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Python ($(python --version 2>&1))"
DocumentInstalledItem "pip ($(pip --version))"
DocumentInstalledItem "Python3 ($(python3 --version))"
DocumentInstalledItem "pip3 ($(pip3 --version))"
DocumentInstalledItem "PyPy2 ($(pypy --version 2>&1 | grep PyPy))"
DocumentInstalledItem "PyPy3 ($(pypy3 --version 2>&1 | grep PyPy))"

View File

@@ -1,11 +1,11 @@
#!/bin/bash
################################################################################
## File: ruby.sh
## Desc: Installs Ruby requirements
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Install Ruby requirements
apt-get install -y libz-dev openssl libssl-dev
#!/bin/bash
################################################################################
## File: ruby.sh
## Desc: Installs Ruby requirements
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Install Ruby requirements
apt-get install -y libz-dev openssl libssl-dev

View File

@@ -1,54 +1,54 @@
#!/bin/bash
################################################################################
## File: rust.sh
## Desc: Installs Rust
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
set -e
export RUSTUP_HOME=/usr/share/rust/.rustup
export CARGO_HOME=/usr/share/rust/.cargo
curl https://sh.rustup.rs -sSf | sh -s -- -y
# Add Cargo and Rust binaries to the machine path
echo "PATH=${CARGO_HOME}/bin:$PATH" | tee -a /etc/environment
source $CARGO_HOME/env
# Install common tools
rustup component add rustfmt
rustup component add clippy
cargo install bindgen
cargo install cbindgen
echo "Test installation of the Rust toochain"
# Permissions
chmod -R 777 $(dirname $RUSTUP_HOME)
for cmd in rustup rustc rustdoc cargo rustfmt cargo-clippy bindgen cbindgen; do
if ! command -v $cmd --version; then
echo "$cmd was not installed or is not found on the path"
exit 1
fi
done
# Rust Symlinks are added to a default profile /etc/skel
pushd /etc/skel
ln -sf $RUSTUP_HOME .rustup
ln -sf $CARGO_HOME .cargo
popd
# Document what was added to the image
echo "Lastly, document what was added to the metadata file"
DocumentInstalledItem "rustup ($(rustup --version 2>&1 | cut -d ' ' -f 2))"
DocumentInstalledItem "rust ($(rustc --version 2>&1 | cut -d ' ' -f 2))"
DocumentInstalledItem "cargo ($(cargo --version 2>&1 | cut -d ' ' -f 2))"
DocumentInstalledItem "rustfmt ($(rustfmt --version 2>&1 | cut -d ' ' -f 2))"
DocumentInstalledItem "clippy ($(cargo-clippy --version 2>&1 | cut -d ' ' -f 2))"
DocumentInstalledItem "rustdoc ($(rustdoc --version 2>&1 | cut -d ' ' -f 2))"
DocumentInstalledItem "bindgen ($(bindgen --version 2>&1 | cut -d ' ' -f 2))"
DocumentInstalledItem "cbindgen ($(cbindgen --version 2>&1 | cut -d ' ' -f 2))"
#!/bin/bash
################################################################################
## File: rust.sh
## Desc: Installs Rust
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
set -e
export RUSTUP_HOME=/usr/share/rust/.rustup
export CARGO_HOME=/usr/share/rust/.cargo
curl https://sh.rustup.rs -sSf | sh -s -- -y
# Add Cargo and Rust binaries to the machine path
echo "PATH=${CARGO_HOME}/bin:$PATH" | tee -a /etc/environment
source $CARGO_HOME/env
# Install common tools
rustup component add rustfmt
rustup component add clippy
cargo install bindgen
cargo install cbindgen
echo "Test installation of the Rust toochain"
# Permissions
chmod -R 777 $(dirname $RUSTUP_HOME)
for cmd in rustup rustc rustdoc cargo rustfmt cargo-clippy bindgen cbindgen; do
if ! command -v $cmd --version; then
echo "$cmd was not installed or is not found on the path"
exit 1
fi
done
# Rust Symlinks are added to a default profile /etc/skel
pushd /etc/skel
ln -sf $RUSTUP_HOME .rustup
ln -sf $CARGO_HOME .cargo
popd
# Document what was added to the image
echo "Lastly, document what was added to the metadata file"
DocumentInstalledItem "rustup ($(rustup --version 2>&1 | cut -d ' ' -f 2))"
DocumentInstalledItem "rust ($(rustc --version 2>&1 | cut -d ' ' -f 2))"
DocumentInstalledItem "cargo ($(cargo --version 2>&1 | cut -d ' ' -f 2))"
DocumentInstalledItem "rustfmt ($(rustfmt --version 2>&1 | cut -d ' ' -f 2))"
DocumentInstalledItem "clippy ($(cargo-clippy --version 2>&1 | cut -d ' ' -f 2))"
DocumentInstalledItem "rustdoc ($(rustdoc --version 2>&1 | cut -d ' ' -f 2))"
DocumentInstalledItem "bindgen ($(bindgen --version 2>&1 | cut -d ' ' -f 2))"
DocumentInstalledItem "cbindgen ($(cbindgen --version 2>&1 | cut -d ' ' -f 2))"

View File

@@ -1,7 +1,6 @@
#!/bin/bash
################################################################################
## File: scala.sh
## Team: CI-Platform
## Desc: Installs sbt
################################################################################

View File

@@ -1,15 +1,15 @@
#!/bin/bash
################################################################################
## File: sphinx.sh
## Desc: Installs Sphinx
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Install Sphinx
apt-get install -y sphinxsearch
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Sphinx Open Source Search Server"
#!/bin/bash
################################################################################
## File: sphinx.sh
## Desc: Installs Sphinx
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Install Sphinx
apt-get install -y sphinxsearch
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Sphinx Open Source Search Server"

View File

@@ -1,22 +1,22 @@
#!/bin/bash
################################################################################
## File: subversion.sh
## Desc: Installs Subversion client
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Install Subversion
apt-get install -y --no-install-recommends subversion
# 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 svn; then
echo "Subversion (svn) was not installed"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Subversion ($(svn --version | head -n 1))"
#!/bin/bash
################################################################################
## File: subversion.sh
## Desc: Installs Subversion client
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Install Subversion
apt-get install -y --no-install-recommends subversion
# 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 svn; then
echo "Subversion (svn) was not installed"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Subversion ($(svn --version | head -n 1))"

View File

@@ -1,26 +1,26 @@
#!/bin/bash
################################################################################
## File: terraform.sh
## Desc: Installs terraform
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
# Install Terraform
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"
unzip "terraform_${TERRAFORM_VERSION}_linux_amd64.zip" -d /usr/local/bin
rm -f "terraform_${TERRAFORM_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 terraform; then
echo "Terraform 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 "Terraform ($(terraform --version))"
#!/bin/bash
################################################################################
## File: terraform.sh
## Desc: Installs terraform
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
# Install Terraform
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"
unzip "terraform_${TERRAFORM_VERSION}_linux_amd64.zip" -d /usr/local/bin
rm -f "terraform_${TERRAFORM_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 terraform; then
echo "Terraform 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 "Terraform ($(terraform --version))"

View File

@@ -1,70 +1,70 @@
#!/bin/bash
################################################################################
## File: test-toolcache.sh
## Desc: Test Python and Ruby versions in tools cache
################################################################################
# Must be procecessed after tool cache setup(hosted-tool-cache.sh).
# Fail out if any tests fail
set -e
AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache
# Python test
if [ -d "$AGENT_TOOLSDIRECTORY/Python" ]; then
cd $AGENT_TOOLSDIRECTORY/Python
python_dirs=($(find . -mindepth 1 -maxdepth 1 -type d | sed "s|^\./||"))
echo "Python versions folders: ${python_dirs[@]}"
echo "------------------------------------------"
if [ -n "$python_dirs" ]; then
for version_dir in "${python_dirs[@]}"
do
echo "Test $AGENT_TOOLSDIRECTORY/Python/$version_dir:"
expected_ver=$(echo $version_dir | egrep -o '[0-9]+\.[0-9]+')
actual_ver=$($AGENT_TOOLSDIRECTORY/Python/$version_dir/x64/python -c 'import sys;print(sys.version)'| head -1 | egrep -o '[0-9]+\.[0-9]+')
if [ "$expected_ver" = "$actual_ver" ]; then
echo "Passed!"
else
echo "Expected: $expected_ver; Actual: $actual_ver"
exit 1
fi
done
else
echo "$AGENT_TOOLSDIRECTORY/Python does not include any folders"
exit 1
fi
else
echo "$AGENT_TOOLSDIRECTORY/Python does not exist"
exit 1
fi
# Ruby test
if [ -d "$AGENT_TOOLSDIRECTORY/Ruby" ]; then
cd $AGENT_TOOLSDIRECTORY/Ruby
ruby_dirs=($(find . -mindepth 1 -maxdepth 1 -type d | sed "s|^\./||"))
echo "Ruby versions folders: ${ruby_dirs[@]}"
echo "--------------------------------------"
if [ -n "$ruby_dirs" ]; then
for version_dir in "${ruby_dirs[@]}"
do
echo "Test $AGENT_TOOLSDIRECTORY/Ruby/$version_dir:"
expected_ver=$(echo $version_dir | egrep -o '[0-9]+\.[0-9]+')
actual_ver=$($AGENT_TOOLSDIRECTORY/Ruby/$version_dir/x64/bin/ruby -e "puts RUBY_VERSION" | egrep -o '[0-9]+\.[0-9]+')
if [ "$expected_ver" = "$actual_ver" ]; then
echo "Passed!"
else
echo "Expected: $expected_ver; Actual: $actual_ver"
exit 1
fi
done
else
echo "$AGENT_TOOLSDIRECTORY/Ruby does not include any folders"
exit 1
fi
else
echo "$AGENT_TOOLSDIRECTORY/Ruby does not exist"
exit 1
fi
#!/bin/bash
################################################################################
## File: test-toolcache.sh
## Desc: Test Python and Ruby versions in tools cache
################################################################################
# Must be procecessed after tool cache setup(hosted-tool-cache.sh).
# Fail out if any tests fail
set -e
AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache
# Python test
if [ -d "$AGENT_TOOLSDIRECTORY/Python" ]; then
cd $AGENT_TOOLSDIRECTORY/Python
python_dirs=($(find . -mindepth 1 -maxdepth 1 -type d | sed "s|^\./||"))
echo "Python versions folders: ${python_dirs[@]}"
echo "------------------------------------------"
if [ -n "$python_dirs" ]; then
for version_dir in "${python_dirs[@]}"
do
echo "Test $AGENT_TOOLSDIRECTORY/Python/$version_dir:"
expected_ver=$(echo $version_dir | egrep -o '[0-9]+\.[0-9]+')
actual_ver=$($AGENT_TOOLSDIRECTORY/Python/$version_dir/x64/python -c 'import sys;print(sys.version)'| head -1 | egrep -o '[0-9]+\.[0-9]+')
if [ "$expected_ver" = "$actual_ver" ]; then
echo "Passed!"
else
echo "Expected: $expected_ver; Actual: $actual_ver"
exit 1
fi
done
else
echo "$AGENT_TOOLSDIRECTORY/Python does not include any folders"
exit 1
fi
else
echo "$AGENT_TOOLSDIRECTORY/Python does not exist"
exit 1
fi
# Ruby test
if [ -d "$AGENT_TOOLSDIRECTORY/Ruby" ]; then
cd $AGENT_TOOLSDIRECTORY/Ruby
ruby_dirs=($(find . -mindepth 1 -maxdepth 1 -type d | sed "s|^\./||"))
echo "Ruby versions folders: ${ruby_dirs[@]}"
echo "--------------------------------------"
if [ -n "$ruby_dirs" ]; then
for version_dir in "${ruby_dirs[@]}"
do
echo "Test $AGENT_TOOLSDIRECTORY/Ruby/$version_dir:"
expected_ver=$(echo $version_dir | egrep -o '[0-9]+\.[0-9]+')
actual_ver=$($AGENT_TOOLSDIRECTORY/Ruby/$version_dir/x64/bin/ruby -e "puts RUBY_VERSION" | egrep -o '[0-9]+\.[0-9]+')
if [ "$expected_ver" = "$actual_ver" ]; then
echo "Passed!"
else
echo "Expected: $expected_ver; Actual: $actual_ver"
exit 1
fi
done
else
echo "$AGENT_TOOLSDIRECTORY/Ruby does not include any folders"
exit 1
fi
else
echo "$AGENT_TOOLSDIRECTORY/Ruby does not exist"
exit 1
fi

View File

@@ -1,30 +1,30 @@
#!/bin/bash
################################################################################
## File: vcpkg.sh
## Desc: Installs vcpkg
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Set env variable for vcpkg
VCPKG_INSTALLATION_ROOT=/usr/local/share/vcpkg
echo "VCPKG_INSTALLATION_ROOT=${VCPKG_INSTALLATION_ROOT}" | tee -a /etc/environment
# Install vcpkg
git clone --depth=1 https://github.com/Microsoft/vcpkg $VCPKG_INSTALLATION_ROOT
$VCPKG_INSTALLATION_ROOT/bootstrap-vcpkg.sh
$VCPKG_INSTALLATION_ROOT/vcpkg integrate install
chmod 0777 -R $VCPKG_INSTALLATION_ROOT
ln -sf $VCPKG_INSTALLATION_ROOT/vcpkg /usr/local/bin
# 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 vcpkg; then
echo "vcpkg was not installed"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Vcpkg $(vcpkg version | head -n 1 | cut -d ' ' -f 6)"
#!/bin/bash
################################################################################
## File: vcpkg.sh
## Desc: Installs vcpkg
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Set env variable for vcpkg
VCPKG_INSTALLATION_ROOT=/usr/local/share/vcpkg
echo "VCPKG_INSTALLATION_ROOT=${VCPKG_INSTALLATION_ROOT}" | tee -a /etc/environment
# Install vcpkg
git clone --depth=1 https://github.com/Microsoft/vcpkg $VCPKG_INSTALLATION_ROOT
$VCPKG_INSTALLATION_ROOT/bootstrap-vcpkg.sh
$VCPKG_INSTALLATION_ROOT/vcpkg integrate install
chmod 0777 -R $VCPKG_INSTALLATION_ROOT
ln -sf $VCPKG_INSTALLATION_ROOT/vcpkg /usr/local/bin
# 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 vcpkg; then
echo "vcpkg was not installed"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Vcpkg $(vcpkg version | head -n 1 | cut -d ' ' -f 6)"

View File

@@ -1,22 +1,22 @@
#!/bin/bash
################################################################################
## File: zeit-now.sh
## Desc: Installs the Zeit Now CLI
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Install the Zeit Now CLI
npm i -g now
# Validate the installation
echo "Validate the installation"
if ! command -v now; then
echo "Zeit Now CLI was not installed"
exit 1
fi
# Document the installed version
echo "Document the installed version"
DocumentInstalledItem "Zeit Now CLI ($(now --version))"
#!/bin/bash
################################################################################
## File: zeit-now.sh
## Desc: Installs the Zeit Now CLI
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Install the Zeit Now CLI
npm i -g now
# Validate the installation
echo "Validate the installation"
if ! command -v now; then
echo "Zeit Now CLI was not installed"
exit 1
fi
# Document the installed version
echo "Document the installed version"
DocumentInstalledItem "Zeit Now CLI ($(now --version))"

View File

@@ -1,83 +1,83 @@
function Install-MSI
{
Param
(
[String]$MsiUrl,
[String]$MsiName
)
$exitCode = -1
try
{
Write-Host "Downloading $MsiName..."
$FilePath = "${env:Temp}\$MsiName"
Invoke-WebRequest -Uri $MsiUrl -OutFile $FilePath
$Arguments = ('/i', $FilePath, '/QN', '/norestart' )
Write-Host "Starting Install $MsiName..."
$process = Start-Process -FilePath msiexec.exe -ArgumentList $Arguments -Wait -PassThru
$exitCode = $process.ExitCode
if ($exitCode -eq 0 -or $exitCode -eq 3010)
{
Write-Host -Object 'Installation successful'
return $exitCode
}
else
{
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
exit $exitCode
}
}
catch
{
Write-Host -Object "Failed to install the MSI $MsiName"
Write-Host -Object $_.Exception.Message
exit -1
}
}
function Install-EXE
{
Param
(
[String]$Url,
[String]$Name,
[String[]]$ArgumentList
)
$exitCode = -1
try
{
Write-Host "Downloading $Name..."
$FilePath = "${env:Temp}\$Name"
Invoke-WebRequest -Uri $Url -OutFile $FilePath
Write-Host "Starting Install $Name..."
$process = Start-Process -FilePath $FilePath -ArgumentList $ArgumentList -Wait -PassThru
$exitCode = $process.ExitCode
if ($exitCode -eq 0 -or $exitCode -eq 3010)
{
Write-Host -Object 'Installation successful'
return $exitCode
}
else
{
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
return $exitCode
}
}
catch
{
Write-Host -Object "Failed to install the Executable $Name"
Write-Host -Object $_.Exception.Message
return -1
}
}
function Install-MSI
{
Param
(
[String]$MsiUrl,
[String]$MsiName
)
$exitCode = -1
try
{
Write-Host "Downloading $MsiName..."
$FilePath = "${env:Temp}\$MsiName"
Invoke-WebRequest -Uri $MsiUrl -OutFile $FilePath
$Arguments = ('/i', $FilePath, '/QN', '/norestart' )
Write-Host "Starting Install $MsiName..."
$process = Start-Process -FilePath msiexec.exe -ArgumentList $Arguments -Wait -PassThru
$exitCode = $process.ExitCode
if ($exitCode -eq 0 -or $exitCode -eq 3010)
{
Write-Host -Object 'Installation successful'
return $exitCode
}
else
{
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
exit $exitCode
}
}
catch
{
Write-Host -Object "Failed to install the MSI $MsiName"
Write-Host -Object $_.Exception.Message
exit -1
}
}
function Install-EXE
{
Param
(
[String]$Url,
[String]$Name,
[String[]]$ArgumentList
)
$exitCode = -1
try
{
Write-Host "Downloading $Name..."
$FilePath = "${env:Temp}\$Name"
Invoke-WebRequest -Uri $Url -OutFile $FilePath
Write-Host "Starting Install $Name..."
$process = Start-Process -FilePath $FilePath -ArgumentList $ArgumentList -Wait -PassThru
$exitCode = $process.ExitCode
if ($exitCode -eq 0 -or $exitCode -eq 3010)
{
Write-Host -Object 'Installation successful'
return $exitCode
}
else
{
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
return $exitCode
}
}
catch
{
Write-Host -Object "Failed to install the Executable $Name"
Write-Host -Object $_.Exception.Message
return -1
}
}

View File

@@ -1,25 +1,25 @@
function Add-ContentToMarkdown {
[CmdletBinding()]
param(
$Content = ""
)
Add-Content 'C:\InstalledSoftware.md' $Content
}
function Add-SoftwareDetailsToMarkdown {
[CmdletBinding()]
param(
$SoftwareName = "",
$DescriptionMarkdown = ""
)
$Content = @"
## $SoftwareName
$DescriptionMarkdown
"@
Add-ContentToMarkdown -Content $Content
}
function Add-ContentToMarkdown {
[CmdletBinding()]
param(
$Content = ""
)
Add-Content 'C:\InstalledSoftware.md' $Content
}
function Add-SoftwareDetailsToMarkdown {
[CmdletBinding()]
param(
$SoftwareName = "",
$DescriptionMarkdown = ""
)
$Content = @"
## $SoftwareName
$DescriptionMarkdown
"@
Add-ContentToMarkdown -Content $Content
}

View File

@@ -1,68 +1,68 @@
function Test-MachinePath{
[CmdletBinding()]
param(
[string]$PathItem
)
$currentPath = Get-MachinePath
$pathItems = $currentPath.Split(';')
if($pathItems.Contains($PathItem))
{
return $true
}
else
{
return $false
}
}
function Set-MachinePath{
[CmdletBinding()]
param(
[string]$NewPath
)
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name Path -Value $NewPath
return $NewPath
}
function Add-MachinePathItem
{
[CmdletBinding()]
param(
[string]$PathItem
)
$currentPath = Get-MachinePath
$newPath = $PathItem + ';' + $currentPath
return Set-MachinePath -NewPath $newPath
}
function Get-MachinePath{
[CmdletBinding()]
param(
)
$currentPath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path
return $currentPath
}
function Get-SystemVariable{
[CmdletBinding()]
param(
[string]$SystemVariable
)
$currentPath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name $SystemVariable).$SystemVariable
return $currentPath
}
function Set-SystemVariable{
[CmdletBinding()]
param(
[string]$SystemVariable,
[string]$Value
)
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name $SystemVariable -Value $Value
return $Value
}
function Test-MachinePath{
[CmdletBinding()]
param(
[string]$PathItem
)
$currentPath = Get-MachinePath
$pathItems = $currentPath.Split(';')
if($pathItems.Contains($PathItem))
{
return $true
}
else
{
return $false
}
}
function Set-MachinePath{
[CmdletBinding()]
param(
[string]$NewPath
)
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name Path -Value $NewPath
return $NewPath
}
function Add-MachinePathItem
{
[CmdletBinding()]
param(
[string]$PathItem
)
$currentPath = Get-MachinePath
$newPath = $PathItem + ';' + $currentPath
return Set-MachinePath -NewPath $newPath
}
function Get-MachinePath{
[CmdletBinding()]
param(
)
$currentPath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path
return $currentPath
}
function Get-SystemVariable{
[CmdletBinding()]
param(
[string]$SystemVariable
)
$currentPath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name $SystemVariable).$SystemVariable
return $currentPath
}
function Set-SystemVariable{
[CmdletBinding()]
param(
[string]$SystemVariable,
[string]$Value
)
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name $SystemVariable -Value $Value
return $Value
}

View File

@@ -1,34 +1,34 @@
. $PSScriptRoot\..\PathHelpers.ps1
Describe 'Test-MachinePath Tests' {
Mock Get-MachinePath {return "C:\foo;C:\bar"}
It 'Path contains item' {
Test-MachinePath -PathItem "C:\foo" | Should Be $true
}
It 'Path does not containe item' {
Test-MachinePath -PathItem "C:\baz" | Should Be $false
}
}
Describe 'Set-MachinePath Tests' {
Mock Get-MachinePath {return "C:\foo;C:\bar"}
Mock Set-ItemProperty {return}
It 'Set-MachinePath should return new path' {
Set-MachinePath -NewPath "C:\baz" | Should Be "C:\baz"
}
}
Describe "Add-MachinePathItem Tests"{
Mock Get-MachinePath {return "C:\foo;C:\bar"}
Mock Set-ItemProperty {return}
It 'Add-MachinePathItem should return complete path' {
Add-MachinePathItem -PathItem 'C:\baz' | Should Be 'C:\baz;C:\foo;C:\bar'
}
}
Describe 'Set-SystemVariable Tests' {
Mock Set-ItemProperty {return}
It 'Set-SystemVariable should return new path' {
Set-SystemVariable -SystemVariable "NewPathVar" -Value "C:\baz" | Should Be "C:\baz"
}
}
. $PSScriptRoot\..\PathHelpers.ps1
Describe 'Test-MachinePath Tests' {
Mock Get-MachinePath {return "C:\foo;C:\bar"}
It 'Path contains item' {
Test-MachinePath -PathItem "C:\foo" | Should Be $true
}
It 'Path does not containe item' {
Test-MachinePath -PathItem "C:\baz" | Should Be $false
}
}
Describe 'Set-MachinePath Tests' {
Mock Get-MachinePath {return "C:\foo;C:\bar"}
Mock Set-ItemProperty {return}
It 'Set-MachinePath should return new path' {
Set-MachinePath -NewPath "C:\baz" | Should Be "C:\baz"
}
}
Describe "Add-MachinePathItem Tests"{
Mock Get-MachinePath {return "C:\foo;C:\bar"}
Mock Set-ItemProperty {return}
It 'Add-MachinePathItem should return complete path' {
Add-MachinePathItem -PathItem 'C:\baz' | Should Be 'C:\baz;C:\foo;C:\bar'
}
}
Describe 'Set-SystemVariable Tests' {
Mock Set-ItemProperty {return}
It 'Set-SystemVariable should return new path' {
Set-SystemVariable -SystemVariable "NewPathVar" -Value "C:\baz" | Should Be "C:\baz"
}
}

View File

@@ -1,51 +1,51 @@
################################################################################
## File: Download-ToolCache.ps1
## Desc: Download tool cache
################################################################################
Function InstallTool
{
Param
(
[System.Object]$ExecutablePath
)
Write-Host $ExecutablePath.DirectoryName
Set-Location -Path $ExecutablePath.DirectoryName
Get-Location | Write-Host
if (Test-Path 'tool.zip')
{
Expand-Archive 'tool.zip' -DestinationPath '.'
}
cmd.exe /c 'install_to_tools_cache.bat'
}
$SourceUrl = "https://vstsagenttools.blob.core.windows.net/tools"
$Dest = "C:/"
$Path = "hostedtoolcache/windows"
$env:Path = "C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy;" + $env:Path
Write-Host "Started AzCopy from $SourceUrl to $Dest"
AzCopy /Source:$SourceUrl /Dest:$Dest /S /V /Pattern:$Path
$ToolsDirectory = $Dest + $Path
$current = Get-Location
Set-Location -Path $ToolsDirectory
Get-ChildItem -Recurse -Depth 4 -Filter install_to_tools_cache.bat | ForEach-Object {
#In order to work correctly Python 3.4 x86 must be installed after x64, this is achieved by current toolcache catalog structure
InstallTool($_)
}
Set-Location -Path $current
setx AGENT_TOOLSDIRECTORY $ToolsDirectory /M
#junction point from the previous Python2 directory to the toolcache Python2
$python2Dir = (Get-Item -Path ($ToolsDirectory + '/Python/2.7*/x64')).FullName
cmd.exe /c mklink /d "C:\Python27amd64" "$python2Dir"
################################################################################
## File: Download-ToolCache.ps1
## Desc: Download tool cache
################################################################################
Function InstallTool
{
Param
(
[System.Object]$ExecutablePath
)
Write-Host $ExecutablePath.DirectoryName
Set-Location -Path $ExecutablePath.DirectoryName
Get-Location | Write-Host
if (Test-Path 'tool.zip')
{
Expand-Archive 'tool.zip' -DestinationPath '.'
}
cmd.exe /c 'install_to_tools_cache.bat'
}
$SourceUrl = "https://vstsagenttools.blob.core.windows.net/tools"
$Dest = "C:/"
$Path = "hostedtoolcache/windows"
$env:Path = "C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy;" + $env:Path
Write-Host "Started AzCopy from $SourceUrl to $Dest"
AzCopy /Source:$SourceUrl /Dest:$Dest /S /V /Pattern:$Path
$ToolsDirectory = $Dest + $Path
$current = Get-Location
Set-Location -Path $ToolsDirectory
Get-ChildItem -Recurse -Depth 4 -Filter install_to_tools_cache.bat | ForEach-Object {
#In order to work correctly Python 3.4 x86 must be installed after x64, this is achieved by current toolcache catalog structure
InstallTool($_)
}
Set-Location -Path $current
setx AGENT_TOOLSDIRECTORY $ToolsDirectory /M
#junction point from the previous Python2 directory to the toolcache Python2
$python2Dir = (Get-Item -Path ($ToolsDirectory + '/Python/2.7*/x64')).FullName
cmd.exe /c mklink /d "C:\Python27amd64" "$python2Dir"

View File

@@ -1,13 +1,13 @@
################################################################################
## File: Enable-DeveloperMode.ps1
## Desc: Enables Developer Mode by toggling registry setting. Developer Mode is required to enable certain tools (e.g. WinAppDriver).
################################################################################
# Create AppModelUnlock if it doesn't exist, required for enabling Developer Mode
$RegistryKeyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
if (-not(Test-Path -Path $RegistryKeyPath)) {
New-Item -Path $RegistryKeyPath -ItemType Directory -Force
}
# Add registry value to enable Developer Mode
New-ItemProperty -Path $RegistryKeyPath -Name AllowDevelopmentWithoutDevLicense -PropertyType DWORD -Value 1
################################################################################
## File: Enable-DeveloperMode.ps1
## Desc: Enables Developer Mode by toggling registry setting. Developer Mode is required to enable certain tools (e.g. WinAppDriver).
################################################################################
# Create AppModelUnlock if it doesn't exist, required for enabling Developer Mode
$RegistryKeyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
if (-not(Test-Path -Path $RegistryKeyPath)) {
New-Item -Path $RegistryKeyPath -ItemType Directory -Force
}
# Add registry value to enable Developer Mode
New-ItemProperty -Path $RegistryKeyPath -Name AllowDevelopmentWithoutDevLicense -PropertyType DWORD -Value 1

View File

@@ -1,34 +1,33 @@
################################################################################
## File: Finalize-VM.ps1
## Desc: Clean up folders temp folders after installs to save space
################################################################################
Write-Host "Cleanup WinSxS"
Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
$ErrorActionPreference = 'silentlycontinue'
Write-Host "Clean up various directories"
@(
"C:\\Recovery",
"$env:windir\\logs",
"$env:windir\\winsxs\\manifestcache",
"$env:windir\\Temp",
"$env:windir\\Installer",
"$env:TEMP"
) | ForEach-Object {
if (Test-Path $_) {
Write-Host "Removing $_"
try {
Takeown /d Y /R /f $_
Icacls $_ /GRANT:r administrators:F /T /c /q 2>&1 | Out-Null
Remove-Item $_ -Recurse -Force | Out-Null
}
catch { $global:error.RemoveAt(0) }
}
}
$winInstallDir = "$env:windir\\Installer"
New-Item -Path $winInstallDir -ItemType Directory -Force
$ErrorActionPreference = 'Continue'
################################################################################
## File: Finalize-VM.ps1
## Desc: Clean up folders temp folders after installs to save space
################################################################################
Write-Host "Cleanup WinSxS"
Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
$ErrorActionPreference = 'silentlycontinue'
Write-Host "Clean up various directories"
@(
"C:\\Recovery",
"$env:windir\\logs",
"$env:windir\\winsxs\\manifestcache",
"$env:windir\\Temp",
"$env:TEMP"
) | ForEach-Object {
if (Test-Path $_) {
Write-Host "Removing $_"
try {
Takeown /d Y /R /f $_
Icacls $_ /GRANT:r administrators:F /T /c /q 2>&1 | Out-Null
Remove-Item $_ -Recurse -Force | Out-Null
}
catch { $global:error.RemoveAt(0) }
}
}
$winInstallDir = "$env:windir\\Installer"
New-Item -Path $winInstallDir -ItemType Directory -Force
$ErrorActionPreference = 'Continue'

View File

@@ -1,6 +1,6 @@
################################################################################
## File: Install-7zip.ps1
## Desc: Install 7zip
################################################################################
choco install 7zip.install -y
################################################################################
## File: Install-7zip.ps1
## Desc: Install 7zip
################################################################################
choco install 7zip.install -y

View File

@@ -1,12 +1,12 @@
################################################################################
## File: Install-AzureCli.ps1
## Desc: Install Azure CLI
################################################################################
choco install azure-cli -y
$AzureCliExtensionPath = Join-Path $Env:CommonProgramFiles 'AzureCliExtensionDirectory'
New-Item -ItemType "directory" -Path $AzureCliExtensionPath
[Environment]::SetEnvironmentVariable("AZURE_EXTENSION_DIR", $AzureCliExtensionPath, [System.EnvironmentVariableTarget]::Machine)
$Env:AZURE_EXTENSION_DIR = $AzureCliExtensionPath
################################################################################
## File: Install-AzureCli.ps1
## Desc: Install Azure CLI
################################################################################
choco install azure-cli -y
$AzureCliExtensionPath = Join-Path $Env:CommonProgramFiles 'AzureCliExtensionDirectory'
New-Item -ItemType "directory" -Path $AzureCliExtensionPath
[Environment]::SetEnvironmentVariable("AZURE_EXTENSION_DIR", $AzureCliExtensionPath, [System.EnvironmentVariableTarget]::Machine)
$Env:AZURE_EXTENSION_DIR = $AzureCliExtensionPath

View File

@@ -1,8 +1,8 @@
####################################################################################
## File: Install-AzureCosmosDbEmulator.ps1
## Desc: Install Azure CosmosDb Emulator
####################################################################################
Import-Module -Name ImageHelpers -Force
Install-MSI -MsiUrl "https://aka.ms/cosmosdb-emulator" -MsiName "AzureCosmosDBEmulator.msi"
####################################################################################
## File: Install-AzureCosmosDbEmulator.ps1
## Desc: Install Azure CosmosDb Emulator
####################################################################################
Import-Module -Name ImageHelpers -Force
Install-MSI -MsiUrl "https://aka.ms/cosmosdb-emulator" -MsiName "AzureCosmosDBEmulator.msi"

View File

@@ -1,6 +1,6 @@
################################################################################
## File: Install-AzureDevOpsCli.ps1
## Desc: Install Azure DevOps CLI
################################################################################
az extension add -n azure-devops
################################################################################
## File: Install-AzureDevOpsCli.ps1
## Desc: Install Azure DevOps CLI
################################################################################
az extension add -n azure-devops

View File

@@ -1,197 +1,197 @@
################################################################################
## File: Install-AzureModules.ps1
## Desc: Install Azure PowerShell modules
################################################################################
Add-Type -AssemblyName System.IO.Compression.FileSystem
function Download-Zip
{
[CmdletBinding()]
Param(
[Parameter(
Mandatory = $true
)]
[string]
$BlobUri
)
Write-Host "Downloading the zip from blob: '$BlobUri'"
$fileName = "azureps_" + "$(Get-Random)" + ".zip"
$targetLocation = Join-Path $ENV:Temp -ChildPath $fileName
Write-Host "Download target location: '$targetLocation'"
$webClient = New-Object Net.WebClient
$null = $webClient.DownloadFileAsync($BlobUri, $targetLocation)
while ($webClient.IsBusy) { }
Write-Host "Download complete. Target Location: '$targetLocation'"
return $targetLocation
}
function Extract-Zip
{
[CmdletBinding()]
Param(
[Parameter(
Mandatory = $true
)]
[string]
$ZipFilePath,
[Parameter(
Mandatory = $true
)]
[string]
$TargetLocation
)
Write-Host "Expanding the Zip File: '$ZipFilePath'. Target: '$TargetLocation'"
$null = [System.IO.Compression.ZipFile]::ExtractToDirectory($ZipFilePath, $TargetLocation)
Write-Host "Extraction completed successfully."
}
Set-PSRepository -InstallationPolicy Trusted -Name PSGallery
# We try to detect the whether Azure PowerShell is installed using .msi file. If it is installed, we find it's version, then it needs to be uninstalled manually (because the uninstallation requires the PowerShell session to be closed)
$regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
$installedApplications = Get-ItemProperty -Path $regKey
$SdkVersion = ($installedApplications | Where-Object { $_.DisplayName -and $_.DisplayName.toLower().Contains("microsoft azure powershell") } | Select-Object -First 1).DisplayVersion
if($SdkVersion -eq $null)
{
Write-Host "No .msi Installation Present"
}
else
{
Write-Host "An Azure PowerShell Installation through installer has been detected. Please close this powershell session and manually uninstall the Azure PowerShell from the Add or Remove Programs in the Control Panel. Then, rerun this script from an Admin PowerShell"
throw "An Azure PowerShell Installation through installer has been detected. Please close this powershell session and manually uninstall the Azure PowerShell from the Add or Remove Programs in the Control Panel. Then, rerun this script from an Admin PowerShell"
}
# We will try to uninstall any installation of Azure PowerShell
$modules = Get-Module -Name Azure -ListAvailable
Write-Host "The Azure Modules initially present are:"
$modules | Select-Object Name,Version,Path | Format-Table
foreach($module in $modules)
{
# add logging for telling what module we are working on now
if(Test-Path -LiteralPath $module.Path)
{
try
{
Uninstall-Module -Name Azure -RequiredVersion $module.Version.tostring() -Force
}
catch
{
Write-Host "The Uninstallation of Azure Module version: $($module.Version.tostring()) failed with the error: $($_.Exception.Message) . Please Check if there isn't any other PowerShell session open."
throw $_.Exception.Message
}
}
}
$modules = Get-Module -Name AzureRM -ListAvailable
Write-Host "The AzureRM Modules initially present are:"
$modules | Select-Object Name,Version,Path | Format-Table
foreach($module in $modules)
{
# add logging for telling what module we are working on now
if(Test-Path -LiteralPath $module.Path)
{
try
{
Uninstall-Module -Name AzureRM -RequiredVersion $module.Version.tostring() -Force
}
catch
{
Write-Host "The Uninstallation of AzureRM Module version: $($module.Version.tostring()) failed with the error: $($_.Exception.Message) . Please Check if there isn't any other PowerShell session open."
throw $_.Exception.Message
}
}
}
#after this, the only installations available through a Get-Module cmdlet should be nothing
$modules = Get-Module -Name Azure -ListAvailable
foreach($module in $modules)
{
Write-Host "Module found: $($module.Name) Module Version: $($module.Version)"
if($module.Version.ToString() -ne " ")
{
Write-Host "Another installation of Azure module is detected with version $($module.Version.ToString()) at path: $($module.Path)"
throw "Azure module uninstallation unsuccessful"
}
}
$modules = Get-Module -Name AzureRM -ListAvailable
foreach($module in $modules)
{
write-host "Module found: $($module.Name) Module Version: $($module.Version)"
if($module.Version.ToString() -ne " ")
{
Write-Host "Another installation of AzureRM module is detected with version $($module.Version.ToString()) at path: $($module.Path)"
throw "AzureRM module uninstallation unsuccessful"
}
}
#### NOW The correct Modules need to be saved in C:\Modules
if($(Test-Path -LiteralPath "C:\Modules") -eq $true)
{
Write-Host "C:\Modules directory is already present. Beginning to clear it up completely"
Remove-Item -Path "C:\Modules" -Recurse -Force
}
mkdir "C:\Modules"
$directoryListing = Get-ChildItem -Path "C:\Modules"
if($directoryListing.Length -gt 0)
{
Write-Host "C:\Modules was not deleted properly. It still has the following contents:"
$directoryListing
}
else {
Write-Host "The Directory is clean. There are no contents present in it"
}
# Download and unzip the stored AzurePSModules from the vstsagentools public blob
$extractLocation = "C:\Modules"
$azurePsUri = @(
"https://vstsagenttools.blob.core.windows.net/tools/azurepowershellmodules/AzurePSModules.M157.20190808.27979.zip",
"https://vstsagenttools.blob.core.windows.net/tools/azurepowershellmodules/AzureRmPSModules.M157.20190808.27379.zip",
"https://vstsagenttools.blob.core.windows.net/tools/azurepowershellmodules/AzPSModules.M163.20191211.17769.zip"
)
$azureRMModulePath = "C:\Modules\azurerm_2.1.0"
$azureModulePath = "C:\Modules\azure_2.1.0"
$finalPath = ""
$environmentPSModulePath = [Environment]::GetEnvironmentVariable("PSModulePath", "Machine")
$existingPaths = $environmentPSModulePath -split ';' -replace '\\$',''
if ($existingPaths -notcontains $azureRMModulePath) {
$finalPath = $azureRMModulePath
}
if ($existingPaths -notcontains $azureModulePath) {
if($finalPath -ne "") {
$finalPath = $finalPath + ";" + $azureModulePath
}
else {
$finalPath = $azureModulePath
}
}
if($finalPath -ne "") {
[Environment]::SetEnvironmentVariable("PSModulePath", $finalPath + ";" + $env:PSModulePath, "Machine")
}
$env:PSModulePath = $env:PSModulePath.TrimStart(';')
foreach ($uri in $azurePsUri)
{
$targetFile = Download-Zip -BlobUri $uri
Extract-Zip -ZipFilePath $targetFile -TargetLocation $extractLocation
}
################################################################################
## File: Install-AzureModules.ps1
## Desc: Install Azure PowerShell modules
################################################################################
Add-Type -AssemblyName System.IO.Compression.FileSystem
function Download-Zip
{
[CmdletBinding()]
Param(
[Parameter(
Mandatory = $true
)]
[string]
$BlobUri
)
Write-Host "Downloading the zip from blob: '$BlobUri'"
$fileName = "azureps_" + "$(Get-Random)" + ".zip"
$targetLocation = Join-Path $ENV:Temp -ChildPath $fileName
Write-Host "Download target location: '$targetLocation'"
$webClient = New-Object Net.WebClient
$null = $webClient.DownloadFileAsync($BlobUri, $targetLocation)
while ($webClient.IsBusy) { }
Write-Host "Download complete. Target Location: '$targetLocation'"
return $targetLocation
}
function Extract-Zip
{
[CmdletBinding()]
Param(
[Parameter(
Mandatory = $true
)]
[string]
$ZipFilePath,
[Parameter(
Mandatory = $true
)]
[string]
$TargetLocation
)
Write-Host "Expanding the Zip File: '$ZipFilePath'. Target: '$TargetLocation'"
$null = [System.IO.Compression.ZipFile]::ExtractToDirectory($ZipFilePath, $TargetLocation)
Write-Host "Extraction completed successfully."
}
Set-PSRepository -InstallationPolicy Trusted -Name PSGallery
# We try to detect the whether Azure PowerShell is installed using .msi file. If it is installed, we find it's version, then it needs to be uninstalled manually (because the uninstallation requires the PowerShell session to be closed)
$regKey = "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
$installedApplications = Get-ItemProperty -Path $regKey
$SdkVersion = ($installedApplications | Where-Object { $_.DisplayName -and $_.DisplayName.toLower().Contains("microsoft azure powershell") } | Select-Object -First 1).DisplayVersion
if($SdkVersion -eq $null)
{
Write-Host "No .msi Installation Present"
}
else
{
Write-Host "An Azure PowerShell Installation through installer has been detected. Please close this powershell session and manually uninstall the Azure PowerShell from the Add or Remove Programs in the Control Panel. Then, rerun this script from an Admin PowerShell"
throw "An Azure PowerShell Installation through installer has been detected. Please close this powershell session and manually uninstall the Azure PowerShell from the Add or Remove Programs in the Control Panel. Then, rerun this script from an Admin PowerShell"
}
# We will try to uninstall any installation of Azure PowerShell
$modules = Get-Module -Name Azure -ListAvailable
Write-Host "The Azure Modules initially present are:"
$modules | Select-Object Name,Version,Path | Format-Table
foreach($module in $modules)
{
# add logging for telling what module we are working on now
if(Test-Path -LiteralPath $module.Path)
{
try
{
Uninstall-Module -Name Azure -RequiredVersion $module.Version.tostring() -Force
}
catch
{
Write-Host "The Uninstallation of Azure Module version: $($module.Version.tostring()) failed with the error: $($_.Exception.Message) . Please Check if there isn't any other PowerShell session open."
throw $_.Exception.Message
}
}
}
$modules = Get-Module -Name AzureRM -ListAvailable
Write-Host "The AzureRM Modules initially present are:"
$modules | Select-Object Name,Version,Path | Format-Table
foreach($module in $modules)
{
# add logging for telling what module we are working on now
if(Test-Path -LiteralPath $module.Path)
{
try
{
Uninstall-Module -Name AzureRM -RequiredVersion $module.Version.tostring() -Force
}
catch
{
Write-Host "The Uninstallation of AzureRM Module version: $($module.Version.tostring()) failed with the error: $($_.Exception.Message) . Please Check if there isn't any other PowerShell session open."
throw $_.Exception.Message
}
}
}
#after this, the only installations available through a Get-Module cmdlet should be nothing
$modules = Get-Module -Name Azure -ListAvailable
foreach($module in $modules)
{
Write-Host "Module found: $($module.Name) Module Version: $($module.Version)"
if($module.Version.ToString() -ne " ")
{
Write-Host "Another installation of Azure module is detected with version $($module.Version.ToString()) at path: $($module.Path)"
throw "Azure module uninstallation unsuccessful"
}
}
$modules = Get-Module -Name AzureRM -ListAvailable
foreach($module in $modules)
{
write-host "Module found: $($module.Name) Module Version: $($module.Version)"
if($module.Version.ToString() -ne " ")
{
Write-Host "Another installation of AzureRM module is detected with version $($module.Version.ToString()) at path: $($module.Path)"
throw "AzureRM module uninstallation unsuccessful"
}
}
#### NOW The correct Modules need to be saved in C:\Modules
if($(Test-Path -LiteralPath "C:\Modules") -eq $true)
{
Write-Host "C:\Modules directory is already present. Beginning to clear it up completely"
Remove-Item -Path "C:\Modules" -Recurse -Force
}
mkdir "C:\Modules"
$directoryListing = Get-ChildItem -Path "C:\Modules"
if($directoryListing.Length -gt 0)
{
Write-Host "C:\Modules was not deleted properly. It still has the following contents:"
$directoryListing
}
else {
Write-Host "The Directory is clean. There are no contents present in it"
}
# Download and unzip the stored AzurePSModules from the vstsagentools public blob
$extractLocation = "C:\Modules"
$azurePsUri = @(
"https://vstsagenttools.blob.core.windows.net/tools/azurepowershellmodules/AzurePSModules.M157.20190808.27979.zip",
"https://vstsagenttools.blob.core.windows.net/tools/azurepowershellmodules/AzureRmPSModules.M157.20190808.27379.zip",
"https://vstsagenttools.blob.core.windows.net/tools/azurepowershellmodules/AzPSModules.M163.20191211.17769.zip"
)
$azureRMModulePath = "C:\Modules\azurerm_2.1.0"
$azureModulePath = "C:\Modules\azure_2.1.0"
$finalPath = ""
$environmentPSModulePath = [Environment]::GetEnvironmentVariable("PSModulePath", "Machine")
$existingPaths = $environmentPSModulePath -split ';' -replace '\\$',''
if ($existingPaths -notcontains $azureRMModulePath) {
$finalPath = $azureRMModulePath
}
if ($existingPaths -notcontains $azureModulePath) {
if($finalPath -ne "") {
$finalPath = $finalPath + ";" + $azureModulePath
}
else {
$finalPath = $azureModulePath
}
}
if($finalPath -ne "") {
[Environment]::SetEnvironmentVariable("PSModulePath", $finalPath + ";" + $env:PSModulePath, "Machine")
}
$env:PSModulePath = $env:PSModulePath.TrimStart(';')
foreach ($uri in $azurePsUri)
{
$targetFile = Download-Zip -BlobUri $uri
Extract-Zip -ZipFilePath $targetFile -TargetLocation $extractLocation
}

View File

@@ -1,45 +1,45 @@
################################################################################
## File: Install-Boost.ps1
## Desc: Install boost using tool cache
################################################################################
$ToolCache = 'C:\hostedtoolcache\windows\boost'
$BoostDirectory = Join-Path -Path $env:ProgramFiles -ChildPath "Boost"
$BoostVersionsToInstall = $env:BOOST_VERSIONS.split(',')
$BoostDefault = $env:BOOST_DEFAULT
foreach($BoostVersion in $BoostVersionsToInstall)
{
$ZipName = Join-Path -Path $ToolCache -ChildPath "boost_${BoostVersion}_msvc-14.1.zip"
if (-Not (Test-Path $ZipName))
{
Write-Host "$ZipName not found"
exit 1
}
Write-Host "Expanding $ZipName"
$BoostInstallationDir = Join-Path -Path $BoostDirectory -ChildPath $BoostVersion
# Expand-Archive slower for 70% than 7z
& "$env:ProgramFiles\7-Zip\7z.exe" x $ZipName -o"$BoostDirectory" -y
$EnvBoostPath = "BOOST_ROOT_{0}" -f ($BoostVersion.Replace('.', '_'))
setx $EnvBoostPath $BoostInstallationDir /M | Out-Null
if ($BoostVersion -eq $BoostDefault)
{
Write-Host "Adding Boost $BoostVersion to the path..."
# Add the Boost binaries to the path
Add-MachinePathItem $BoostInstallationDir | Out-Null
# Set the BOOSTROOT environment variable
setx BOOST_ROOT $BoostInstallationDir /M | Out-Null
}
}
# Removing boost cache folder
Write-Host "Removing boost cache folder"
if (Test-Path $ToolCache)
{
Remove-Item -Path $ToolCache -Force -Recurse
}
################################################################################
## File: Install-Boost.ps1
## Desc: Install boost using tool cache
################################################################################
$ToolCache = 'C:\hostedtoolcache\windows\boost'
$BoostDirectory = Join-Path -Path $env:ProgramFiles -ChildPath "Boost"
$BoostVersionsToInstall = $env:BOOST_VERSIONS.split(',')
$BoostDefault = $env:BOOST_DEFAULT
foreach($BoostVersion in $BoostVersionsToInstall)
{
$ZipName = Join-Path -Path $ToolCache -ChildPath "boost_${BoostVersion}_msvc-14.1.zip"
if (-Not (Test-Path $ZipName))
{
Write-Host "$ZipName not found"
exit 1
}
Write-Host "Expanding $ZipName"
$BoostInstallationDir = Join-Path -Path $BoostDirectory -ChildPath $BoostVersion
# Expand-Archive slower for 70% than 7z
& "$env:ProgramFiles\7-Zip\7z.exe" x $ZipName -o"$BoostDirectory" -y
$EnvBoostPath = "BOOST_ROOT_{0}" -f ($BoostVersion.Replace('.', '_'))
setx $EnvBoostPath $BoostInstallationDir /M | Out-Null
if ($BoostVersion -eq $BoostDefault)
{
Write-Host "Adding Boost $BoostVersion to the path..."
# Add the Boost binaries to the path
Add-MachinePathItem $BoostInstallationDir | Out-Null
# Set the BOOSTROOT environment variable
setx BOOST_ROOT $BoostInstallationDir /M | Out-Null
}
}
# Removing boost cache folder
Write-Host "Removing boost cache folder"
if (Test-Path $ToolCache)
{
Remove-Item -Path $ToolCache -Force -Recurse
}

View File

@@ -1,26 +1,26 @@
################################################################################
## File: Install-Chrome.ps1
## Desc: Install Google Chrome
################################################################################
Import-Module -Name ImageHelpers -Force
$temp_install_dir = 'C:\Windows\Installer'
New-Item -Path $temp_install_dir -ItemType Directory -Force
Install-MSI -MsiUrl "https://seleniumwebdrivers.blob.core.windows.net/knownchromeversion/googlechromestandaloneenterprise64.msi" -MsiName "googlechromestandaloneenterprise64.msi"
New-NetFirewallRule -DisplayName "BlockGoogleUpdate" -Direction Outbound -Action Block -Program "C:\Program Files (x86)\Google\Update\GoogleUpdate.exe"
Stop-Service -Name gupdate -Force
Set-Service -Name gupdate -StartupType "Disabled"
Stop-Service -Name gupdatem -Force
Set-Service -Name gupdatem -StartupType "Disabled"
New-Item -Path "HKLM:\SOFTWARE\Policies\Google\Update" -Force
New-ItemProperty "HKLM:\SOFTWARE\Policies\Google\Update" -Name "AutoUpdateCheckPeriodMinutes" -Value 00000000 -Force
New-ItemProperty "HKLM:\SOFTWARE\Policies\Google\Update" -Name "UpdateDefault" -Value 00000000 -Force
New-ItemProperty "HKLM:\SOFTWARE\Policies\Google\Update" -Name "DisableAutoUpdateChecksCheckboxValue" -Value 00000001 -Force
New-ItemProperty "HKLM:\SOFTWARE\Policies\Google\Update" -Name "Update{8A69D345-D564-463C-AFF1-A69D9E530F96}" -Value 00000000 -Force
New-Item -Path "HKLM:\SOFTWARE\Policies\Google\Chrome" -Force
New-ItemProperty "HKLM:\SOFTWARE\Policies\Google\Chrome" -Name "DefaultBrowserSettingEnabled" -Value 00000000 -Force
################################################################################
## File: Install-Chrome.ps1
## Desc: Install Google Chrome
################################################################################
Import-Module -Name ImageHelpers -Force
$temp_install_dir = 'C:\Windows\Installer'
New-Item -Path $temp_install_dir -ItemType Directory -Force
Install-MSI -MsiUrl "https://seleniumwebdrivers.blob.core.windows.net/knownchromeversion/googlechromestandaloneenterprise64.msi" -MsiName "googlechromestandaloneenterprise64.msi"
New-NetFirewallRule -DisplayName "BlockGoogleUpdate" -Direction Outbound -Action Block -Program "C:\Program Files (x86)\Google\Update\GoogleUpdate.exe"
Stop-Service -Name gupdate -Force
Set-Service -Name gupdate -StartupType "Disabled"
Stop-Service -Name gupdatem -Force
Set-Service -Name gupdatem -StartupType "Disabled"
New-Item -Path "HKLM:\SOFTWARE\Policies\Google\Update" -Force
New-ItemProperty "HKLM:\SOFTWARE\Policies\Google\Update" -Name "AutoUpdateCheckPeriodMinutes" -Value 00000000 -Force
New-ItemProperty "HKLM:\SOFTWARE\Policies\Google\Update" -Name "UpdateDefault" -Value 00000000 -Force
New-ItemProperty "HKLM:\SOFTWARE\Policies\Google\Update" -Name "DisableAutoUpdateChecksCheckboxValue" -Value 00000001 -Force
New-ItemProperty "HKLM:\SOFTWARE\Policies\Google\Update" -Name "Update{8A69D345-D564-463C-AFF1-A69D9E530F96}" -Value 00000000 -Force
New-Item -Path "HKLM:\SOFTWARE\Policies\Google\Chrome" -Force
New-ItemProperty "HKLM:\SOFTWARE\Policies\Google\Chrome" -Name "DefaultBrowserSettingEnabled" -Value 00000000 -Force

View File

@@ -1,24 +1,24 @@
################################################################################
## File: Install-CloudFoundryCli.ps1
## Desc: Install Cloud Foundry CLI
################################################################################
Import-Module -Name ImageHelpers
# Download the latest cf cli exe
Invoke-WebRequest -UseBasicParsing -Uri "https://packages.cloudfoundry.org/stable?release=windows64-exe&source=github" -OutFile cf-cli.zip
# Create directory for cf cli
$cf_cli_path = "C:\cf-cli"
New-Item -Path $cf_cli_path -ItemType Directory -Force
# Extract the zip archive
Write-Host "Extracting cf cli..."
Expand-Archive -Path cf-cli.zip -DestinationPath $cf_cli_path -Force
# Add cf to path
Add-MachinePathItem $cf_cli_path
# Delete the cfl-cli zip archive
Write-Host "Deleting downloaded archive of cf cli"
Remove-Item cf-cli.zip
################################################################################
## File: Install-CloudFoundryCli.ps1
## Desc: Install Cloud Foundry CLI
################################################################################
Import-Module -Name ImageHelpers
# Download the latest cf cli exe
Invoke-WebRequest -UseBasicParsing -Uri "https://packages.cloudfoundry.org/stable?release=windows64-exe&source=github" -OutFile cf-cli.zip
# Create directory for cf cli
$cf_cli_path = "C:\cf-cli"
New-Item -Path $cf_cli_path -ItemType Directory -Force
# Extract the zip archive
Write-Host "Extracting cf cli..."
Expand-Archive -Path cf-cli.zip -DestinationPath $cf_cli_path -Force
# Add cf to path
Add-MachinePathItem $cf_cli_path
# Delete the cfl-cli zip archive
Write-Host "Deleting downloaded archive of cf cli"
Remove-Item cf-cli.zip

View File

@@ -1,6 +1,6 @@
################################################################################
## File: Install-Cmake.ps1
## Desc: Install Cmake
################################################################################
choco install cmake.install -y --installargs 'ADD_CMAKE_TO_PATH=""System""'
################################################################################
## File: Install-Cmake.ps1
## Desc: Install Cmake
################################################################################
choco install cmake.install -y --installargs 'ADD_CMAKE_TO_PATH=""System""'

View File

@@ -1,16 +1,16 @@
################################################################################
## File: Install-ContainersFeature.ps1
## Desc: Install Windows container features.
## Must be an independent step becuase it requires a machine restart
## before we can continue.
################################################################################
Write-Host "Install Containers feature"
Install-WindowsFeature -Name Containers
if ((GWMI Win32_Processor).VirtualizationFirmwareEnabled[0] -and (GWMI Win32_Processor).SecondLevelAddressTranslationExtensions[0]) {
Write-Host "Install Hyper-V feature"
Install-WindowsFeature -Name Hyper-V -IncludeManagementTools
} else {
Write-Host "Skipping installation of Hyper-V feature"
}
################################################################################
## File: Install-ContainersFeature.ps1
## Desc: Install Windows container features.
## Must be an independent step becuase it requires a machine restart
## before we can continue.
################################################################################
Write-Host "Install Containers feature"
Install-WindowsFeature -Name Containers
if ((GWMI Win32_Processor).VirtualizationFirmwareEnabled[0] -and (GWMI Win32_Processor).SecondLevelAddressTranslationExtensions[0]) {
Write-Host "Install Hyper-V feature"
Install-WindowsFeature -Name Hyper-V -IncludeManagementTools
} else {
Write-Host "Skipping installation of Hyper-V feature"
}

View File

@@ -1,10 +1,10 @@
####################################################################################
## File: Install-DACFx.ps1
## Desc: Install SQL Server® Data-Tier Application Framework (DACFx) for Windows
####################################################################################
Import-Module -Name ImageHelpers -Force
$exitcode = Install-MSI -MsiUrl "https://download.microsoft.com/download/f/1/9/f19eaee6-0728-4a0b-9755-9808acc8af0b/EN/x64/DacFramework.msi" -MsiName "DacFramework.msi"
exit $exitcode
####################################################################################
## File: Install-DACFx.ps1
## Desc: Install SQL Server® Data-Tier Application Framework (DACFx) for Windows
####################################################################################
Import-Module -Name ImageHelpers -Force
$exitcode = Install-MSI -MsiUrl "https://download.microsoft.com/download/f/1/9/f19eaee6-0728-4a0b-9755-9808acc8af0b/EN/x64/DacFramework.msi" -MsiName "DacFramework.msi"
exit $exitcode

View File

@@ -1,16 +1,16 @@
################################################################################
## File: Install-Docker.ps1
## Desc: Install Docker.
## Must be an independent step becuase it requires a restart before we
## can continue.
################################################################################
Set-PSRepository -InstallationPolicy Trusted -Name PSGallery
Write-Host "Install-Module DockerProvider"
Install-Module DockerMsftProvider -Force
Write-Host "Install-Package Docker"
Install-Package -Name docker -ProviderName DockerMsftProvider -Force
Start-Service docker
choco install docker-compose -y
################################################################################
## File: Install-Docker.ps1
## Desc: Install Docker.
## Must be an independent step becuase it requires a restart before we
## can continue.
################################################################################
Set-PSRepository -InstallationPolicy Trusted -Name PSGallery
Write-Host "Install-Module DockerProvider"
Install-Module DockerMsftProvider -Force
Write-Host "Install-Package Docker"
Install-Package -Name docker -ProviderName DockerMsftProvider -Force
Start-Service docker
choco install docker-compose -y

View File

@@ -1,113 +1,113 @@
################################################################################
## File: Install-DotnetSDK.ps1
## Desc: Install all released versions of the dotnet sdk and populate package
## cache. Should run after VS and Node
################################################################################
# ensure temp
New-Item -Path C:\Temp -Force -ItemType Directory
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12"
$templates = @(
'console',
'mstest',
'web',
'mvc',
'webapi'
)
function InstallSDKVersion (
$sdkVersion
)
{
if (!(Test-Path -Path "C:\Program Files\dotnet\sdk\$sdkVersion"))
{
Write-Host "Installing dotnet $sdkVersion"
.\dotnet-install.ps1 -Architecture x64 -Version $sdkVersion -InstallDir $(Join-Path -Path $env:ProgramFiles -ChildPath 'dotnet')
}
else
{
Write-Host "Sdk version $sdkVersion already installed"
}
# Fix for issue 1276. This will be fixed in 3.1.
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/dotnet/sdk/82bc30c99f1325dfaa7ad450be96857a4fca2845/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.ImportPublishProfile.targets" -outfile "C:\Program Files\dotnet\sdk\$sdkVersion\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportPublishProfile.targets"
# warm up dotnet for first time experience
$templates | ForEach-Object {
$template = $_
$projectPath = Join-Path -Path C:\temp -ChildPath $template
New-Item -Path $projectPath -Force -ItemType Directory
Push-Location -Path $projectPath
& $env:ProgramFiles\dotnet\dotnet.exe new globaljson --sdk-version "$sdkVersion"
& $env:ProgramFiles\dotnet\dotnet.exe new $template
Pop-Location
Remove-Item $projectPath -Force -Recurse
}
}
function InstallAllValidSdks()
{
Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases-index.json' -UseBasicParsing -OutFile 'releases-index.json'
$dotnetChannels = Get-Content -Path 'releases-index.json' | ConvertFrom-Json
# Consider all channels except preview/eol channels.
# Sort the channels in ascending order
$dotnetChannels = $dotnetChannels.'releases-index' | Where-Object { !$_."support-phase".Equals('preview') -and !$_."support-phase".Equals('eol') } | Sort-Object { [Version] $_."channel-version" }
# Download installation script.
Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -UseBasicParsing -OutFile 'dotnet-install.ps1'
ForEach ($dotnetChannel in $dotnetChannels)
{
$channelVersion = $dotnetChannel.'channel-version';
Invoke-WebRequest -Uri $dotnetChannel.'releases.json' -UseBasicParsing -OutFile "releases-$channelVersion.json"
$currentReleases = Get-Content -Path "releases-$channelVersion.json" | ConvertFrom-Json
# filtering out the preview/rc releases
$currentReleases = $currentReleases.'releases' | Where-Object { !$_.'release-version'.Contains('-') } | Sort-Object { [Version] $_.'release-version' }
ForEach ($release in $currentReleases)
{
if ($release.'sdks'.Count -gt 0)
{
Write-Host 'Found sdks property in release: ' + $release.'release-version' + 'with sdks count: ' + $release.'sdks'.Count
# Remove duplicate entries & preview/rc version from download list
# Sort the sdks on version
$sdks = @($release.'sdk');
$sdks += $release.'sdks' | Where-Object { !$_.'version'.Contains('-') -and !$_.'version'.Equals($release.'sdk'.'version') }
$sdks = $sdks | Sort-Object { [Version] $_.'version' }
ForEach ($sdk in $sdks)
{
InstallSDKVersion -sdkVersion $sdk.'version'
}
}
elseif (!$release.'sdk'.'version'.Contains('-'))
{
$sdkVersion = $release.'sdk'.'version'
InstallSDKVersion -sdkVersion $sdkVersion
}
}
}
}
function RunPostInstallationSteps()
{
Add-MachinePathItem "C:\Program Files\dotnet"
# Run script at startup for all users
$cmdDotNetPath = @"
@echo off
SETX PATH "%USERPROFILE%\.dotnet\tools;%PATH%"
"@
$cmdPath = "C:\Program Files\dotnet\userpath.bat"
$cmdDotNetPath | Out-File -Encoding ascii -FilePath $cmdPath
# Update Run key to run a script at logon
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Run" -Name "DOTNETUSERPATH" -Value $cmdPath
}
InstallAllValidSdks
RunPostInstallationSteps
################################################################################
## File: Install-DotnetSDK.ps1
## Desc: Install all released versions of the dotnet sdk and populate package
## cache. Should run after VS and Node
################################################################################
# ensure temp
New-Item -Path C:\Temp -Force -ItemType Directory
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12"
$templates = @(
'console',
'mstest',
'web',
'mvc',
'webapi'
)
function InstallSDKVersion (
$sdkVersion
)
{
if (!(Test-Path -Path "C:\Program Files\dotnet\sdk\$sdkVersion"))
{
Write-Host "Installing dotnet $sdkVersion"
.\dotnet-install.ps1 -Architecture x64 -Version $sdkVersion -InstallDir $(Join-Path -Path $env:ProgramFiles -ChildPath 'dotnet')
}
else
{
Write-Host "Sdk version $sdkVersion already installed"
}
# Fix for issue 1276. This will be fixed in 3.1.
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/dotnet/sdk/82bc30c99f1325dfaa7ad450be96857a4fca2845/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.ImportPublishProfile.targets" -outfile "C:\Program Files\dotnet\sdk\$sdkVersion\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportPublishProfile.targets"
# warm up dotnet for first time experience
$templates | ForEach-Object {
$template = $_
$projectPath = Join-Path -Path C:\temp -ChildPath $template
New-Item -Path $projectPath -Force -ItemType Directory
Push-Location -Path $projectPath
& $env:ProgramFiles\dotnet\dotnet.exe new globaljson --sdk-version "$sdkVersion"
& $env:ProgramFiles\dotnet\dotnet.exe new $template
Pop-Location
Remove-Item $projectPath -Force -Recurse
}
}
function InstallAllValidSdks()
{
Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases-index.json' -UseBasicParsing -OutFile 'releases-index.json'
$dotnetChannels = Get-Content -Path 'releases-index.json' | ConvertFrom-Json
# Consider all channels except preview/eol channels.
# Sort the channels in ascending order
$dotnetChannels = $dotnetChannels.'releases-index' | Where-Object { !$_."support-phase".Equals('preview') -and !$_."support-phase".Equals('eol') } | Sort-Object { [Version] $_."channel-version" }
# Download installation script.
Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -UseBasicParsing -OutFile 'dotnet-install.ps1'
ForEach ($dotnetChannel in $dotnetChannels)
{
$channelVersion = $dotnetChannel.'channel-version';
Invoke-WebRequest -Uri $dotnetChannel.'releases.json' -UseBasicParsing -OutFile "releases-$channelVersion.json"
$currentReleases = Get-Content -Path "releases-$channelVersion.json" | ConvertFrom-Json
# filtering out the preview/rc releases
$currentReleases = $currentReleases.'releases' | Where-Object { !$_.'release-version'.Contains('-') } | Sort-Object { [Version] $_.'release-version' }
ForEach ($release in $currentReleases)
{
if ($release.'sdks'.Count -gt 0)
{
Write-Host 'Found sdks property in release: ' + $release.'release-version' + 'with sdks count: ' + $release.'sdks'.Count
# Remove duplicate entries & preview/rc version from download list
# Sort the sdks on version
$sdks = @($release.'sdk');
$sdks += $release.'sdks' | Where-Object { !$_.'version'.Contains('-') -and !$_.'version'.Equals($release.'sdk'.'version') }
$sdks = $sdks | Sort-Object { [Version] $_.'version' }
ForEach ($sdk in $sdks)
{
InstallSDKVersion -sdkVersion $sdk.'version'
}
}
elseif (!$release.'sdk'.'version'.Contains('-'))
{
$sdkVersion = $release.'sdk'.'version'
InstallSDKVersion -sdkVersion $sdkVersion
}
}
}
}
function RunPostInstallationSteps()
{
Add-MachinePathItem "C:\Program Files\dotnet"
# Run script at startup for all users
$cmdDotNetPath = @"
@echo off
SETX PATH "%USERPROFILE%\.dotnet\tools;%PATH%"
"@
$cmdPath = "C:\Program Files\dotnet\userpath.bat"
$cmdDotNetPath | Out-File -Encoding ascii -FilePath $cmdPath
# Update Run key to run a script at logon
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Run" -Name "DOTNETUSERPATH" -Value $cmdPath
}
InstallAllValidSdks
RunPostInstallationSteps

View File

@@ -1,20 +1,20 @@
################################################################################
## File: Install-Firefox.ps1
## Desc: Install Mozilla Firefox
################################################################################
Import-Module -Name ImageHelpers -Force
$temp_install_dir = 'C:\Windows\Installer'
New-Item -Path $temp_install_dir -ItemType Directory -Force
Install-EXE -Url "https://seleniumwebdrivers.blob.core.windows.net/knownfirefoxversion/FirefoxSetup.exe" -Name "FirefoxSetup.exe" -ArgumentList "-ms"
$path = '{0}\Program Files\Mozilla Firefox\' -f $env:SystemDrive;
New-Item -path $path -Name 'mozilla.cfg' -Value '//
pref("browser.shell.checkDefaultBrowser", false);
pref("app.update.enabled", false);' -ItemType file -force
$path = '{0}\Program Files\Mozilla Firefox\defaults\pref\' -f $env:SystemDrive;
New-Item -path $path -Name 'local-settings.js' -Value 'pref("general.config.obscure_value", 0);
pref("general.config.filename", "mozilla.cfg");' -ItemType file -force
################################################################################
## File: Install-Firefox.ps1
## Desc: Install Mozilla Firefox
################################################################################
Import-Module -Name ImageHelpers -Force
$temp_install_dir = 'C:\Windows\Installer'
New-Item -Path $temp_install_dir -ItemType Directory -Force
Install-EXE -Url "https://seleniumwebdrivers.blob.core.windows.net/knownfirefoxversion/FirefoxSetup.exe" -Name "FirefoxSetup.exe" -ArgumentList "-ms"
$path = '{0}\Program Files\Mozilla Firefox\' -f $env:SystemDrive;
New-Item -path $path -Name 'mozilla.cfg' -Value '//
pref("browser.shell.checkDefaultBrowser", false);
pref("app.update.enabled", false);' -ItemType file -force
$path = '{0}\Program Files\Mozilla Firefox\defaults\pref\' -f $env:SystemDrive;
New-Item -path $path -Name 'local-settings.js' -Value 'pref("general.config.obscure_value", 0);
pref("general.config.filename", "mozilla.cfg");' -ItemType file -force

View File

@@ -1,18 +1,18 @@
################################################################################
## File: Install-Git.ps1
## Desc: Install Git for Windows
################################################################################
Import-Module -Name ImageHelpers
# Install the latest version of Git which is bundled with Git LFS.
# See https://chocolatey.org/packages/git
choco install git -y --package-parameters="/GitAndUnixToolsOnPath /WindowsTerminal /NoShellIntegration"
# Disable GCM machine-wide
[Environment]::SetEnvironmentVariable("GCM_INTERACTIVE", "Never", [System.EnvironmentVariableTarget]::Machine)
Add-MachinePathItem "C:\Program Files\Git\mingw64\bin"
Add-MachinePathItem "C:\Program Files\Git\usr\bin"
Add-MachinePathItem "C:\Program Files\Git\bin"
exit 0
################################################################################
## File: Install-Git.ps1
## Desc: Install Git for Windows
################################################################################
Import-Module -Name ImageHelpers
# Install the latest version of Git which is bundled with Git LFS.
# See https://chocolatey.org/packages/git
choco install git -y --package-parameters="/GitAndUnixToolsOnPath /WindowsTerminal /NoShellIntegration"
# Disable GCM machine-wide
[Environment]::SetEnvironmentVariable("GCM_INTERACTIVE", "Never", [System.EnvironmentVariableTarget]::Machine)
Add-MachinePathItem "C:\Program Files\Git\mingw64\bin"
Add-MachinePathItem "C:\Program Files\Git\usr\bin"
Add-MachinePathItem "C:\Program Files\Git\bin"
exit 0

View File

@@ -1,6 +1,6 @@
################################################################################
## File: Install-GitVersion.ps1
## Desc: Install GitVersion
################################################################################
choco install gitversion.portable -y
################################################################################
## File: Install-GitVersion.ps1
## Desc: Install GitVersion
################################################################################
choco install gitversion.portable -y

View File

@@ -1,71 +1,71 @@
################################################################################
## File: Install-Go.ps1
## Desc: Install Go
################################################################################
Import-Module -Name ImageHelpers -Force
function Install-GoVersion
{
Param
(
[String]$goVersion,
[Switch]$addToDefaultPath
)
# Download the Go zip archive.
Write-Host "Downloading Go $goVersion..."
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -UseBasicParsing -Uri "https://dl.google.com/go/go$goVersion.windows-amd64.zip" -OutFile go$goVersion.windows-amd64.zip
# Extract the zip archive. It contains a single directory named "go".
Write-Host "Extracting Go $goVersion..."
Expand-Archive -Path go$goVersion.windows-amd64.zip -DestinationPath "C:\" -Force
# Delete unnecessary files to conserve space
Write-Host "Cleaning directories of Go $goVersion..."
if (Test-Path "C:\go\doc")
{
Remove-Item -Recurse -Force "C:\go\doc"
}
if (Test-Path "C:\go\blog")
{
Remove-Item -Recurse -Force "C:\go\blog"
}
# Rename the extracted "go" directory to include the Go version number (to support side-by-side versions of Go).
$newDirName = "Go$goVersion"
Rename-Item -path "C:\go" -newName $newDirName
# Delete the Go zip archive.
Write-Host "Deleting downloaded archive of Go $goVersion..."
Remove-Item go$goVersion.windows-a`md64.zip
# Make this the default version of Go?
if ($addToDefaultPath)
{
Write-Host "Adding Go $goVersion to the path..."
# Add the Go binaries to the path.
Add-MachinePathItem "C:\$newDirName\bin" | Out-Null
# Set the GOROOT environment variable.
setx GOROOT "C:\$newDirName" /M | Out-Null
}
# Done
Write-Host "Done installing Go $goVersion."
return "C:\$newDirName"
}
# Install Go
$goVersionsToInstall = $env:GO_VERSIONS.split(",")
foreach($go in $goVersionsToInstall) {
Write-Host "Installing Go ${go}"
if($go -eq $env:GO_DEFAULT) {
$installDirectory = Install-GoVersion -goVersion $go -addToDefaultPath
} else {
$installDirectory = Install-GoVersion -goVersion $go
}
$envName = "GOROOT_{0}_{1}_X64" -f $go.split(".")
setx $envName "$installDirectory" /M
}
################################################################################
## File: Install-Go.ps1
## Desc: Install Go
################################################################################
Import-Module -Name ImageHelpers -Force
function Install-GoVersion
{
Param
(
[String]$goVersion,
[Switch]$addToDefaultPath
)
# Download the Go zip archive.
Write-Host "Downloading Go $goVersion..."
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -UseBasicParsing -Uri "https://dl.google.com/go/go$goVersion.windows-amd64.zip" -OutFile go$goVersion.windows-amd64.zip
# Extract the zip archive. It contains a single directory named "go".
Write-Host "Extracting Go $goVersion..."
Expand-Archive -Path go$goVersion.windows-amd64.zip -DestinationPath "C:\" -Force
# Delete unnecessary files to conserve space
Write-Host "Cleaning directories of Go $goVersion..."
if (Test-Path "C:\go\doc")
{
Remove-Item -Recurse -Force "C:\go\doc"
}
if (Test-Path "C:\go\blog")
{
Remove-Item -Recurse -Force "C:\go\blog"
}
# Rename the extracted "go" directory to include the Go version number (to support side-by-side versions of Go).
$newDirName = "Go$goVersion"
Rename-Item -path "C:\go" -newName $newDirName
# Delete the Go zip archive.
Write-Host "Deleting downloaded archive of Go $goVersion..."
Remove-Item go$goVersion.windows-a`md64.zip
# Make this the default version of Go?
if ($addToDefaultPath)
{
Write-Host "Adding Go $goVersion to the path..."
# Add the Go binaries to the path.
Add-MachinePathItem "C:\$newDirName\bin" | Out-Null
# Set the GOROOT environment variable.
setx GOROOT "C:\$newDirName" /M | Out-Null
}
# Done
Write-Host "Done installing Go $goVersion."
return "C:\$newDirName"
}
# Install Go
$goVersionsToInstall = $env:GO_VERSIONS.split(",")
foreach($go in $goVersionsToInstall) {
Write-Host "Installing Go ${go}"
if($go -eq $env:GO_DEFAULT) {
$installDirectory = Install-GoVersion -goVersion $go -addToDefaultPath
} else {
$installDirectory = Install-GoVersion -goVersion $go
}
$envName = "GOROOT_{0}_{1}_X64" -f $go.split(".")
setx $envName "$installDirectory" /M
}

View File

@@ -1,6 +1,6 @@
################################################################################
## File: Install-InnoSetup.ps1
## Desc: Install Inno Setup
################################################################################
choco install innosetup -y
################################################################################
## File: Install-InnoSetup.ps1
## Desc: Install Inno Setup
################################################################################
choco install innosetup -y

View File

@@ -1,98 +1,98 @@
################################################################################
## File: Install-JavaTools.ps1
## Desc: Install various JDKs and java tools
################################################################################
# Download the Azul Systems Zulu JDKs
# See https://www.azul.com/downloads/azure-only/zulu/
$azulJDK7Uri = 'https://repos.azul.com/azure-only/zulu/packages/zulu-7/7u232/zulu-7-azure-jdk_7.31.0.5-7.0.232-win_x64.zip'
$azulJDK8Uri = 'https://repos.azul.com/azure-only/zulu/packages/zulu-8/8u222/zulu-8-azure-jdk_8.40.0.25-8.0.222-win_x64.zip'
$azulJDK11Uri = 'https://repos.azul.com/azure-only/zulu/packages/zulu-11/11.0.4/zulu-11-azure-jdk_11.33.15-11.0.4-win_x64.zip'
cd $env:TEMP
Invoke-WebRequest -UseBasicParsing -Uri $azulJDK7Uri -OutFile azulJDK7.zip
Invoke-WebRequest -UseBasicParsing -Uri $azulJDK8Uri -OutFile azulJDK8.zip
Invoke-WebRequest -UseBasicParsing -Uri $azulJDK11Uri -OutFile azulJDK11.zip
# Expand the zips
Expand-Archive -Path azulJDK7.zip -DestinationPath "C:\Program Files\Java\" -Force
Expand-Archive -Path azulJDK8.zip -DestinationPath "C:\Program Files\Java\" -Force
Expand-Archive -Path azulJDK11.zip -DestinationPath "C:\Program Files\Java\" -Force
# Deleting zip folders
Remove-Item -Recurse -Force azulJDK7.zip
Remove-Item -Recurse -Force azulJDK8.zip
Remove-Item -Recurse -Force azulJDK11.zip
Import-Module -Name ImageHelpers -Force
$currentPath = Get-MachinePath
$pathSegments = $currentPath.Split(';')
$newPathSegments = @()
foreach ($pathSegment in $pathSegments)
{
if($pathSegment -notlike '*java*')
{
$newPathSegments += $pathSegment
}
}
$java7Installs = Get-ChildItem -Path 'C:\Program Files\Java' -Filter '*azure-jdk*7*' | Sort-Object -Property Name -Descending | Select-Object -First 1
$latestJava7Install = $java7Installs.FullName;
$java8Installs = Get-ChildItem -Path 'C:\Program Files\Java' -Filter '*azure-jdk*8*' | Sort-Object -Property Name -Descending | Select-Object -First 1
$latestJava8Install = $java8Installs.FullName;
$java11Installs = Get-ChildItem -Path 'C:\Program Files\Java' -Filter '*azure-jdk*11*' | Sort-Object -Property Name -Descending | Select-Object -First 1
$latestJava11Install = $java11Installs.FullName;
$newPath = [string]::Join(';', $newPathSegments)
$newPath = $latestJava8Install + '\bin;' + $newPath
Set-MachinePath -NewPath $newPath
setx JAVA_HOME $latestJava8Install /M
setx JAVA_HOME_7_X64 $latestJava7Install /M
setx JAVA_HOME_8_X64 $latestJava8Install /M
setx JAVA_HOME_11_X64 $latestJava11Install /M
# Install Java tools
# Force chocolatey to ignore dependencies on Ant and Maven or else they will download the Oracle JDK
choco install ant -y -i
choco install maven -y -i --version=3.6.2
choco install gradle -y
# Move maven variables to Machine. They may not be in the environment for this script so we need to read them from the registry.
$userSid = (Get-WmiObject win32_useraccount -Filter "name = '$env:USERNAME' AND domain = '$env:USERDOMAIN'").SID
$userEnvironmentKey = 'Registry::HKEY_USERS\' + $userSid + '\Environment'
$m2_home = (Get-ItemProperty -Path $userEnvironmentKey -Name M2_HOME).M2_HOME
$m2 = $m2_home + '\bin'
$maven_opts = '-Xms256m'
$m2_repo = 'C:\ProgramData\m2'
New-Item -Path $m2_repo -ItemType Directory -Force
setx M2 $m2 /M
setx M2_HOME $m2_home /M
setx M2_REPO $m2_repo /M
setx MAVEN_OPTS $maven_opts /M
# Download cobertura jars
$uri = 'https://ayera.dl.sourceforge.net/project/cobertura/cobertura/2.1.1/cobertura-2.1.1-bin.zip'
$coberturaPath = "C:\cobertura-2.1.1"
cd $env:TEMP
Invoke-WebRequest -UseBasicParsing -Uri $uri -OutFile cobertura.zip
# Expand the zip
Expand-Archive -Path cobertura.zip -DestinationPath "C:\" -Force
# Deleting zip folder
Remove-Item -Recurse -Force cobertura.zip
setx COBERTURA_HOME $coberturaPath /M
################################################################################
## File: Install-JavaTools.ps1
## Desc: Install various JDKs and java tools
################################################################################
# Download the Azul Systems Zulu JDKs
# See https://www.azul.com/downloads/azure-only/zulu/
$azulJDK7Uri = 'https://repos.azul.com/azure-only/zulu/packages/zulu-7/7u232/zulu-7-azure-jdk_7.31.0.5-7.0.232-win_x64.zip'
$azulJDK8Uri = 'https://repos.azul.com/azure-only/zulu/packages/zulu-8/8u222/zulu-8-azure-jdk_8.40.0.25-8.0.222-win_x64.zip'
$azulJDK11Uri = 'https://repos.azul.com/azure-only/zulu/packages/zulu-11/11.0.4/zulu-11-azure-jdk_11.33.15-11.0.4-win_x64.zip'
cd $env:TEMP
Invoke-WebRequest -UseBasicParsing -Uri $azulJDK7Uri -OutFile azulJDK7.zip
Invoke-WebRequest -UseBasicParsing -Uri $azulJDK8Uri -OutFile azulJDK8.zip
Invoke-WebRequest -UseBasicParsing -Uri $azulJDK11Uri -OutFile azulJDK11.zip
# Expand the zips
Expand-Archive -Path azulJDK7.zip -DestinationPath "C:\Program Files\Java\" -Force
Expand-Archive -Path azulJDK8.zip -DestinationPath "C:\Program Files\Java\" -Force
Expand-Archive -Path azulJDK11.zip -DestinationPath "C:\Program Files\Java\" -Force
# Deleting zip folders
Remove-Item -Recurse -Force azulJDK7.zip
Remove-Item -Recurse -Force azulJDK8.zip
Remove-Item -Recurse -Force azulJDK11.zip
Import-Module -Name ImageHelpers -Force
$currentPath = Get-MachinePath
$pathSegments = $currentPath.Split(';')
$newPathSegments = @()
foreach ($pathSegment in $pathSegments)
{
if($pathSegment -notlike '*java*')
{
$newPathSegments += $pathSegment
}
}
$java7Installs = Get-ChildItem -Path 'C:\Program Files\Java' -Filter '*azure-jdk*7*' | Sort-Object -Property Name -Descending | Select-Object -First 1
$latestJava7Install = $java7Installs.FullName;
$java8Installs = Get-ChildItem -Path 'C:\Program Files\Java' -Filter '*azure-jdk*8*' | Sort-Object -Property Name -Descending | Select-Object -First 1
$latestJava8Install = $java8Installs.FullName;
$java11Installs = Get-ChildItem -Path 'C:\Program Files\Java' -Filter '*azure-jdk*11*' | Sort-Object -Property Name -Descending | Select-Object -First 1
$latestJava11Install = $java11Installs.FullName;
$newPath = [string]::Join(';', $newPathSegments)
$newPath = $latestJava8Install + '\bin;' + $newPath
Set-MachinePath -NewPath $newPath
setx JAVA_HOME $latestJava8Install /M
setx JAVA_HOME_7_X64 $latestJava7Install /M
setx JAVA_HOME_8_X64 $latestJava8Install /M
setx JAVA_HOME_11_X64 $latestJava11Install /M
# Install Java tools
# Force chocolatey to ignore dependencies on Ant and Maven or else they will download the Oracle JDK
choco install ant -y -i
choco install maven -y -i --version=3.6.2
choco install gradle -y
# Move maven variables to Machine. They may not be in the environment for this script so we need to read them from the registry.
$userSid = (Get-WmiObject win32_useraccount -Filter "name = '$env:USERNAME' AND domain = '$env:USERDOMAIN'").SID
$userEnvironmentKey = 'Registry::HKEY_USERS\' + $userSid + '\Environment'
$m2_home = (Get-ItemProperty -Path $userEnvironmentKey -Name M2_HOME).M2_HOME
$m2 = $m2_home + '\bin'
$maven_opts = '-Xms256m'
$m2_repo = 'C:\ProgramData\m2'
New-Item -Path $m2_repo -ItemType Directory -Force
setx M2 $m2 /M
setx M2_HOME $m2_home /M
setx M2_REPO $m2_repo /M
setx MAVEN_OPTS $maven_opts /M
# Download cobertura jars
$uri = 'https://ayera.dl.sourceforge.net/project/cobertura/cobertura/2.1.1/cobertura-2.1.1-bin.zip'
$coberturaPath = "C:\cobertura-2.1.1"
cd $env:TEMP
Invoke-WebRequest -UseBasicParsing -Uri $uri -OutFile cobertura.zip
# Expand the zip
Expand-Archive -Path cobertura.zip -DestinationPath "C:\" -Force
# Deleting zip folder
Remove-Item -Recurse -Force cobertura.zip
setx COBERTURA_HOME $coberturaPath /M

View File

@@ -1,6 +1,6 @@
################################################################################
## File: Install-Jq.ps1
## Desc: Install jq
################################################################################
choco install jq -y
################################################################################
## File: Install-Jq.ps1
## Desc: Install jq
################################################################################
choco install jq -y

View File

@@ -1,40 +1,40 @@
################################################################################
## File: Install-Kind.ps1
## Desc: Install Kind
################################################################################
$stableKindTag = "v0.5.1"
$tagToUse = $stableKindTag;
$destFilePath = "C:\ProgramData\kind"
$outFilePath = "C:\ProgramData\kind\kind.exe"
try
{
$getkindUri = "https://github.com/kubernetes-sigs/kind/releases/download/$tagToUse/kind-windows-amd64"
Write-Host "Downloading kind.exe..."
New-Item -Path $destFilePath -ItemType Directory -Force
Invoke-WebRequest -Uri $getkindUri -OutFile $outFilePath
Write-Host "Starting Install kind.exe..."
$process = Start-Process -FilePath $outFilePath -Wait -PassThru
$exitCode = $process.ExitCode
if ($exitCode -eq 0 -or $exitCode -eq 3010)
{
Write-Host -Object 'Installation successful'
Add-MachinePathItem $destFilePath
exit $exitCode
}
else
{
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
exit $exitCode
}
}
catch
{
Write-Host -Object "Failed to install the Executable kind.exe"
Write-Host -Object $_.Exception.Message
exit -1
}
################################################################################
## File: Install-Kind.ps1
## Desc: Install Kind
################################################################################
$stableKindTag = "v0.5.1"
$tagToUse = $stableKindTag;
$destFilePath = "C:\ProgramData\kind"
$outFilePath = "C:\ProgramData\kind\kind.exe"
try
{
$getkindUri = "https://github.com/kubernetes-sigs/kind/releases/download/$tagToUse/kind-windows-amd64"
Write-Host "Downloading kind.exe..."
New-Item -Path $destFilePath -ItemType Directory -Force
Invoke-WebRequest -Uri $getkindUri -OutFile $outFilePath
Write-Host "Starting Install kind.exe..."
$process = Start-Process -FilePath $outFilePath -Wait -PassThru
$exitCode = $process.ExitCode
if ($exitCode -eq 0 -or $exitCode -eq 3010)
{
Write-Host -Object 'Installation successful'
Add-MachinePathItem $destFilePath
exit $exitCode
}
else
{
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
exit $exitCode
}
}
catch
{
Write-Host -Object "Failed to install the Executable kind.exe"
Write-Host -Object $_.Exception.Message
exit -1
}

View File

@@ -1,6 +1,6 @@
################################################################################
## File: Install-KubernetesCli.ps1
## Desc: Install KubernetesCli
################################################################################
choco install kubernetes-cli -y
################################################################################
## File: Install-KubernetesCli.ps1
## Desc: Install KubernetesCli
################################################################################
choco install kubernetes-cli -y

View File

@@ -1,10 +1,10 @@
################################################################################
## File: Install-Mercurial.ps1
## Desc: Install Mercurial
################################################################################
choco install hg -y --version 5.0.0
$hgPath = "${env:ProgramFiles}\Mercurial\"
Add-MachinePathItem $hgPath
$env:Path = Get-MachinePath
################################################################################
## File: Install-Mercurial.ps1
## Desc: Install Mercurial
################################################################################
choco install hg -y --version 5.0.0
$hgPath = "${env:ProgramFiles}\Mercurial\"
Add-MachinePathItem $hgPath
$env:Path = Get-MachinePath

View File

@@ -1,13 +1,13 @@
################################################################################
## File: Install-MinGW.ps1
## Desc: Install GNU tools for Windows to C:\tools\mingw64
################################################################################
Import-Module -Name ImageHelpers -Force
choco install -y mingw
# Make a copy of mingw32-make.exe to make.exe, which is a more discoverable name
# and so the same command line can be used on Windows as on macOS and Linux
$path = where.exe mingw32-make.exe | Get-Item
Copy-Item -Path $path -Destination (Join-Path $path.Directory 'make.exe')
################################################################################
## File: Install-MinGW.ps1
## Desc: Install GNU tools for Windows to C:\tools\mingw64
################################################################################
Import-Module -Name ImageHelpers -Force
choco install -y mingw
# Make a copy of mingw32-make.exe to make.exe, which is a more discoverable name
# and so the same command line can be used on Windows as on macOS and Linux
$path = where.exe mingw32-make.exe | Get-Item
Copy-Item -Path $path -Destination (Join-Path $path.Directory 'make.exe')

View File

@@ -1,16 +1,16 @@
################################################################################
## File: Install-Miniconda.ps1
## Desc: Install the latest version of Miniconda and set $env:CONDA
################################################################################
Import-Module -Name ImageHelpers -Force
# Lock to Miniconda 4.6 until we do the work to run `conda init` for the vsts user
# Then we can go back to installing the latest Miniconda
# $url = "https://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe"
$url = "https://repo.continuum.io/miniconda/Miniconda3-4.6.14-Windows-x86_64.exe"
$name = $Url.Split('/')[-1]
$destination = "C:\Miniconda"
Install-EXE -Url $url -Name $name -ArgumentList "/S /AddToPath=0 /RegisterPython=0 /D=$destination"
Set-SystemVariable -SystemVariable "CONDA" -Value $destination
################################################################################
## File: Install-Miniconda.ps1
## Desc: Install the latest version of Miniconda and set $env:CONDA
################################################################################
Import-Module -Name ImageHelpers -Force
# Lock to Miniconda 4.6 until we do the work to run `conda init` for the vsts user
# Then we can go back to installing the latest Miniconda
# $url = "https://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe"
$url = "https://repo.continuum.io/miniconda/Miniconda3-4.6.14-Windows-x86_64.exe"
$name = $Url.Split('/')[-1]
$destination = "C:\Miniconda"
Install-EXE -Url $url -Name $name -ArgumentList "/S /AddToPath=0 /RegisterPython=0 /D=$destination"
Set-SystemVariable -SystemVariable "CONDA" -Value $destination

View File

@@ -1,39 +1,39 @@
################################################################################
## File: Install-MysqlCli.ps1
## Desc: Install Mysql CLI
################################################################################
## Downloading mysql jar
$uri = 'https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.21-winx64.zip'
$mysqlPath = 'C:\mysql-5.7.21-winx64\bin'
# Installing visual c++ redistibutable package.
$InstallerURI = 'https://download.microsoft.com/download/0/5/6/056dcda9-d667-4e27-8001-8a0c6971d6b1/vcredist_x64.exe'
$InstallerName = 'vcredist_x64.exe'
$ArgumentList = ('/install', '/quiet', '/norestart' )
$exitCode = Install-EXE -Url $InstallerURI -Name $InstallerName -ArgumentList $ArgumentList
if ($exitCode -eq 0 -or $exitCode -eq 3010)
{
# MySQL disabled TLS 1.0 support on or about Jul-14-2018. Need to make sure TLS 1.2 is enabled.
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12"
# Get the latest mysql command line tools .
Invoke-WebRequest -UseBasicParsing -Uri $uri -OutFile mysql.zip
# Expand the zip
Expand-Archive -Path mysql.zip -DestinationPath "C:\" -Force
# Deleting zip folder
Remove-Item -Recurse -Force mysql.zip
# Adding mysql in system environment path
Add-MachinePathItem $mysqlPath
return 0;
}
else
{
return $exitCode;
}
################################################################################
## File: Install-MysqlCli.ps1
## Desc: Install Mysql CLI
################################################################################
## Downloading mysql jar
$uri = 'https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.21-winx64.zip'
$mysqlPath = 'C:\mysql-5.7.21-winx64\bin'
# Installing visual c++ redistibutable package.
$InstallerURI = 'https://download.microsoft.com/download/0/5/6/056dcda9-d667-4e27-8001-8a0c6971d6b1/vcredist_x64.exe'
$InstallerName = 'vcredist_x64.exe'
$ArgumentList = ('/install', '/quiet', '/norestart' )
$exitCode = Install-EXE -Url $InstallerURI -Name $InstallerName -ArgumentList $ArgumentList
if ($exitCode -eq 0 -or $exitCode -eq 3010)
{
# MySQL disabled TLS 1.0 support on or about Jul-14-2018. Need to make sure TLS 1.2 is enabled.
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor "Tls12"
# Get the latest mysql command line tools .
Invoke-WebRequest -UseBasicParsing -Uri $uri -OutFile mysql.zip
# Expand the zip
Expand-Archive -Path mysql.zip -DestinationPath "C:\" -Force
# Deleting zip folder
Remove-Item -Recurse -Force mysql.zip
# Adding mysql in system environment path
Add-MachinePathItem $mysqlPath
return 0;
}
else
{
return $exitCode;
}

Some files were not shown because too many files have changed in this diff Show More