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 { Function CreateAzureVMFromPackerTemplate {
<# <#
.SYNOPSIS .SYNOPSIS
Creates an Azure VM from a template. Also generates network resources in Azure to make the VM accessible. Creates an Azure VM from a template. Also generates network resources in Azure to make the VM accessible.
.DESCRIPTION .DESCRIPTION
Creates Azure resources and kicks off a packer image generation for the selected image type. Creates Azure resources and kicks off a packer image generation for the selected image type.
.PARAMETER SubscriptionId .PARAMETER SubscriptionId
The Azure subscription Id where resources will be created. The Azure subscription Id where resources will be created.
.PARAMETER ResourceGroupName .PARAMETER ResourceGroupName
The Azure resource group name where the Azure virtual machine will be created. The Azure resource group name where the Azure virtual machine will be created.
.PARAMETER TemplatFilePath .PARAMETER TemplatFilePath
The path for the json template generated by packer during image generation locally. The path for the json template generated by packer during image generation locally.
.PARAMETER VirtualMachineName .PARAMETER VirtualMachineName
The name of the virtual machine to be generated. The name of the virtual machine to be generated.
.PARAMETER AdminUserName .PARAMETER AdminUserName
The administrator username for the virtual machine to be created. The administrator username for the virtual machine to be created.
.PARAMETER AdminPassword .PARAMETER AdminPassword
The administrator password for the virtual machine to be created. The administrator password for the virtual machine to be created.
.PARAMETER AzureLocation .PARAMETER AzureLocation
The location where the Azure virtual machine will be provisioned. Example: "eastus" The location where the Azure virtual machine will be provisioned. Example: "eastus"
.EXAMPLE .EXAMPLE
CreateAzureVMFromPackerTemplate -SubscriptionId {YourSubscriptionId} -ResourceGroupName {ResourceGroupName} -TemplateFile "C:\BuildVmImages\temporaryTemplate.json" -VirtualMachineName "testvm1" -AdminUsername "shady1" -AdminPassword "SomeSecurePassword1" -AzureLocation "eastus" CreateAzureVMFromPackerTemplate -SubscriptionId {YourSubscriptionId} -ResourceGroupName {ResourceGroupName} -TemplateFile "C:\BuildVmImages\temporaryTemplate.json" -VirtualMachineName "testvm1" -AdminUsername "shady1" -AdminPassword "SomeSecurePassword1" -AzureLocation "eastus"
#> #>
param ( param (
[Parameter(Mandatory = $True)] [Parameter(Mandatory = $True)]
[string] $SubscriptionId, [string] $SubscriptionId,
[Parameter(Mandatory = $True)] [Parameter(Mandatory = $True)]
[string] $ResourceGroupName, [string] $ResourceGroupName,
[Parameter(Mandatory = $True)] [Parameter(Mandatory = $True)]
[string] $TemplateFilePath, [string] $TemplateFilePath,
[Parameter(Mandatory = $True)] [Parameter(Mandatory = $True)]
[string] $VirtualMachineName, [string] $VirtualMachineName,
[Parameter(Mandatory = $True)] [Parameter(Mandatory = $True)]
[string] $AdminUsername, [string] $AdminUsername,
[Parameter(Mandatory = $True)] [Parameter(Mandatory = $True)]
[string] $AdminPassword, [string] $AdminPassword,
[Parameter(Mandatory = $True)] [Parameter(Mandatory = $True)]
[string] $AzureLocation [string] $AzureLocation
) )
$vmSize = "Standard_DS2_v2" $vmSize = "Standard_DS2_v2"
$vnetName = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper() $vnetName = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper()
$subnetName = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper() $subnetName = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper()
$nicName = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper() $nicName = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper()
$publicIpName = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper() $publicIpName = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper()
Write-Host "Creating a Vnet and a Subnet" 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 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 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)." Write-Host "Creating a network interface card (NIC)."
$nic = az network nic create -g $ResourceGroupName --vnet-name $vnetName --subnet $subnetName -n $nicName --subscription $subscriptionId $nic = az network nic create -g $ResourceGroupName --vnet-name $vnetName --subnet $subnetName -n $nicName --subscription $subscriptionId
$networkId = ($nic | ConvertFrom-Json).NewNIC.id $networkId = ($nic | ConvertFrom-Json).NewNIC.id
Write-Host "create public IP." 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 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." 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 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" 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 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' $ErrorActionPreference = 'Stop'
enum ImageType { enum ImageType {
Windows2016 = 0 Windows2016 = 0
Windows2019 = 1 Windows2019 = 1
Ubuntu1604 = 2 Ubuntu1604 = 2
Ubuntu1804 = 3 Ubuntu1804 = 3
} }
Function Get-PackerTemplatePath { Function Get-PackerTemplatePath {
param ( param (
[Parameter(Mandatory = $True)] [Parameter(Mandatory = $True)]
[string] $RepositoryRoot, [string] $RepositoryRoot,
[Parameter(Mandatory = $True)] [Parameter(Mandatory = $True)]
[ImageType] $ImageType [ImageType] $ImageType
) )
$relativePath = "N/A" $relativePath = "N/A"
switch ($ImageType) { switch ($ImageType) {
([ImageType]::Windows2016) { ([ImageType]::Windows2016) {
$relativePath = "\images\win\Windows2016-Azure.json" $relativePath = "\images\win\Windows2016-Azure.json"
} }
([ImageType]::Windows2019) { ([ImageType]::Windows2019) {
$relativePath = "\images\win\Windows2019-Azure.json" $relativePath = "\images\win\Windows2019-Azure.json"
} }
([ImageType]::Ubuntu1604) { ([ImageType]::Ubuntu1604) {
$relativePath = "\images\linux\ubuntu1604.json" $relativePath = "\images\linux\ubuntu1604.json"
} }
([ImageType]::Ubuntu1804) { ([ImageType]::Ubuntu1804) {
$relativePath = "\images\linux\ubuntu1804.json" $relativePath = "\images\linux\ubuntu1804.json"
} }
} }
return $RepositoryRoot + $relativePath; return $RepositoryRoot + $relativePath;
} }
Function GenerateResourcesAndImage { Function GenerateResourcesAndImage {
<# <#
.SYNOPSIS .SYNOPSIS
A helper function to help generate an image. A helper function to help generate an image.
.DESCRIPTION .DESCRIPTION
Creates Azure resources and kicks off a packer image generation for the selected image type. Creates Azure resources and kicks off a packer image generation for the selected image type.
.PARAMETER SubscriptionId .PARAMETER SubscriptionId
The Azure subscription Id where resources will be created. The Azure subscription Id where resources will be created.
.PARAMETER ResourceGroupName .PARAMETER ResourceGroupName
The Azure resource group name where the Azure resources will be created. The Azure resource group name where the Azure resources will be created.
.PARAMETER ImageGenerationRepositoryRoot .PARAMETER ImageGenerationRepositoryRoot
The root path of the image generation repository source. The root path of the image generation repository source.
.PARAMETER ImageType .PARAMETER ImageType
The type of the image being generated. Valid options are: {"Windows2016", "Windows2019", "Ubuntu1604", "Ubuntu1804"}. The type of the image being generated. Valid options are: {"Windows2016", "Windows2019", "Ubuntu1604", "Ubuntu1804"}.
.PARAMETER AzureLocation .PARAMETER AzureLocation
The location of the resources being created in Azure. For example "East US". The location of the resources being created in Azure. For example "East US".
.PARAMETER Force .PARAMETER Force
Delete the resource group if it exists without user confirmation. Delete the resource group if it exists without user confirmation.
.EXAMPLE .EXAMPLE
GenerateResourcesAndImage -SubscriptionId {YourSubscriptionId} -ResourceGroupName "shsamytest1" -ImageGenerationRepositoryRoot "C:\azure-pipelines-image-generation" -ImageType Ubuntu1604 -AzureLocation "East US" GenerateResourcesAndImage -SubscriptionId {YourSubscriptionId} -ResourceGroupName "shsamytest1" -ImageGenerationRepositoryRoot "C:\azure-pipelines-image-generation" -ImageType Ubuntu1604 -AzureLocation "East US"
#> #>
param ( param (
[Parameter(Mandatory = $True)] [Parameter(Mandatory = $True)]
[string] $SubscriptionId, [string] $SubscriptionId,
[Parameter(Mandatory = $True)] [Parameter(Mandatory = $True)]
[string] $ResourceGroupName, [string] $ResourceGroupName,
[Parameter(Mandatory = $True)] [Parameter(Mandatory = $True)]
[string] $ImageGenerationRepositoryRoot, [string] $ImageGenerationRepositoryRoot,
[Parameter(Mandatory = $True)] [Parameter(Mandatory = $True)]
[ImageType] $ImageType, [ImageType] $ImageType,
[Parameter(Mandatory = $True)] [Parameter(Mandatory = $True)]
[string] $AzureLocation, [string] $AzureLocation,
[Parameter(Mandatory = $False)] [Parameter(Mandatory = $False)]
[int] $SecondsToWaitForServicePrincipalSetup = 30, [int] $SecondsToWaitForServicePrincipalSetup = 30,
[Parameter(Mandatory = $False)] [Parameter(Mandatory = $False)]
[Switch] $Force [Switch] $Force
) )
$builderScriptPath = Get-PackerTemplatePath -RepositoryRoot $ImageGenerationRepositoryRoot -ImageType $ImageType $builderScriptPath = Get-PackerTemplatePath -RepositoryRoot $ImageGenerationRepositoryRoot -ImageType $ImageType
$ServicePrincipalClientSecret = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper(); $ServicePrincipalClientSecret = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper();
$InstallPassword = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper(); $InstallPassword = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper();
Login-AzureRmAccount Login-AzureRmAccount
Set-AzureRmContext -SubscriptionId $SubscriptionId Set-AzureRmContext -SubscriptionId $SubscriptionId
$alreadyExists = $true; $alreadyExists = $true;
try { try {
Get-AzureRmResourceGroup -Name $ResourceGroupName Get-AzureRmResourceGroup -Name $ResourceGroupName
Write-Verbose "Resource group was found, will delete and recreate it." Write-Verbose "Resource group was found, will delete and recreate it."
} }
catch { catch {
Write-Verbose "Resource group was not found, will create it." Write-Verbose "Resource group was not found, will create it."
$alreadyExists = $false; $alreadyExists = $false;
} }
if ($alreadyExists) { if ($alreadyExists) {
if($Force -eq $true) { if($Force -eq $true) {
# Cleanup the resource group if it already exitsted before # Cleanup the resource group if it already exitsted before
Remove-AzureRmResourceGroup -Name $ResourceGroupName -Force Remove-AzureRmResourceGroup -Name $ResourceGroupName -Force
New-AzureRmResourceGroup -Name $ResourceGroupName -Location $AzureLocation New-AzureRmResourceGroup -Name $ResourceGroupName -Location $AzureLocation
} else { } else {
$title = "Delete Resource Group" $title = "Delete Resource Group"
$message = "The resource group you specified already exists. Do you want to clean it up?" $message = "The resource group you specified already exists. Do you want to clean it up?"
$yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", ` $yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", `
"Delete the resource group including all resources." "Delete the resource group including all resources."
$no = New-Object System.Management.Automation.Host.ChoiceDescription "&No", ` $no = New-Object System.Management.Automation.Host.ChoiceDescription "&No", `
"Keep the resource group and continue." "Keep the resource group and continue."
$stop = New-Object System.Management.Automation.Host.ChoiceDescription "&Stop", ` $stop = New-Object System.Management.Automation.Host.ChoiceDescription "&Stop", `
"Stop the current action." "Stop the current action."
$options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no, $stop) $options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no, $stop)
$result = $host.ui.PromptForChoice($title, $message, $options, 0) $result = $host.ui.PromptForChoice($title, $message, $options, 0)
switch ($result) switch ($result)
{ {
0 { Remove-AzureRmResourceGroup -Name $ResourceGroupName -Force; New-AzureRmResourceGroup -Name $ResourceGroupName -Location $AzureLocation } 0 { Remove-AzureRmResourceGroup -Name $ResourceGroupName -Force; New-AzureRmResourceGroup -Name $ResourceGroupName -Location $AzureLocation }
1 { <# Do nothing #> } 1 { <# Do nothing #> }
2 { exit } 2 { exit }
} }
} }
} else { } else {
New-AzureRmResourceGroup -Name $ResourceGroupName -Location $AzureLocation New-AzureRmResourceGroup -Name $ResourceGroupName -Location $AzureLocation
} }
# This script should follow the recommended naming conventions for azure resources # This script should follow the recommended naming conventions for azure resources
$storageAccountName = if($ResourceGroupName.EndsWith("-rg")) { $storageAccountName = if($ResourceGroupName.EndsWith("-rg")) {
$ResourceGroupName.Substring(0, $ResourceGroupName.Length -3) $ResourceGroupName.Substring(0, $ResourceGroupName.Length -3)
} else { $ResourceGroupName } } else { $ResourceGroupName }
# Resource group names may contain special characters, that are not allowed in the storage account name # Resource group names may contain special characters, that are not allowed in the storage account name
$storageAccountName = $storageAccountName.Replace("-", "").Replace("_", "").Replace("(", "").Replace(")", "").ToLower() $storageAccountName = $storageAccountName.Replace("-", "").Replace("_", "").Replace("(", "").Replace(")", "").ToLower()
$storageAccountName += "001" $storageAccountName += "001"
New-AzureRmStorageAccount -ResourceGroupName $ResourceGroupName -AccountName $storageAccountName -Location $AzureLocation -SkuName "Standard_LRS" New-AzureRmStorageAccount -ResourceGroupName $ResourceGroupName -AccountName $storageAccountName -Location $AzureLocation -SkuName "Standard_LRS"
$spDisplayName = [System.GUID]::NewGuid().ToString().ToUpper() $spDisplayName = [System.GUID]::NewGuid().ToString().ToUpper()
$sp = New-AzureRmADServicePrincipal -DisplayName $spDisplayName -Password (ConvertTo-SecureString $ServicePrincipalClientSecret -AsPlainText -Force) $sp = New-AzureRmADServicePrincipal -DisplayName $spDisplayName -Password (ConvertTo-SecureString $ServicePrincipalClientSecret -AsPlainText -Force)
$spAppId = $sp.ApplicationId $spAppId = $sp.ApplicationId
$spClientId = $sp.ApplicationId $spClientId = $sp.ApplicationId
$spObjectId = $sp.Id $spObjectId = $sp.Id
Start-Sleep -Seconds $SecondsToWaitForServicePrincipalSetup Start-Sleep -Seconds $SecondsToWaitForServicePrincipalSetup
New-AzureRmRoleAssignment -RoleDefinitionName Contributor -ServicePrincipalName $spAppId New-AzureRmRoleAssignment -RoleDefinitionName Contributor -ServicePrincipalName $spAppId
Start-Sleep -Seconds $SecondsToWaitForServicePrincipalSetup Start-Sleep -Seconds $SecondsToWaitForServicePrincipalSetup
$sub = Get-AzureRmSubscription -SubscriptionId $SubscriptionId $sub = Get-AzureRmSubscription -SubscriptionId $SubscriptionId
$tenantId = $sub.TenantId $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`"", "" # "", "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 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 #!/bin/bash
################################################################################
## File: containercache.sh
## Desc: Prepulls Docker images used in build tasks and templates
################################################################################
source $HELPER_SCRIPTS/apt.sh source $HELPER_SCRIPTS/apt.sh
source $HELPER_SCRIPTS/document.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.3.2)"
DocumentInstalledItem "Az Module (2.6.0)" DocumentInstalledItem "Az Module (2.6.0)"
DocumentInstalledItem "Az Module (2.8.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 "unzip"
DocumentInstalledItemIndent "wget" DocumentInstalledItemIndent "wget"
DocumentInstalledItemIndent "zip" DocumentInstalledItemIndent "zip"
DocumentInstalledItemIndent "tzdata" DocumentInstalledItemIndent "tzdata"

View File

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

View File

@@ -27,13 +27,13 @@ for setup in $setups; do
cd $original_directory; cd $original_directory;
done; 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) pythons=$(ls $AGENT_TOOLSDIRECTORY/Python)
for python in $pythons; do for python in $pythons; do
DocumentInstalledItemIndent "Python $python" DocumentInstalledItemIndent "Python $python"
done; 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) rubys=$(ls $AGENT_TOOLSDIRECTORY/Ruby)
for ruby in $rubys; do for ruby in $rubys; do
DocumentInstalledItemIndent "Ruby $ruby" DocumentInstalledItemIndent "Ruby $ruby"

View File

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

View File

@@ -1,25 +1,25 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: mercurial.sh ## File: mercurial.sh
## Desc: Installs Mercurial ## Desc: Installs Mercurial
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh source $HELPER_SCRIPTS/apt.sh
# Install Mercurial from the mercurial-ppa/releases repository for the latest version. # Install Mercurial from the mercurial-ppa/releases repository for the latest version.
# https://www.mercurial-scm.org/wiki/Download # https://www.mercurial-scm.org/wiki/Download
add-apt-repository ppa:mercurial-ppa/releases -y add-apt-repository ppa:mercurial-ppa/releases -y
apt-get update apt-get update
apt-get install -y --no-install-recommends mercurial apt-get install -y --no-install-recommends mercurial
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v hg; then if ! command -v hg; then
exit 1 exit 1
fi fi
# Document what was added to the image # Document what was added to the image
echo "Lastly, documenting what we added to the metadata file" echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Mercurial ($(hg --version | head -n 1))" DocumentInstalledItem "Mercurial ($(hg --version | head -n 1))"

View File

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

View File

@@ -1,28 +1,28 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: powershellcore.sh ## File: powershellcore.sh
## Desc: Installs powershellcore ## Desc: Installs powershellcore
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
LSB_RELEASE=$(lsb_release -rs) LSB_RELEASE=$(lsb_release -rs)
# Install Powershell # Install Powershell
apt-get install -y powershell apt-get install -y powershell
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v pwsh; then if ! command -v pwsh; then
echo "pwsh was not installed" echo "pwsh was not installed"
exit 1 exit 1
fi fi
if ! pwsh -c 'Write-Host Hello world'; then if ! pwsh -c 'Write-Host Hello world'; then
echo "pwsh failed to run" echo "pwsh failed to run"
exit 1 exit 1
fi fi
# Document what was added to the image # Document what was added to the image
echo "Lastly, documenting what we added to the metadata file" echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Powershell ($(pwsh --version))" DocumentInstalledItem "Powershell ($(pwsh --version))"

View File

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

View File

@@ -1,133 +1,133 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: android.sh ## File: android.sh
## Desc: Installs Android SDK ## Desc: Installs Android SDK
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh source $HELPER_SCRIPTS/apt.sh
# Set env variable for SDK Root (https://developer.android.com/studio/command-line/variables) # Set env variable for SDK Root (https://developer.android.com/studio/command-line/variables)
ANDROID_ROOT=/usr/local/lib/android ANDROID_ROOT=/usr/local/lib/android
ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk
echo "ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT}" | tee -a /etc/environment echo "ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT}" | tee -a /etc/environment
# ANDROID_HOME is deprecated, but older versions of Gradle rely on it # ANDROID_HOME is deprecated, but older versions of Gradle rely on it
echo "ANDROID_HOME=${ANDROID_SDK_ROOT}" | tee -a /etc/environment 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. # Download the latest command line tools so that we can accept all of the licenses.
# See https://developer.android.com/studio/#command-tools # See https://developer.android.com/studio/#command-tools
wget -O android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip wget -O android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip android-sdk.zip -d ${ANDROID_ROOT} unzip android-sdk.zip -d ${ANDROID_ROOT}
rm -f android-sdk.zip rm -f android-sdk.zip
# Install the following SDKs and build tools, passing in "y" to accept licenses. # 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} \ echo "y" | ${ANDROID_ROOT}/tools/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} \
"ndk-bundle" \ "ndk-bundle" \
"platform-tools" \ "platform-tools" \
"platforms;android-29" \ "platforms;android-29" \
"platforms;android-28" \ "platforms;android-28" \
"platforms;android-27" \ "platforms;android-27" \
"platforms;android-26" \ "platforms;android-26" \
"platforms;android-25" \ "platforms;android-25" \
"platforms;android-24" \ "platforms;android-24" \
"platforms;android-23" \ "platforms;android-23" \
"platforms;android-22" \ "platforms;android-22" \
"platforms;android-21" \ "platforms;android-21" \
"platforms;android-19" \ "platforms;android-19" \
"platforms;android-17" \ "platforms;android-17" \
"build-tools;29.0.2" \ "build-tools;29.0.2" \
"build-tools;29.0.0" \ "build-tools;29.0.0" \
"build-tools;28.0.3" \ "build-tools;28.0.3" \
"build-tools;28.0.2" \ "build-tools;28.0.2" \
"build-tools;28.0.1" \ "build-tools;28.0.1" \
"build-tools;28.0.0" \ "build-tools;28.0.0" \
"build-tools;27.0.3" \ "build-tools;27.0.3" \
"build-tools;27.0.2" \ "build-tools;27.0.2" \
"build-tools;27.0.1" \ "build-tools;27.0.1" \
"build-tools;27.0.0" \ "build-tools;27.0.0" \
"build-tools;26.0.3" \ "build-tools;26.0.3" \
"build-tools;26.0.2" \ "build-tools;26.0.2" \
"build-tools;26.0.1" \ "build-tools;26.0.1" \
"build-tools;26.0.0" \ "build-tools;26.0.0" \
"build-tools;25.0.3" \ "build-tools;25.0.3" \
"build-tools;25.0.2" \ "build-tools;25.0.2" \
"build-tools;25.0.1" \ "build-tools;25.0.1" \
"build-tools;25.0.0" \ "build-tools;25.0.0" \
"build-tools;24.0.3" \ "build-tools;24.0.3" \
"build-tools;24.0.2" \ "build-tools;24.0.2" \
"build-tools;24.0.1" \ "build-tools;24.0.1" \
"build-tools;24.0.0" \ "build-tools;24.0.0" \
"build-tools;23.0.3" \ "build-tools;23.0.3" \
"build-tools;23.0.2" \ "build-tools;23.0.2" \
"build-tools;23.0.1" \ "build-tools;23.0.1" \
"build-tools;22.0.1" \ "build-tools;22.0.1" \
"build-tools;21.1.2" \ "build-tools;21.1.2" \
"build-tools;20.0.0" \ "build-tools;20.0.0" \
"build-tools;19.1.0" \ "build-tools;19.1.0" \
"build-tools;17.0.0" \ "build-tools;17.0.0" \
"extras;android;m2repository" \ "extras;android;m2repository" \
"extras;google;m2repository" \ "extras;google;m2repository" \
"extras;google;google_play_services" \ "extras;google;google_play_services" \
"add-ons;addon-google_apis-google-24" \ "add-ons;addon-google_apis-google-24" \
"add-ons;addon-google_apis-google-23" \ "add-ons;addon-google_apis-google-23" \
"add-ons;addon-google_apis-google-22" \ "add-ons;addon-google_apis-google-22" \
"add-ons;addon-google_apis-google-21" \ "add-ons;addon-google_apis-google-21" \
"cmake;3.6.4111459" \ "cmake;3.6.4111459" \
"patcher;v4" "patcher;v4"
# Document what was added to the image # Document what was added to the image
echo "Lastly, document what was added to the metadata file" 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 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 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 24"
DocumentInstalledItem "Google APIs 23" DocumentInstalledItem "Google APIs 23"
DocumentInstalledItem "Google APIs 22" DocumentInstalledItem "Google APIs 22"
DocumentInstalledItem "Google APIs 21" DocumentInstalledItem "Google APIs 21"
DocumentInstalledItem "CMake $(ls ${ANDROID_SDK_ROOT}/cmake 2>&1)" DocumentInstalledItem "CMake $(ls ${ANDROID_SDK_ROOT}/cmake 2>&1)"
DocumentInstalledItem "Android Support Repository 47.0.0" 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-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 29"
DocumentInstalledItem "Android SDK Platform 28" DocumentInstalledItem "Android SDK Platform 28"
DocumentInstalledItem "Android SDK Platform 27" DocumentInstalledItem "Android SDK Platform 27"
DocumentInstalledItem "Android SDK Platform 26" DocumentInstalledItem "Android SDK Platform 26"
DocumentInstalledItem "Android SDK Platform 25" DocumentInstalledItem "Android SDK Platform 25"
DocumentInstalledItem "Android SDK Platform 24" DocumentInstalledItem "Android SDK Platform 24"
DocumentInstalledItem "Android SDK Platform 23" DocumentInstalledItem "Android SDK Platform 23"
DocumentInstalledItem "Android SDK Platform 22" DocumentInstalledItem "Android SDK Platform 22"
DocumentInstalledItem "Android SDK Platform 21" DocumentInstalledItem "Android SDK Platform 21"
DocumentInstalledItem "Android SDK Platform 19" DocumentInstalledItem "Android SDK Platform 19"
DocumentInstalledItem "Android SDK Platform 17" DocumentInstalledItem "Android SDK Platform 17"
DocumentInstalledItem "Android SDK Patch Applier v4" DocumentInstalledItem "Android SDK Patch Applier v4"
DocumentInstalledItem "Android SDK Build-Tools 29.0.2" DocumentInstalledItem "Android SDK Build-Tools 29.0.2"
DocumentInstalledItem "Android SDK Build-Tools 29.0.0" DocumentInstalledItem "Android SDK Build-Tools 29.0.0"
DocumentInstalledItem "Android SDK Build-Tools 28.0.3" DocumentInstalledItem "Android SDK Build-Tools 28.0.3"
DocumentInstalledItem "Android SDK Build-Tools 28.0.2" DocumentInstalledItem "Android SDK Build-Tools 28.0.2"
DocumentInstalledItem "Android SDK Build-Tools 28.0.1" DocumentInstalledItem "Android SDK Build-Tools 28.0.1"
DocumentInstalledItem "Android SDK Build-Tools 28.0.0" DocumentInstalledItem "Android SDK Build-Tools 28.0.0"
DocumentInstalledItem "Android SDK Build-Tools 27.0.3" DocumentInstalledItem "Android SDK Build-Tools 27.0.3"
DocumentInstalledItem "Android SDK Build-Tools 27.0.2" DocumentInstalledItem "Android SDK Build-Tools 27.0.2"
DocumentInstalledItem "Android SDK Build-Tools 27.0.1" DocumentInstalledItem "Android SDK Build-Tools 27.0.1"
DocumentInstalledItem "Android SDK Build-Tools 27.0.0" DocumentInstalledItem "Android SDK Build-Tools 27.0.0"
DocumentInstalledItem "Android SDK Build-Tools 26.0.3" DocumentInstalledItem "Android SDK Build-Tools 26.0.3"
DocumentInstalledItem "Android SDK Build-Tools 26.0.2" DocumentInstalledItem "Android SDK Build-Tools 26.0.2"
DocumentInstalledItem "Android SDK Build-Tools 26.0.1" DocumentInstalledItem "Android SDK Build-Tools 26.0.1"
DocumentInstalledItem "Android SDK Build-Tools 26.0.0" DocumentInstalledItem "Android SDK Build-Tools 26.0.0"
DocumentInstalledItem "Android SDK Build-Tools 25.0.3" DocumentInstalledItem "Android SDK Build-Tools 25.0.3"
DocumentInstalledItem "Android SDK Build-Tools 25.0.2" DocumentInstalledItem "Android SDK Build-Tools 25.0.2"
DocumentInstalledItem "Android SDK Build-Tools 25.0.1" DocumentInstalledItem "Android SDK Build-Tools 25.0.1"
DocumentInstalledItem "Android SDK Build-Tools 25.0.0" DocumentInstalledItem "Android SDK Build-Tools 25.0.0"
DocumentInstalledItem "Android SDK Build-Tools 24.0.3" DocumentInstalledItem "Android SDK Build-Tools 24.0.3"
DocumentInstalledItem "Android SDK Build-Tools 24.0.2" DocumentInstalledItem "Android SDK Build-Tools 24.0.2"
DocumentInstalledItem "Android SDK Build-Tools 24.0.1" DocumentInstalledItem "Android SDK Build-Tools 24.0.1"
DocumentInstalledItem "Android SDK Build-Tools 24.0.0" DocumentInstalledItem "Android SDK Build-Tools 24.0.0"
DocumentInstalledItem "Android SDK Build-Tools 23.0.3" DocumentInstalledItem "Android SDK Build-Tools 23.0.3"
DocumentInstalledItem "Android SDK Build-Tools 23.0.2" DocumentInstalledItem "Android SDK Build-Tools 23.0.2"
DocumentInstalledItem "Android SDK Build-Tools 23.0.1" DocumentInstalledItem "Android SDK Build-Tools 23.0.1"
DocumentInstalledItem "Android SDK Build-Tools 22.0.1" DocumentInstalledItem "Android SDK Build-Tools 22.0.1"
DocumentInstalledItem "Android SDK Build-Tools 21.1.2" DocumentInstalledItem "Android SDK Build-Tools 21.1.2"
DocumentInstalledItem "Android SDK Build-Tools 20.0.0" DocumentInstalledItem "Android SDK Build-Tools 20.0.0"
DocumentInstalledItem "Android SDK Build-Tools 19.1.0" DocumentInstalledItem "Android SDK Build-Tools 19.1.0"
DocumentInstalledItem "Android SDK Build-Tools 17.0.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)" 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.3.2)"
DocumentInstalledItem "Az Module (2.6.0)" DocumentInstalledItem "Az Module (2.6.0)"
DocumentInstalledItem "Az Module (2.8.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 #!/bin/bash
################################################################################ ################################################################################
## File: basic.sh ## File: basic.sh
## Desc: Installs basic command line utilities and dev packages ## Desc: Installs basic command line utilities and dev packages
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh source $HELPER_SCRIPTS/apt.sh
set -e set -e
echo "Install curl" echo "Install curl"
apt-get install -y --no-install-recommends curl apt-get install -y --no-install-recommends curl
echo "Install dnsutils" echo "Install dnsutils"
apt-get install -y --no-install-recommends dnsutils apt-get install -y --no-install-recommends dnsutils
echo "Install file" echo "Install file"
apt-get install -y --no-install-recommends file apt-get install -y --no-install-recommends file
echo "Install ftp" echo "Install ftp"
apt-get install -y --no-install-recommends ftp apt-get install -y --no-install-recommends ftp
echo "Install iproute2" echo "Install iproute2"
apt-get install -y --no-install-recommends iproute2 apt-get install -y --no-install-recommends iproute2
echo "Install iputils-ping" echo "Install iputils-ping"
apt-get install -y --no-install-recommends iputils-ping apt-get install -y --no-install-recommends iputils-ping
echo "Install jq" echo "Install jq"
apt-get install -y --no-install-recommends jq apt-get install -y --no-install-recommends jq
echo "Install libcurl3" echo "Install libcurl3"
apt-get install -y --no-install-recommends libcurl3 apt-get install -y --no-install-recommends libcurl3
echo "Install libunwind8" echo "Install libunwind8"
apt-get install -y --no-install-recommends libunwind8 apt-get install -y --no-install-recommends libunwind8
echo "Install locales" echo "Install locales"
apt-get install -y --no-install-recommends locales apt-get install -y --no-install-recommends locales
echo "Install netcat" echo "Install netcat"
apt-get install -y --no-install-recommends netcat apt-get install -y --no-install-recommends netcat
echo "Install openssh-client" echo "Install openssh-client"
apt-get install -y --no-install-recommends openssh-client apt-get install -y --no-install-recommends openssh-client
echo "Install rsync" echo "Install rsync"
apt-get install -y --no-install-recommends rsync apt-get install -y --no-install-recommends rsync
echo "Install shellcheck" echo "Install shellcheck"
apt-get install -y --no-install-recommends shellcheck apt-get install -y --no-install-recommends shellcheck
echo "Install sudo" echo "Install sudo"
apt-get install -y --no-install-recommends sudo apt-get install -y --no-install-recommends sudo
echo "Install telnet" echo "Install telnet"
apt-get install -y --no-install-recommends telnet apt-get install -y --no-install-recommends telnet
echo "Install time" echo "Install time"
apt-get install -y --no-install-recommends time apt-get install -y --no-install-recommends time
echo "Install unzip" echo "Install unzip"
apt-get install -y --no-install-recommends unzip apt-get install -y --no-install-recommends unzip
echo "Install wget" echo "Install wget"
apt-get install -y --no-install-recommends wget apt-get install -y --no-install-recommends wget
echo "Install zip" echo "Install zip"
apt-get install -y --no-install-recommends zip apt-get install -y --no-install-recommends zip
echo "Install tzdata" echo "Install tzdata"
apt-get install -y --no-install-recommends tzdata apt-get install -y --no-install-recommends tzdata
echo "Install libxkbfile" echo "Install libxkbfile"
apt-get install -y --no-install-recommends libxkbfile-dev apt-get install -y --no-install-recommends libxkbfile-dev
echo "Install pkg-config" echo "Install pkg-config"
apt-get install -y --no-install-recommends pkg-config apt-get install -y --no-install-recommends pkg-config
echo "Install libsecret-1-dev" echo "Install libsecret-1-dev"
apt-get install -y --no-install-recommends libsecret-1-dev apt-get install -y --no-install-recommends libsecret-1-dev
echo "Install libxss1" echo "Install libxss1"
apt-get install -y --no-install-recommends libxss1 apt-get install -y --no-install-recommends libxss1
echo "Install libgconf-2-4" echo "Install libgconf-2-4"
apt-get install -y --no-install-recommends libgconf-2-4 apt-get install -y --no-install-recommends libgconf-2-4
echo "Install dbus" echo "Install dbus"
apt-get install -y --no-install-recommends dbus apt-get install -y --no-install-recommends dbus
echo "Install xvfb" echo "Install xvfb"
apt-get install -y --no-install-recommends xvfb apt-get install -y --no-install-recommends xvfb
echo "Install libgtk" echo "Install libgtk"
apt-get install -y --no-install-recommends libgtk-3-0 apt-get install -y --no-install-recommends libgtk-3-0
echo "Install fakeroot" echo "Install fakeroot"
apt-get install -y --no-install-recommends fakeroot apt-get install -y --no-install-recommends fakeroot
echo "Install dpkg" echo "Install dpkg"
apt-get install -y --no-install-recommends dpkg apt-get install -y --no-install-recommends dpkg
echo "Install rpm" echo "Install rpm"
apt-get install -y --no-install-recommends rpm apt-get install -y --no-install-recommends rpm
echo "Install xz-utils" echo "Install xz-utils"
apt-get install -y --no-install-recommends xz-utils apt-get install -y --no-install-recommends xz-utils
echo "Install xorriso" echo "Install xorriso"
apt-get install -y --no-install-recommends xorriso apt-get install -y --no-install-recommends xorriso
echo "Install zsync" echo "Install zsync"
apt-get install -y --no-install-recommends zsync apt-get install -y --no-install-recommends zsync
echo "Install curl" echo "Install curl"
apt-get install -y --no-install-recommends curl apt-get install -y --no-install-recommends curl
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" 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 for cmd in curl file ftp jq netcat ssh rsync shellcheck sudo telnet time unzip wget zip; do
if ! command -v $cmd; then if ! command -v $cmd; then
echo "$cmd was not installed" echo "$cmd was not installed"
exit 1 exit 1
fi fi
done done
# Document what was added to the image # Document what was added to the image
echo "Lastly, documenting what we added to the metadata file" echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Basic CLI:" DocumentInstalledItem "Basic CLI:"
DocumentInstalledItemIndent "curl" DocumentInstalledItemIndent "curl"
DocumentInstalledItemIndent "dnsutils" DocumentInstalledItemIndent "dnsutils"
DocumentInstalledItemIndent "file" DocumentInstalledItemIndent "file"
DocumentInstalledItemIndent "ftp" DocumentInstalledItemIndent "ftp"
DocumentInstalledItemIndent "iproute2" DocumentInstalledItemIndent "iproute2"
DocumentInstalledItemIndent "iputils-ping" DocumentInstalledItemIndent "iputils-ping"
DocumentInstalledItemIndent "jq" DocumentInstalledItemIndent "jq"
DocumentInstalledItemIndent "libcurl3" DocumentInstalledItemIndent "libcurl3"
DocumentInstalledItemIndent "libicu55" DocumentInstalledItemIndent "libicu55"
DocumentInstalledItemIndent "libunwind8" DocumentInstalledItemIndent "libunwind8"
DocumentInstalledItemIndent "locales" DocumentInstalledItemIndent "locales"
DocumentInstalledItemIndent "netcat" DocumentInstalledItemIndent "netcat"
DocumentInstalledItemIndent "openssh-client" DocumentInstalledItemIndent "openssh-client"
DocumentInstalledItemIndent "rsync" DocumentInstalledItemIndent "rsync"
DocumentInstalledItemIndent "shellcheck" DocumentInstalledItemIndent "shellcheck"
DocumentInstalledItemIndent "sudo" DocumentInstalledItemIndent "sudo"
DocumentInstalledItemIndent "telnet" DocumentInstalledItemIndent "telnet"
DocumentInstalledItemIndent "time" DocumentInstalledItemIndent "time"
DocumentInstalledItemIndent "unzip" DocumentInstalledItemIndent "unzip"
DocumentInstalledItemIndent "wget" DocumentInstalledItemIndent "wget"
DocumentInstalledItemIndent "zip" DocumentInstalledItemIndent "zip"
DocumentInstalledItemIndent "tzdata" DocumentInstalledItemIndent "tzdata"

View File

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

View File

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

View File

@@ -27,13 +27,13 @@ for setup in $setups; do
cd $original_directory; cd $original_directory;
done; 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) pythons=$(ls $AGENT_TOOLSDIRECTORY/Python)
for python in $pythons; do for python in $pythons; do
DocumentInstalledItemIndent "Python $python" DocumentInstalledItemIndent "Python $python"
done; 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) rubys=$(ls $AGENT_TOOLSDIRECTORY/Ruby)
for ruby in $rubys; do for ruby in $rubys; do
DocumentInstalledItemIndent "Ruby $ruby" DocumentInstalledItemIndent "Ruby $ruby"

View File

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

View File

@@ -1,21 +1,21 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: mercurial.sh ## File: mercurial.sh
## Desc: Installs Mercurial ## Desc: Installs Mercurial
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh source $HELPER_SCRIPTS/apt.sh
apt-get install -y --no-install-recommends mercurial apt-get install -y --no-install-recommends mercurial
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v hg; then if ! command -v hg; then
exit 1 exit 1
fi fi
# Document what was added to the image # Document what was added to the image
echo "Lastly, documenting what we added to the metadata file" echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Mercurial ($(hg --version | head -n 1))" DocumentInstalledItem "Mercurial ($(hg --version | head -n 1))"

View File

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

View File

@@ -1,31 +1,31 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: powershellcore.sh ## File: powershellcore.sh
## Desc: Installs powershellcore ## Desc: Installs powershellcore
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
LSB_RELEASE=$(lsb_release -rs) LSB_RELEASE=$(lsb_release -rs)
# Install Powershell # Install Powershell
apt-get install -y powershell apt-get install -y powershell
# Temp fix based on: https://github.com/PowerShell/PowerShell/issues/9746 # Temp fix based on: https://github.com/PowerShell/PowerShell/issues/9746
sudo apt remove libicu64 sudo apt remove libicu64
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v pwsh; then if ! command -v pwsh; then
echo "pwsh was not installed" echo "pwsh was not installed"
exit 1 exit 1
fi fi
if ! pwsh -c 'Write-Host Hello world'; then if ! pwsh -c 'Write-Host Hello world'; then
echo "pwsh failed to run" echo "pwsh failed to run"
exit 1 exit 1
fi fi
# Document what was added to the image # Document what was added to the image
echo "Lastly, documenting what we added to the metadata file" echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Powershell ($(pwsh --version))" DocumentInstalledItem "Powershell ($(pwsh --version))"

View File

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

View File

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

View File

@@ -1,25 +1,25 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: ansible.sh ## File: ansible.sh
## Desc: Installs Ansible ## Desc: Installs Ansible
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh source $HELPER_SCRIPTS/apt.sh
# Install Ansible PPA and latest Ansible # Install Ansible PPA and latest Ansible
add-apt-repository ppa:ansible/ansible add-apt-repository ppa:ansible/ansible
apt-get update apt-get update
apt-get install -y --no-install-recommends ansible apt-get install -y --no-install-recommends ansible
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v ansible; then if ! command -v ansible; then
echo "Ansible was not installed or found on PATH" echo "Ansible was not installed or found on PATH"
exit 1 exit 1
fi fi
# Document what was added to the image # Document what was added to the image
echo "Lastly, documenting what we added to the metadata file" echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Ansible ($(ansible --version |& head -n 1))" DocumentInstalledItem "Ansible ($(ansible --version |& head -n 1))"

View File

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

View File

@@ -1,25 +1,25 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: azcopy.sh ## File: azcopy.sh
## Desc: Installs AzCopy ## Desc: Installs AzCopy
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
# Install AzCopy # Install AzCopy
wget -O azcopy.tar.gz https://aka.ms/downloadazcopylinux64 wget -O azcopy.tar.gz https://aka.ms/downloadazcopylinux64
tar -xf azcopy.tar.gz tar -xf azcopy.tar.gz
rm azcopy.tar.gz rm azcopy.tar.gz
./install.sh ./install.sh
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v azcopy; then if ! command -v azcopy; then
echo "azcopy was not installed" echo "azcopy was not installed"
exit 1 exit 1
fi fi
# Document what was added to the image # Document what was added to the image
echo "Lastly, documenting what we added to the metadata file" echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "AzCopy ($(azcopy --version))" DocumentInstalledItem "AzCopy ($(azcopy --version))"

View File

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

View File

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

View File

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

View File

@@ -1,24 +1,24 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: build-essential.sh ## File: build-essential.sh
## Desc: Installs build-essential package ## Desc: Installs build-essential package
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh source $HELPER_SCRIPTS/apt.sh
PACKAGE=build-essential PACKAGE=build-essential
# Test to see if the software in question is already installed, if not install it # Test to see if the software in question is already installed, if not install it
echo "Checking to see if the installer script has already been run" echo "Checking to see if the installer script has already been run"
if ! IsInstalled $PACKAGE; then if ! IsInstalled $PACKAGE; then
echo "Installing $PACKAGE" echo "Installing $PACKAGE"
apt-get install -y --no-install-recommends $PACKAGE apt-get install -y --no-install-recommends $PACKAGE
else else
echo "$PACKAGE is already installed" echo "$PACKAGE is already installed"
fi fi
# Document what was added to the image # Document what was added to the image
echo "Lastly, documenting what we added to the metadata file" echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "$PACKAGE" DocumentInstalledItem "$PACKAGE"

View File

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

View File

@@ -1,30 +1,30 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: cmake.sh ## File: cmake.sh
## Desc: Installs CMake ## Desc: Installs CMake
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
# Test to see if the software in question is already installed, if not install it # Test to see if the software in question is already installed, if not install it
echo "Checking to see if the installer script has already been run" echo "Checking to see if the installer script has already been run"
if command -v cmake; then if command -v cmake; then
echo "Example variable already set to $EXAMPLE_VAR" echo "Example variable already set to $EXAMPLE_VAR"
else else
curl -sL https://cmake.org/files/v3.12/cmake-3.12.4-Linux-x86_64.sh -o cmakeinstall.sh \ curl -sL https://cmake.org/files/v3.12/cmake-3.12.4-Linux-x86_64.sh -o cmakeinstall.sh \
&& chmod +x cmakeinstall.sh \ && chmod +x cmakeinstall.sh \
&& ./cmakeinstall.sh --prefix=/usr/local --exclude-subdir \ && ./cmakeinstall.sh --prefix=/usr/local --exclude-subdir \
&& rm cmakeinstall.sh && rm cmakeinstall.sh
fi fi
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v cmake; then if ! command -v cmake; then
echo "cmake was not installed" echo "cmake was not installed"
exit 1 exit 1
fi fi
# Document what was added to the image # Document what was added to the image
echo "Lastly, documenting what we added to the metadata file" echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "CMake ($(cmake --version | head -n 1))" DocumentInstalledItem "CMake ($(cmake --version | head -n 1))"

View File

@@ -1,26 +1,26 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: docker-compose.sh ## File: docker-compose.sh
## Desc: Installs Docker Compose ## Desc: Installs Docker Compose
################################################################################ ################################################################################
source $HELPER_SCRIPTS/apt.sh source $HELPER_SCRIPTS/apt.sh
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
version="1.22.0" version="1.22.0"
# Install latest docker-compose from releases # 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 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 chmod +x /usr/local/bin/docker-compose
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v docker-compose; then if ! command -v docker-compose; then
echo "docker-compose was not installed" echo "docker-compose was not installed"
exit 1 exit 1
fi fi
## Add version information to the metadata file ## Add version information to the metadata file
echo "Documenting Docker Compose version" echo "Documenting Docker Compose version"
docker_compose_version=$(docker-compose -v) docker_compose_version=$(docker-compose -v)
DocumentInstalledItem "Docker Compose (${docker_compose_version})" DocumentInstalledItem "Docker Compose (${docker_compose_version})"

View File

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

View File

@@ -1,34 +1,34 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: docker.sh ## File: docker.sh
## Desc: Installs the correct version of docker onto the image, and pulls ## Desc: Installs the correct version of docker onto the image, and pulls
## down the default docker image used for building on ubuntu ## down the default docker image used for building on ubuntu
################################################################################ ################################################################################
source $HELPER_SCRIPTS/apt.sh source $HELPER_SCRIPTS/apt.sh
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
DOCKER_PACKAGE=moby DOCKER_PACKAGE=moby
apt-get remove -y moby-engine mobi-cli apt-get remove -y moby-engine mobi-cli
apt-get update apt-get update
apt-get install -y apt-transport-https ca-certificates curl software-properties-common apt-get install -y apt-transport-https ca-certificates curl software-properties-common
apt-get update apt-get update
apt-get install -y moby-engine mobi-cli apt-get install -y moby-engine mobi-cli
docker pull node:10 docker pull node:10
docker pull node:12 docker pull node:12
docker pull buildpack-deps:stretch docker pull buildpack-deps:stretch
docker pull node:10-alpine docker pull node:10-alpine
docker pull node:12-alpine docker pull node:12-alpine
docker pull debian:8 docker pull debian:8
docker pull debian:9 docker pull debian:9
docker pull alpine:3.7 docker pull alpine:3.7
docker pull alpine:3.8 docker pull alpine:3.8
docker pull alpine:3.9 docker pull alpine:3.9
docker pull alpine:3.10 docker pull alpine:3.10
## Add version information to the metadata file ## Add version information to the metadata file
echo "Documenting Docker version" echo "Documenting Docker version"
DOCKER_VERSION=`docker -v` DOCKER_VERSION=`docker -v`
DocumentInstalledItem "Docker ($DOCKER_VERSION)" 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 #!/bin/bash
################################################################################ ################################################################################
## File: erlang.sh ## File: erlang.sh
## Desc: Installs erlang ## Desc: Installs erlang
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh source $HELPER_SCRIPTS/apt.sh
source_list=/etc/apt/sources.list.d/eslerlang.list source_list=/etc/apt/sources.list.d/eslerlang.list
# Install Erlang # Install Erlang
echo "deb http://binaries.erlang-solutions.com/debian $(lsb_release -cs) contrib" > $source_list 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 - wget -O - http://binaries.erlang-solutions.com/debian/erlang_solutions.asc | apt-key add -
apt-get update apt-get update
apt-get install -y --no-install-recommends esl-erlang apt-get install -y --no-install-recommends esl-erlang
# Install rebar3 # Install rebar3
wget -q -O rebar3 https://s3.amazonaws.com/rebar3/rebar3 wget -q -O rebar3 https://s3.amazonaws.com/rebar3/rebar3
chmod +x rebar3 chmod +x rebar3
mv rebar3 /usr/local/bin/rebar3 mv rebar3 /usr/local/bin/rebar3
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"
for cmd in erl erlc rebar3; do for cmd in erl erlc rebar3; do
if ! command -v $cmd; then if ! command -v $cmd; then
echo "$cmd was not installed or not found on PATH" echo "$cmd was not installed or not found on PATH"
exit 1 exit 1
fi fi
done done
# Document what was added to the image # Document what was added to the image
echo "Lastly, documenting what we added to the metadata file" echo "Lastly, documenting what we added to the metadata file"
erlang_version="$(erl -version 2>&1 | tr -d '\n' | tr -d '\r')" erlang_version="$(erl -version 2>&1 | tr -d '\n' | tr -d '\r')"
DocumentInstalledItem "Erlang ($erlang_version)" DocumentInstalledItem "Erlang ($erlang_version)"
# Clean up source list # Clean up source list
rm $source_list rm $source_list

View File

@@ -1,31 +1,31 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: example.sh ## File: example.sh
## Desc: This is an example script that can be copied to add a new software ## Desc: This is an example script that can be copied to add a new software
## installer to the image ## installer to the image
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh source $HELPER_SCRIPTS/apt.sh
# Test to see if the software in question is already installed, if not install it # Test to see if the software in question is already installed, if not install it
echo "Checking to see if the installer script has already been run" echo "Checking to see if the installer script has already been run"
if [ -z $EXAMPLE_VAR ]; then if [ -z $EXAMPLE_VAR ]; then
$EXAMPLE_VAR=1.0.0 $EXAMPLE_VAR=1.0.0
else else
echo "Example variable already set to $EXAMPLE_VAR" echo "Example variable already set to $EXAMPLE_VAR"
fi fi
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"
if [ -z $EXAMPLE_VAR ]; then if [ -z $EXAMPLE_VAR ]; then
echo "EXAMPLE_VAR variable was not set as expected" echo "EXAMPLE_VAR variable was not set as expected"
exit 1 exit 1
else else
echo "EXAMPLE_VAR was set properly" echo "EXAMPLE_VAR was set properly"
fi fi
# Document what was added to the image # Document what was added to the image
echo "Lastly, documenting what we added to the metadata file" echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Example Var ($EXAMPLE_VAR)" DocumentInstalledItem "Example Var ($EXAMPLE_VAR)"

View File

@@ -1,25 +1,25 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: firefox.sh ## File: firefox.sh
## Desc: Installs Firefox ## Desc: Installs Firefox
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh source $HELPER_SCRIPTS/apt.sh
# Install Firefox # Install Firefox
apt-get install -y firefox apt-get install -y firefox
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v firefox; then if ! command -v firefox; then
exit 1 exit 1
fi fi
# Document what was added to the image # Document what was added to the image
echo "Lastly, documenting what we added to the metadata file" echo "Lastly, documenting what we added to the metadata file"
# Resolves: Running Firefox as root in a regular user's session is not supported. # Resolves: Running Firefox as root in a regular user's session is not supported.
# ($HOME is /home/packer which is owned by packer.) # ($HOME is /home/packer which is owned by packer.)
HOME=/root HOME=/root
DocumentInstalledItem "Firefox ($(firefox --version))" DocumentInstalledItem "Firefox ($(firefox --version))"

View File

@@ -1,25 +1,25 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: gcc.sh ## File: gcc.sh
## Desc: Installs GNU C++ ## Desc: Installs GNU C++
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
# Install GNU C++ compiler # Install GNU C++ compiler
add-apt-repository ppa:ubuntu-toolchain-r/test -y add-apt-repository ppa:ubuntu-toolchain-r/test -y
apt-get update -y apt-get update -y
apt-get install g++-7 -y apt-get install g++-7 -y
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v g++-7; then if ! command -v g++-7; then
echo "GNU C++ was not installed" echo "GNU C++ was not installed"
exit 1 exit 1
fi fi
# Document what was added to the image # Document what was added to the image
echo "Lastly, documenting what we added to the metadata file" echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "GNU C++ $(g++-7 --version | head -n 1 | cut -d ' ' -f 4)" DocumentInstalledItem "GNU C++ $(g++-7 --version | head -n 1 | cut -d ' ' -f 4)"

View File

@@ -1,37 +1,37 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: git.sh ## File: git.sh
## Desc: Installs Git ## Desc: Installs Git
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
## Install git ## Install git
add-apt-repository ppa:git-core/ppa -y add-apt-repository ppa:git-core/ppa -y
apt-get update apt-get update
apt-get install git -y apt-get install git -y
git --version git --version
# Install git-lfs # Install git-lfs
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
apt-get install -y --no-install-recommends git-lfs apt-get install -y --no-install-recommends git-lfs
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing git installation" echo "Testing git installation"
if ! command -v git; then if ! command -v git; then
echo "git was not installed" echo "git was not installed"
exit 1 exit 1
fi fi
echo "Testing git-lfs installation" echo "Testing git-lfs installation"
if ! command -v git-lfs; then if ! command -v git-lfs; then
echo "git-lfs was not installed" echo "git-lfs was not installed"
exit 1 exit 1
fi fi
# Document what was added to the image # Document what was added to the image
echo "Lastly, document the installed versions" echo "Lastly, document the installed versions"
# git version 2.20.1 # git version 2.20.1
DocumentInstalledItem "Git ($(git --version 2>&1 | cut -d ' ' -f 3))" DocumentInstalledItem "Git ($(git --version 2>&1 | cut -d ' ' -f 3))"
# git-lfs/2.6.1 (GitHub; linux amd64; go 1.11.1) # 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))" 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 #!/bin/bash
################################################################################ ################################################################################
## File: google-chrome.sh ## File: google-chrome.sh
## Desc: Installs google-chrome ## Desc: Installs google-chrome
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
LSB_RELEASE=$(lsb_release -rs) LSB_RELEASE=$(lsb_release -rs)
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.list 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 update
apt-get install -y google-chrome-stable apt-get install -y google-chrome-stable
echo "CHROME_BIN=/usr/bin/google-chrome" | tee -a /etc/environment echo "CHROME_BIN=/usr/bin/google-chrome" | tee -a /etc/environment
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v google-chrome; then if ! command -v google-chrome; then
echo "google-chrome was not installed" echo "google-chrome was not installed"
exit 1 exit 1
fi fi
# Document what was added to the image # Document what was added to the image
echo "Lastly, documenting what we added to the metadata file" echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Google Chrome ($(google-chrome --version))" DocumentInstalledItem "Google Chrome ($(google-chrome --version))"

View File

@@ -1,25 +1,25 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: google-cloud-sdk.sh ## File: google-cloud-sdk.sh
## Desc: Installs the Google Cloud SDK ## Desc: Installs the Google Cloud SDK
################################################################################ ################################################################################
# Source the helpers # Source the helpers
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
# Install the Google Cloud SDK # Install the Google Cloud SDK
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
sudo apt-get update -y sudo apt-get update -y
sudo apt-get install -y google-cloud-sdk sudo apt-get install -y google-cloud-sdk
# Validate the installation # Validate the installation
echo "Validate the installation" echo "Validate the installation"
if ! command -v gcloud; then if ! command -v gcloud; then
echo "gcloud was not installed" echo "gcloud was not installed"
exit 1 exit 1
fi fi
# Document the installed version # Document the installed version
echo "Document the installed version" echo "Document the installed version"
DocumentInstalledItem "Google Cloud SDK ($(gcloud --version | head -n 1 | cut -d ' ' -f 4))" DocumentInstalledItem "Google Cloud SDK ($(gcloud --version | head -n 1 | cut -d ' ' -f 4))"

View File

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

View File

@@ -1,22 +1,22 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: heroku.sh ## File: heroku.sh
## Desc: Installs Heroku CLI ## Desc: Installs Heroku CLI
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh source $HELPER_SCRIPTS/apt.sh
# Install Heroku CLI # Install Heroku CLI
curl https://cli-assets.heroku.com/install-ubuntu.sh | sh curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v heroku; then if ! command -v heroku; then
exit 1 exit 1
fi fi
# Document what was added to the image # Document what was added to the image
echo "Lastly, documenting what we added to the metadata file" echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Heroku ($(heroku version))" DocumentInstalledItem "Heroku ($(heroku version))"

View File

@@ -1,37 +1,37 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: hhvm.sh ## File: hhvm.sh
## Desc: Installs hhvm ## Desc: Installs hhvm
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh source $HELPER_SCRIPTS/apt.sh
hhvm_package=hhvm hhvm_package=hhvm
# Test to see if the software in question is already installed, if not install it # Test to see if the software in question is already installed, if not install it
echo "Checking to see if the installer script has already been run" echo "Checking to see if the installer script has already been run"
if ! IsInstalled ${hhvm_package}; then if ! IsInstalled ${hhvm_package}; then
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xB4112585D386EB94 apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xB4112585D386EB94
add-apt-repository https://dl.hhvm.com/ubuntu add-apt-repository https://dl.hhvm.com/ubuntu
apt-get update apt-get update
apt-get -qq install -y hhvm apt-get -qq install -y hhvm
else else
echo "${hhvm_package} already installed" echo "${hhvm_package} already installed"
fi fi
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! IsInstalled ${hhvm_package}; then if ! IsInstalled ${hhvm_package}; then
echo "${hhvm_package} was not installed" echo "${hhvm_package} was not installed"
exit 1 exit 1
fi fi
if ! command -v hhvm; then if ! command -v hhvm; then
exit 1 exit 1
fi fi
# Document what was added to the image # Document what was added to the image
echo "Lastly, documenting what we added to the metadata file" echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "HHVM ($(hhvm --version | head -n 1))" DocumentInstalledItem "HHVM ($(hhvm --version | head -n 1))"

View File

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

View File

@@ -1,7 +1,6 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: java-tools.sh ## File: java-tools.sh
## Team: CI-Platform
## Desc: Installs Java and related tooling (Ant, Gradle, Maven) ## 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 echo "ANT_HOME=/usr/share/ant" | tee -a /etc/environment
# Install Maven # 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 unzip -d /usr/share maven.zip
rm maven.zip rm maven.zip
ln -s /usr/share/apache-maven-3.6.3/bin/mvn /usr/bin/mvn ln -s /usr/share/apache-maven-3.6.2/bin/mvn /usr/bin/mvn
echo "M2_HOME=/usr/share/apache-maven-3.6.3" | tee -a /etc/environment echo "M2_HOME=/usr/share/apache-maven-3.6.2" | tee -a /etc/environment
# Install Gradle # Install Gradle
# This script downloads the latest HTML list of releases at https://gradle.org/releases/. # This script downloads the latest HTML list of releases at https://gradle.org/releases/.

View File

@@ -1,26 +1,26 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: kind.sh ## File: kind.sh
## Desc: Installs kind ## Desc: Installs kind
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh source $HELPER_SCRIPTS/apt.sh
# Install KIND # Install KIND
KIND_VERSION="v0.5.1" 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" 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 chmod +x /usr/local/bin/kind
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v kind; then if ! command -v kind; then
echo "Kind was not installed or found on PATH" echo "Kind was not installed or found on PATH"
exit 1 exit 1
fi fi
# Document what was added to the image # Document what was added to the image
echo "Lastly, documenting what we added to the metadata file" echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Kind ($(kind version))" DocumentInstalledItem "Kind ($(kind version))"

View File

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

View File

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

View File

@@ -1,29 +1,29 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: cmake.sh ## File: cmake.sh
## Desc: Installs Mono ## Desc: Installs Mono
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
LSB_CODENAME=$(lsb_release -cs) LSB_CODENAME=$(lsb_release -cs)
# Test to see if the software in question is already installed, if not install it # Test to see if the software in question is already installed, if not install it
# wget "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" -O out && sudo apt-key add out && rm out # 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 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 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 update
apt-get install -y --no-install-recommends apt-transport-https mono-complete apt-get install -y --no-install-recommends apt-transport-https mono-complete
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v mono; then if ! command -v mono; then
echo "mono was not installed" echo "mono was not installed"
exit 1 exit 1
fi fi
# Document what was added to the image # Document what was added to the image
echo "Lastly, documenting what we added to the metadata file" echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Mono ($(mono --version | head -n 1))" DocumentInstalledItem "Mono ($(mono --version | head -n 1))"

View File

@@ -1,43 +1,43 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: mysql.sh ## File: mysql.sh
## Desc: Installs MySQL Client ## Desc: Installs MySQL Client
################################################################################ ################################################################################
## Source the helpers for use with the script ## Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
export ACCEPT_EULA=Y export ACCEPT_EULA=Y
# Install MySQL Client # Install MySQL Client
apt-get install mysql-client -y apt-get install mysql-client -y
# Install MySQL Server # Install MySQL Server
MYSQL_ROOT_PASSWORD=root 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 password $MYSQL_ROOT_PASSWORD" | debconf-set-selections
echo "mysql-server mysql-server/root_password_again 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 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) # 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 install -y mssql-tools unixodbc-dev
apt-get -f install apt-get -f install
ln -s /opt/mssql-tools/bin/* /usr/local/bin/ ln -s /opt/mssql-tools/bin/* /usr/local/bin/
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v mysql; then if ! command -v mysql; then
echo "mysql was not installed" echo "mysql was not installed"
exit 1 exit 1
fi fi
set -e set -e
mysql -vvv -e 'CREATE DATABASE smoke_test' -uroot -proot mysql -vvv -e 'CREATE DATABASE smoke_test' -uroot -proot
mysql -vvv -e 'DROP DATABASE smoke_test' -uroot -proot mysql -vvv -e 'DROP DATABASE smoke_test' -uroot -proot
set +e set +e
# Document what was added to the image # Document what was added to the image
echo "Lastly, documenting what we added to the metadata file" echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "MySQL ($(mysql --version))" DocumentInstalledItem "MySQL ($(mysql --version))"
DocumentInstalledItem "MySQL Server (user:root password:root)" DocumentInstalledItem "MySQL Server (user:root password:root)"
DocumentInstalledItem "MS SQL Server Client Tools" DocumentInstalledItem "MS SQL Server Client Tools"

View File

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

View File

@@ -1,29 +1,29 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: phantomjs.sh ## File: phantomjs.sh
## Desc: Installs PhantomJS ## Desc: Installs PhantomJS
################################################################################ ################################################################################
set -e set -e
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
# Install PhantomJS # Install PhantomJS
apt-get install -y chrpath libssl-dev libxft-dev libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev apt-get install -y chrpath libssl-dev libxft-dev libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev
PHANTOM_JS=phantomjs-2.1.1-linux-x86_64 PHANTOM_JS=phantomjs-2.1.1-linux-x86_64
wget https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2 wget https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2
tar xvjf $PHANTOM_JS.tar.bz2 tar xvjf $PHANTOM_JS.tar.bz2
mv $PHANTOM_JS /usr/local/share mv $PHANTOM_JS /usr/local/share
ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v phantomjs; then if ! command -v phantomjs; then
echo "phantomjs was not installed" echo "phantomjs was not installed"
exit 1 exit 1
fi fi
# Document what was added to the image # Document what was added to the image
echo "Lastly, documenting what we added to the metadata file" echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "PhantomJS ($(phantomjs --version))" DocumentInstalledItem "PhantomJS ($(phantomjs --version))"

View File

@@ -1,22 +1,22 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: pollinate.sh ## File: pollinate.sh
## Desc: Installs Pollinate ## Desc: Installs Pollinate
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
# Install Pollinate # Install Pollinate
apt-get install -y --no-install-recommends pollinate apt-get install -y --no-install-recommends pollinate
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v pollinate; then if ! command -v pollinate; then
echo "pollinate was not installed" echo "pollinate was not installed"
exit 1 exit 1
fi fi
# Document what was added to the image # Document what was added to the image
echo "Lastly, documenting what we added to the metadata file" echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Pollinate" DocumentInstalledItem "Pollinate"

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,22 +1,22 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: subversion.sh ## File: subversion.sh
## Desc: Installs Subversion client ## Desc: Installs Subversion client
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
# Install Subversion # Install Subversion
apt-get install -y --no-install-recommends subversion apt-get install -y --no-install-recommends subversion
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v svn; then if ! command -v svn; then
echo "Subversion (svn) was not installed" echo "Subversion (svn) was not installed"
exit 1 exit 1
fi fi
# Document what was added to the image # Document what was added to the image
echo "Lastly, documenting what we added to the metadata file" echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Subversion ($(svn --version | head -n 1))" DocumentInstalledItem "Subversion ($(svn --version | head -n 1))"

View File

@@ -1,26 +1,26 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: terraform.sh ## File: terraform.sh
## Desc: Installs terraform ## Desc: Installs terraform
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh source $HELPER_SCRIPTS/apt.sh
# Install Terraform # Install Terraform
TERRAFORM_VERSION=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r .current_version) TERRAFORM_VERSION=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r .current_version)
curl -LO "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip" curl -LO "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip"
unzip "terraform_${TERRAFORM_VERSION}_linux_amd64.zip" -d /usr/local/bin unzip "terraform_${TERRAFORM_VERSION}_linux_amd64.zip" -d /usr/local/bin
rm -f "terraform_${TERRAFORM_VERSION}_linux_amd64.zip" rm -f "terraform_${TERRAFORM_VERSION}_linux_amd64.zip"
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v terraform; then if ! command -v terraform; then
echo "Terraform was not installed or found on PATH" echo "Terraform was not installed or found on PATH"
exit 1 exit 1
fi fi
# Document what was added to the image # Document what was added to the image
echo "Lastly, documenting what we added to the metadata file" echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Terraform ($(terraform --version))" DocumentInstalledItem "Terraform ($(terraform --version))"

View File

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

View File

@@ -1,30 +1,30 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: vcpkg.sh ## File: vcpkg.sh
## Desc: Installs vcpkg ## Desc: Installs vcpkg
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
# Set env variable for vcpkg # Set env variable for vcpkg
VCPKG_INSTALLATION_ROOT=/usr/local/share/vcpkg VCPKG_INSTALLATION_ROOT=/usr/local/share/vcpkg
echo "VCPKG_INSTALLATION_ROOT=${VCPKG_INSTALLATION_ROOT}" | tee -a /etc/environment echo "VCPKG_INSTALLATION_ROOT=${VCPKG_INSTALLATION_ROOT}" | tee -a /etc/environment
# Install vcpkg # Install vcpkg
git clone --depth=1 https://github.com/Microsoft/vcpkg $VCPKG_INSTALLATION_ROOT git clone --depth=1 https://github.com/Microsoft/vcpkg $VCPKG_INSTALLATION_ROOT
$VCPKG_INSTALLATION_ROOT/bootstrap-vcpkg.sh $VCPKG_INSTALLATION_ROOT/bootstrap-vcpkg.sh
$VCPKG_INSTALLATION_ROOT/vcpkg integrate install $VCPKG_INSTALLATION_ROOT/vcpkg integrate install
chmod 0777 -R $VCPKG_INSTALLATION_ROOT chmod 0777 -R $VCPKG_INSTALLATION_ROOT
ln -sf $VCPKG_INSTALLATION_ROOT/vcpkg /usr/local/bin ln -sf $VCPKG_INSTALLATION_ROOT/vcpkg /usr/local/bin
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v vcpkg; then if ! command -v vcpkg; then
echo "vcpkg was not installed" echo "vcpkg was not installed"
exit 1 exit 1
fi fi
# Document what was added to the image # Document what was added to the image
echo "Lastly, documenting what we added to the metadata file" echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Vcpkg $(vcpkg version | head -n 1 | cut -d ' ' -f 6)" DocumentInstalledItem "Vcpkg $(vcpkg version | head -n 1 | cut -d ' ' -f 6)"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,10 +1,10 @@
#################################################################################### ####################################################################################
## File: Install-DACFx.ps1 ## File: Install-DACFx.ps1
## Desc: Install SQL Server® Data-Tier Application Framework (DACFx) for Windows ## Desc: Install SQL Server® Data-Tier Application Framework (DACFx) for Windows
#################################################################################### ####################################################################################
Import-Module -Name ImageHelpers -Force 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" $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 exit $exitcode

View File

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

View File

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

View File

@@ -1,20 +1,20 @@
################################################################################ ################################################################################
## File: Install-Firefox.ps1 ## File: Install-Firefox.ps1
## Desc: Install Mozilla Firefox ## Desc: Install Mozilla Firefox
################################################################################ ################################################################################
Import-Module -Name ImageHelpers -Force Import-Module -Name ImageHelpers -Force
$temp_install_dir = 'C:\Windows\Installer' $temp_install_dir = 'C:\Windows\Installer'
New-Item -Path $temp_install_dir -ItemType Directory -Force 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" 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; $path = '{0}\Program Files\Mozilla Firefox\' -f $env:SystemDrive;
New-Item -path $path -Name 'mozilla.cfg' -Value '// New-Item -path $path -Name 'mozilla.cfg' -Value '//
pref("browser.shell.checkDefaultBrowser", false); pref("browser.shell.checkDefaultBrowser", false);
pref("app.update.enabled", false);' -ItemType file -force pref("app.update.enabled", false);' -ItemType file -force
$path = '{0}\Program Files\Mozilla Firefox\defaults\pref\' -f $env:SystemDrive; $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); New-Item -path $path -Name 'local-settings.js' -Value 'pref("general.config.obscure_value", 0);
pref("general.config.filename", "mozilla.cfg");' -ItemType file -force pref("general.config.filename", "mozilla.cfg");' -ItemType file -force

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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