mirror of
https://github.com/actions/runner-images.git
synced 2025-12-30 05:49:48 +08:00
30
images/linux/scripts/helpers/install.sh
Normal file
30
images/linux/scripts/helpers/install.sh
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
################################################################################
|
||||
## File: install.sh
|
||||
## Desc: Helper functions for installing tools
|
||||
################################################################################
|
||||
|
||||
download_with_retries() {
|
||||
# Due to restrictions of bash functions, positional arguments are used here.
|
||||
# In case if you using latest argument NAME, you should also set value to all previous parameters.
|
||||
# Example: download_with_retries $ANDROID_SDK_URL "." "android_sdk.zip"
|
||||
local URL="$1"
|
||||
local DEST="${2:-.}"
|
||||
local NAME="${3:-${URL##*/}}"
|
||||
|
||||
echo "Downloading $URL..."
|
||||
i=20
|
||||
while [ $i -gt 0 ]; do
|
||||
((i--))
|
||||
wget $URL --output-document="$DEST/$NAME" \
|
||||
--no-verbose
|
||||
if [ $? != 0 ]; then
|
||||
sleep 30
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Could not download $URL"
|
||||
return 1
|
||||
}
|
||||
@@ -8,90 +8,36 @@
|
||||
source $HELPER_SCRIPTS/document.sh
|
||||
source $HELPER_SCRIPTS/os.sh
|
||||
|
||||
# Install Azure CLI (instructions taken from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
|
||||
# List of versions
|
||||
if isUbuntu20 ; then
|
||||
latestVersion=$(pwsh -Command '(Find-Module -Name Az).Version')
|
||||
modulePath="/usr/share/az_$latestVersion"
|
||||
echo "Save Az Module ($latestVersion) to $modulePath"
|
||||
pwsh -Command "Save-Module -Name Az -LiteralPath $modulePath -RequiredVersion $latestVersion -Force"
|
||||
|
||||
# Run tests to determine that the software installed as expected
|
||||
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
||||
if ! pwsh -Command "\$env:PSModulePath = '${modulePath}:' + \$env:PSModulePath
|
||||
if ( -not (Get-Module -ListAvailable -Name Az.Accounts)) {
|
||||
Write-Host 'Az Module was not installed'
|
||||
exit 1
|
||||
}"; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Document what was added to the image
|
||||
DocumentInstalledItem "Az Module ($latestVersion)"
|
||||
exit 0
|
||||
versions=$(pwsh -Command '(Find-Module -Name Az).Version')
|
||||
else
|
||||
versions=(1.0.0 1.6.0 2.3.2 2.6.0 2.8.0 3.1.0 3.5.0 3.8.0)
|
||||
fi
|
||||
|
||||
# Install Azure CLI (instructions taken from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
|
||||
sudo pwsh -Command 'Save-Module -Name Az -LiteralPath /usr/share/az_1.0.0 -RequiredVersion 1.0.0 -Force'
|
||||
sudo pwsh -Command 'Save-Module -Name Az -LiteralPath /usr/share/az_1.6.0 -RequiredVersion 1.6.0 -Force'
|
||||
sudo pwsh -Command 'Save-Module -Name Az -LiteralPath /usr/share/az_2.3.2 -RequiredVersion 2.3.2 -Force'
|
||||
sudo pwsh -Command 'Save-Module -Name Az -LiteralPath /usr/share/az_2.6.0 -RequiredVersion 2.6.0 -Force'
|
||||
sudo pwsh -Command 'Save-Module -Name Az -LiteralPath /usr/share/az_2.8.0 -RequiredVersion 2.8.0 -Force'
|
||||
sudo pwsh -Command 'Save-Module -Name Az -LiteralPath /usr/share/az_3.1.0 -RequiredVersion 3.1.0 -Force'
|
||||
sudo pwsh -Command 'Save-Module -Name Az -LiteralPath /usr/share/az_3.5.0 -RequiredVersion 3.5.0 -Force'
|
||||
sudo pwsh -Command 'Save-Module -Name Az -LiteralPath /usr/share/az_3.8.0 -RequiredVersion 3.8.0 -Force'
|
||||
for version in ${versions[@]}; do
|
||||
pwsh -Command "Save-Module -Name Az -LiteralPath /usr/share/az_$version -RequiredVersion $version -Force"
|
||||
done
|
||||
|
||||
# Run tests to determine that the software installed as expected
|
||||
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
||||
if ! pwsh -Command '$actualPSModulePath = $env:PSModulePath ; $env:PSModulePath = "/usr/share/az_1.0.0:" + $env:PSModulePath;
|
||||
if (!(get-module -listavailable -name Az.accounts)) {
|
||||
Write-Host "Az Module was not installed"; $env:PSModulePath = $actualPSModulePath; exit 1
|
||||
}
|
||||
$env:PSModulePath = $actualPSModulePath
|
||||
$actualPSModulePath = $env:PSModulePath ; $env:PSModulePath = "/usr/share/az_1.6.0:" + $env:PSModulePath;
|
||||
if (!(get-module -listavailable -name Az.accounts)) {
|
||||
Write-Host "Az Module was not installed"; $env:PSModulePath = $actualPSModulePath; exit 1
|
||||
}
|
||||
$env:PSModulePath = $actualPSModulePath
|
||||
$actualPSModulePath = $env:PSModulePath ; $env:PSModulePath = "/usr/share/az_2.3.2:" + $env:PSModulePath;
|
||||
if (!(get-module -listavailable -name Az.accounts)) {
|
||||
Write-Host "Az Module was not installed"; $env:PSModulePath = $actualPSModulePath; exit 1
|
||||
}
|
||||
$env:PSModulePath = $actualPSModulePath
|
||||
$actualPSModulePath = $env:PSModulePath ; $env:PSModulePath = "/usr/share/az_2.6.0:" + $env:PSModulePath;
|
||||
if (!(get-module -listavailable -name Az.accounts)) {
|
||||
Write-Host "Az Module was not installed"; $env:PSModulePath = $actualPSModulePath; exit 1
|
||||
}
|
||||
$env:PSModulePath = $actualPSModulePath
|
||||
$actualPSModulePath = $env:PSModulePath ; $env:PSModulePath = "/usr/share/az_2.8.0:" + $env:PSModulePath;
|
||||
if (!(get-module -listavailable -name Az.accounts)) {
|
||||
Write-Host "Az Module was not installed"; $env:PSModulePath = $actualPSModulePath; exit 1
|
||||
}
|
||||
$env:PSModulePath = $actualPSModulePath
|
||||
$actualPSModulePath = $env:PSModulePath ; $env:PSModulePath = "/usr/share/az_3.1.0:" + $env:PSModulePath;
|
||||
if (!(get-module -listavailable -name Az.accounts)) {
|
||||
Write-Host "Az Module was not installed"; $env:PSModulePath = $actualPSModulePath; exit 1
|
||||
}
|
||||
$env:PSModulePath = $actualPSModulePath
|
||||
$actualPSModulePath = $env:PSModulePath ; $env:PSModulePath = "/usr/share/az_3.5.0:" + $env:PSModulePath;
|
||||
if (!(get-module -listavailable -name Az.accounts)) {
|
||||
Write-Host "Az Module was not installed"; $env:PSModulePath = $actualPSModulePath; exit 1
|
||||
}
|
||||
$env:PSModulePath = $actualPSModulePath
|
||||
$actualPSModulePath = $env:PSModulePath ; $env:PSModulePath = "/usr/share/az_3.8.0:" + $env:PSModulePath;
|
||||
if (!(get-module -listavailable -name Az.accounts)) {
|
||||
Write-Host "Az Module was not installed"; $env:PSModulePath = $actualPSModulePath; exit 1
|
||||
}
|
||||
$env:PSModulePath = $actualPSModulePath'; then
|
||||
exit 1
|
||||
fi
|
||||
for version in ${versions[@]}; do
|
||||
modulePath="/usr/share/az_$version"
|
||||
pwsh -Command "
|
||||
\$env:PSModulePath = '${modulePath}:' + \$env:PSModulePath;
|
||||
if ( -not (Get-Module -ListAvailable -Name Az.Accounts)) {
|
||||
Write-Host 'Az Module was not installed'
|
||||
exit 1
|
||||
}"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Az version $version is not installed"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# Document what was added to the image
|
||||
echo "Lastly, documenting what we added to the metadata file"
|
||||
DocumentInstalledItem "Az Module (1.0.0)"
|
||||
DocumentInstalledItem "Az Module (1.6.0)"
|
||||
DocumentInstalledItem "Az Module (2.3.2)"
|
||||
DocumentInstalledItem "Az Module (2.6.0)"
|
||||
DocumentInstalledItem "Az Module (2.8.0)"
|
||||
DocumentInstalledItem "Az Module (3.1.0)"
|
||||
DocumentInstalledItem "Az Module (3.5.0)"
|
||||
DocumentInstalledItem "Az Module (3.8.0)"
|
||||
for version in ${versions[@]}; do
|
||||
DocumentInstalledItem "Az Module ($version)"
|
||||
done
|
||||
|
||||
@@ -6,9 +6,16 @@
|
||||
|
||||
# Source the helpers for use with the script
|
||||
source $HELPER_SCRIPTS/document.sh
|
||||
source $HELPER_SCRIPTS/os.sh
|
||||
|
||||
# Install Azure CLI (instructions taken from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
|
||||
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
|
||||
# Temporary downgrade to 2.5.1 installation until version 2.7.0 with the fix for the issue is not released https://github.com/actions/virtual-environments/issues/948
|
||||
# There is no 2.5.1 version for Ubuntu20
|
||||
if isUbuntu16 || isUbuntu18 ; then
|
||||
label=$(getOSVersionLabel)
|
||||
apt-get install -y --allow-downgrades azure-cli=2.5.1-1~$label
|
||||
fi
|
||||
|
||||
# Run tests to determine that the software installed as expected
|
||||
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
||||
|
||||
@@ -99,5 +99,6 @@ done
|
||||
# NuGetFallbackFolder at /usr/share/dotnet/sdk/NuGetFallbackFolder is warmed up by smoke test
|
||||
# Additional FTE will just copy to ~/.dotnet/NuGet which provides no benefit on a fungible machine
|
||||
setEtcEnvironmentVariable DOTNET_SKIP_FIRST_TIME_EXPERIENCE 1
|
||||
setEtcEnvironmentVariable DOTNET_NOLOGO 1
|
||||
prependEtcEnvironmentPath /home/runner/.dotnet/tools
|
||||
echo 'export PATH="$PATH:$HOME/.dotnet/tools"' | tee -a /etc/skel/.bashrc
|
||||
|
||||
@@ -17,6 +17,9 @@ git --version
|
||||
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
|
||||
apt-get install -y --no-install-recommends git-lfs
|
||||
|
||||
# Install git-ftp
|
||||
apt-get install git-ftp -y
|
||||
|
||||
# Run tests to determine that the software installed as expected
|
||||
echo "Testing git installation"
|
||||
if ! command -v git; then
|
||||
@@ -28,6 +31,11 @@ if ! command -v git-lfs; then
|
||||
echo "git-lfs was not installed"
|
||||
exit 1
|
||||
fi
|
||||
echo "Testing git-ftp installation"
|
||||
if ! command -v git-ftp; then
|
||||
echo "git-ftp was not installed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Document what was added to the image
|
||||
echo "Lastly, document the installed versions"
|
||||
@@ -35,6 +43,7 @@ echo "Lastly, document the installed versions"
|
||||
DocumentInstalledItem "Git ($(git --version 2>&1 | cut -d ' ' -f 3))"
|
||||
# git-lfs/2.6.1 (GitHub; linux amd64; go 1.11.1)
|
||||
DocumentInstalledItem "Git Large File Storage (LFS) ($(git-lfs --version 2>&1 | cut -d ' ' -f 1 | cut -d '/' -f 2))"
|
||||
DocumentInstalledItem "Git-ftp ($(git-ftp --version | cut -d ' ' -f 3))"
|
||||
|
||||
#Install hub
|
||||
snap install hub --classic
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
# Source the helpers for use with the script
|
||||
source $HELPER_SCRIPTS/document.sh
|
||||
source $HELPER_SCRIPTS/os.sh
|
||||
|
||||
# Install Herbert V. Riedel's PPA for managing multiple version of ghc on ubuntu.
|
||||
# https://launchpad.net/~hvr/+archive/ubuntu/ghc
|
||||
@@ -14,25 +13,21 @@ apt-get install -y software-properties-common
|
||||
add-apt-repository -y ppa:hvr/ghc
|
||||
apt-get update
|
||||
|
||||
# Install various versions of ghc and cabal
|
||||
if isUbuntu20 ; then
|
||||
ghcVersions="8.6.5 8.8.3 8.10.1"
|
||||
cabalVersions="3.2"
|
||||
fi
|
||||
# Get 3 latest Haskell Major.Minor versions
|
||||
allGhcVersions=$(apt-cache search "^ghc-" | grep -Po '(\d*\.){2}\d*' | sort --unique --version-sort)
|
||||
ghcMajorMinorVersions=$(echo "$allGhcVersions" | cut -d "." -f 1,2 | sort --unique --version-sort | tail -3)
|
||||
|
||||
if isUbuntu16 || isUbuntu18 ; then
|
||||
# Install various versions of ghc and cabal
|
||||
ghcVersions="8.0.2 8.2.2 8.4.4 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.10.1"
|
||||
cabalVersions="2.0 2.2 2.4 3.0 3.2"
|
||||
fi
|
||||
|
||||
for version in $ghcVersions; do
|
||||
apt-get install -y ghc-$version
|
||||
for version in $ghcMajorMinorVersions; do
|
||||
# Get latest patch version for given Major.Minor one (ex. 8.6.5 for 8.6) and install it
|
||||
exactVersion=$(echo "$allGhcVersions" | grep $version | sort --unique --version-sort | tail -1)
|
||||
apt-get install -y ghc-$exactVersion
|
||||
ghcInstalledVersions+=("$exactVersion")
|
||||
done
|
||||
|
||||
for version in $cabalVersions; do
|
||||
apt-get install -y cabal-install-$version
|
||||
done
|
||||
# Get latest cabal version
|
||||
cabalVersion=$(apt-cache search cabal-install-[0-9] | grep -Po '\d*\.\d*' | sort --unique --version-sort | tail -1)
|
||||
|
||||
apt-get install -y cabal-install-$cabalVersion
|
||||
|
||||
# Install the latest stable release of haskell stack
|
||||
curl -sSL https://get.haskellstack.org/ | sh
|
||||
@@ -46,13 +41,13 @@ for version in $ghcVersions; do
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
# Check all cabal versions
|
||||
for version in $cabalVersions; do
|
||||
if ! command -v /opt/cabal/$version/bin/cabal; then
|
||||
echo "cabal $version was not installed"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# Check cabal
|
||||
if ! command -v /opt/cabal/$cabalVersion/bin/cabal; then
|
||||
echo "cabal $cabalVersion was not installed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check stack
|
||||
if ! command -v stack; then
|
||||
exit 1
|
||||
@@ -60,10 +55,8 @@ fi
|
||||
|
||||
# Document what was added to the image
|
||||
echo "Lastly, documenting what we added to the metadata file"
|
||||
for version in $cabalVersions; do
|
||||
DocumentInstalledItem "Haskell Cabal ($(/opt/cabal/$version/bin/cabal --version))"
|
||||
done
|
||||
for version in $ghcVersions; do
|
||||
DocumentInstalledItem "Haskell Cabal ($(/opt/cabal/$cabalVersion/bin/cabal --version))"
|
||||
for version in ${ghcInstalledVersions[@]}; do
|
||||
DocumentInstalledItem "GHC ($(/opt/ghc/$version/bin/ghc --version))"
|
||||
done
|
||||
DocumentInstalledItem "Haskell Stack ($(stack --version))"
|
||||
|
||||
@@ -6,12 +6,10 @@
|
||||
|
||||
# Source the helpers for use with the script
|
||||
source $HELPER_SCRIPTS/document.sh
|
||||
source $HELPER_SCRIPTS/apt.sh
|
||||
|
||||
# Install KIND
|
||||
KIND_VERSION="v0.7.0"
|
||||
|
||||
curl -L -o /usr/local/bin/kind "https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-linux-amd64"
|
||||
URL=$(curl -s https://api.github.com/repos/kubernetes-sigs/kind/releases/latest | jq -r '.assets[].browser_download_url | select(contains("kind-linux-amd64"))')
|
||||
curl -L -o /usr/local/bin/kind $URL
|
||||
chmod +x /usr/local/bin/kind
|
||||
|
||||
# Run tests to determine that the software installed as expected
|
||||
|
||||
@@ -20,6 +20,11 @@ apt-get install -y kubectl
|
||||
# Install Helm
|
||||
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
|
||||
|
||||
# Install minikube
|
||||
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
|
||||
sudo install minikube-linux-amd64 /usr/local/bin/minikube
|
||||
|
||||
|
||||
# Run tests to determine that the software installed as expected
|
||||
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
||||
if ! command -v kubectl; then
|
||||
@@ -32,7 +37,16 @@ if ! command -v helm; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run tests to determine that the software installed as expected
|
||||
echo "Testing to make sure that minikube was installed"
|
||||
if ! command -v minikube; then
|
||||
echo "minikube was not installed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Document what was added to the image
|
||||
echo "Lastly, documenting what we added to the metadata file"
|
||||
DocumentInstalledItem "kubectl ($(kubectl version --client --short |& head -n 1))"
|
||||
DocumentInstalledItem "helm ($(helm version --short |& head -n 1))"
|
||||
# minikube version output already has word minikube in it. example minikube version: v1.9.2
|
||||
DocumentInstalledItem "$(minikube version --short)"
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
# Source the helpers for use with the script
|
||||
source $HELPER_SCRIPTS/document.sh
|
||||
source $HELPER_SCRIPTS/install.sh
|
||||
|
||||
# This function installs PyPy using the specified arguments:
|
||||
# $1=PACKAGE_URL
|
||||
@@ -16,7 +17,7 @@ function InstallPyPy
|
||||
PACKAGE_TAR_NAME=$(echo $PACKAGE_URL | awk -F/ '{print $NF}')
|
||||
echo "Downloading tar archive '$PACKAGE_TAR_NAME' - '$PACKAGE_URL'"
|
||||
PACKAGE_TAR_TEMP_PATH="/tmp/$PACKAGE_TAR_NAME"
|
||||
wget -q -O $PACKAGE_TAR_TEMP_PATH $PACKAGE_URL
|
||||
download_with_retries $PACKAGE_URL "/tmp" $PACKAGE_TAR_NAME
|
||||
|
||||
echo "Expand '$PACKAGE_TAR_NAME' to the /tmp folder"
|
||||
tar xf $PACKAGE_TAR_TEMP_PATH -C /tmp
|
||||
@@ -69,28 +70,11 @@ function InstallPyPy
|
||||
rm -f $PACKAGE_TAR_TEMP_PATH
|
||||
}
|
||||
|
||||
function getPyPyVersions
|
||||
{
|
||||
uri="https://downloads.python.org/pypy/"
|
||||
i=20
|
||||
|
||||
while [ $i -gt 0 ]; do
|
||||
((i--))
|
||||
result="$(curl -4 -s --compressed $uri | grep 'linux64' | awk -v uri="$uri" -F'>|<' '{print uri$5}')"
|
||||
if [ -z "$result" ]; then
|
||||
sleep 30
|
||||
else
|
||||
echo "$result"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
echo "There are no more attempts to retrive PyPy version"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Installation PyPy
|
||||
pypyVersions=$(getPyPyVersions)
|
||||
uri="https://downloads.python.org/pypy/"
|
||||
download_with_retries $uri "/tmp" "pypyUrls.html"
|
||||
pypyVersions="$(cat /tmp/pypyUrls.html | grep 'linux64' | awk -v uri="$uri" -F'>|<' '{print uri$5}')"
|
||||
|
||||
toolsetJson="$INSTALLER_SCRIPT_FOLDER/toolset.json"
|
||||
toolsetVersions=$(cat $toolsetJson | jq -r '.toolcache[] | select(.name | contains("PyPy")) | .versions[]')
|
||||
|
||||
|
||||
@@ -7,16 +7,25 @@
|
||||
# Source the helpers for use with the script
|
||||
source $HELPER_SCRIPTS/document.sh
|
||||
|
||||
# Install the Zeit Now CLI
|
||||
npm i -g now
|
||||
# Install the Zeit Vercel CLI
|
||||
npm i -g vercel
|
||||
|
||||
# Validate the installation
|
||||
echo "Validate the installation"
|
||||
if ! command -v vercel; then
|
||||
echo "Zeit Vercel CLI was not installed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Creating the symlink now to vercel"
|
||||
ln -s /usr/local/bin/vercel /usr/local/bin/now
|
||||
|
||||
echo "Validate the link"
|
||||
if ! command -v now; then
|
||||
echo "Zeit Now CLI was not installed"
|
||||
echo "Now link to Zeit Vercel CLI was not created"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Document the installed version
|
||||
echo "Document the installed version"
|
||||
DocumentInstalledItem "Zeit Now CLI ($(now --version))"
|
||||
DocumentInstalledItem "Zeit Vercel CLI ($(vercel --version))"
|
||||
@@ -229,7 +229,7 @@
|
||||
"{{template_dir}}/scripts/installers/terraform.sh",
|
||||
"{{template_dir}}/scripts/installers/packer.sh",
|
||||
"{{template_dir}}/scripts/installers/vcpkg.sh",
|
||||
"{{template_dir}}/scripts/installers/zeit-now.sh",
|
||||
"{{template_dir}}/scripts/installers/zeit-vercel.sh",
|
||||
"{{template_dir}}/scripts/installers/dpkg-config.sh",
|
||||
"{{template_dir}}/scripts/installers/mongodb.sh",
|
||||
"{{template_dir}}/scripts/installers/rndgenerator.sh"
|
||||
|
||||
@@ -233,7 +233,7 @@
|
||||
"{{template_dir}}/scripts/installers/terraform.sh",
|
||||
"{{template_dir}}/scripts/installers/packer.sh",
|
||||
"{{template_dir}}/scripts/installers/vcpkg.sh",
|
||||
"{{template_dir}}/scripts/installers/zeit-now.sh",
|
||||
"{{template_dir}}/scripts/installers/zeit-vercel.sh",
|
||||
"{{template_dir}}/scripts/installers/dpkg-config.sh",
|
||||
"{{template_dir}}/scripts/installers/mongodb.sh",
|
||||
"{{template_dir}}/scripts/installers/rndgenerator.sh"
|
||||
|
||||
@@ -230,7 +230,7 @@
|
||||
"{{template_dir}}/scripts/installers/terraform.sh",
|
||||
"{{template_dir}}/scripts/installers/packer.sh",
|
||||
"{{template_dir}}/scripts/installers/vcpkg.sh",
|
||||
"{{template_dir}}/scripts/installers/zeit-now.sh",
|
||||
"{{template_dir}}/scripts/installers/zeit-vercel.sh",
|
||||
"{{template_dir}}/scripts/installers/dpkg-config.sh",
|
||||
"{{template_dir}}/scripts/installers/rndgenerator.sh"
|
||||
],
|
||||
|
||||
@@ -377,7 +377,7 @@ function Get-ToolsByName {
|
||||
|
||||
function Get-WinVersion
|
||||
{
|
||||
(Get-WmiObject -class Win32_OperatingSystem).Caption
|
||||
(Get-CimInstance -ClassName Win32_OperatingSystem).Caption
|
||||
}
|
||||
|
||||
function Test-IsWin19
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
## Desc: Install Azure CLI
|
||||
################################################################################
|
||||
|
||||
Choco-Install -PackageName azure-cli
|
||||
# Temporary hardcode 2.5.1 installation until version 2.7.0 with the fix for the issue is not released https://github.com/actions/virtual-environments/issues/948
|
||||
Choco-Install -PackageName azure-cli -ArgumentList "--version=2.5.1"
|
||||
|
||||
$AzureCliExtensionPath = Join-Path $Env:CommonProgramFiles 'AzureCliExtensionDirectory'
|
||||
New-Item -ItemType "directory" -Path $AzureCliExtensionPath
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
Write-Host "Install Containers feature"
|
||||
Install-WindowsFeature -Name Containers
|
||||
|
||||
if ((GWMI Win32_Processor).VirtualizationFirmwareEnabled[0] -and (GWMI Win32_Processor).SecondLevelAddressTranslationExtensions[0]) {
|
||||
$cpu = (Get-CimInstance -ClassName Win32_Processor)[0]
|
||||
if ($cpu.VirtualizationFirmwareEnabled -and $cpu.SecondLevelAddressTranslationExtensions) {
|
||||
Write-Host "Install Hyper-V feature"
|
||||
Install-WindowsFeature -Name Hyper-V -IncludeManagementTools
|
||||
} else {
|
||||
|
||||
@@ -2,31 +2,37 @@
|
||||
## File: Install-SeleniumWebDrivers.ps1
|
||||
## Desc: Install Selenium Web Drivers
|
||||
################################################################################
|
||||
$DestinationPath = "$($env:SystemDrive)\"
|
||||
$DriversZipFile = "SeleniumWebDrivers.zip"
|
||||
Write-Host "Destination path: [$DestinationPath]"
|
||||
Write-Host "Selenium drivers download and install..."
|
||||
|
||||
try {
|
||||
Invoke-WebRequest -UseBasicParsing -Uri "https://seleniumwebdrivers.blob.core.windows.net/seleniumwebdrivers/${DriversZipFile}" -OutFile $DriversZipFile
|
||||
}
|
||||
catch {
|
||||
Write-Error "[!] Failed to download $DriversZipFile"
|
||||
$latestReleaseUrl = "https://selenium-release.storage.googleapis.com/"
|
||||
$latestReleaseInfo = Invoke-RestMethod -Uri $latestReleaseUrl
|
||||
$latestIEVersion = $latestReleaseInfo.ListBucketResult.Contents | Where-Object Key -match "IEDriverServer_x64" | Sort-Object LastModified | Select-Object -ExpandProperty Key -Last 1
|
||||
$ieDriverUrl = -join ($latestReleaseUrl, $latestIEVersion)
|
||||
} catch {
|
||||
Write-Error "[!] Failed to get IEDriver version [$latestReleaseUrl]: $_"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$TempSeleniumDir = Join-Path $Env:TEMP "SeleniumWebDrivers"
|
||||
Extract-7Zip -Path $DriversZipFile -DestinationPath $Env:TEMP
|
||||
Remove-Item $DriversZipFile
|
||||
|
||||
$SeleniumWebDriverPath = Join-Path $DestinationPath "SeleniumWebDrivers"
|
||||
$IEDriverPathTemp = Join-Path $TempSeleniumDir 'IEDriver'
|
||||
|
||||
if (-not (Test-Path -Path $SeleniumWebDriverPath)) {
|
||||
New-Item -Path $SeleniumWebDriverPath -ItemType "directory"
|
||||
# Download IE selenium driver
|
||||
try {
|
||||
Write-Host "Selenium IEDriverServer download and install..."
|
||||
$driverZipFile = Start-DownloadWithRetry -Url $ieDriverUrl -Name "SeleniumWebDrivers.zip"
|
||||
}
|
||||
catch {
|
||||
Write-Error "[!] Failed to download $ieDriverUrl"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Move-Item -Path "$IEDriverPathTemp" -Destination $SeleniumWebDriverPath
|
||||
$ieDriverPath = "C:\SeleniumWebDrivers\IEDriver"
|
||||
if (-not (Test-Path -Path $ieDriverPath)) {
|
||||
$null = New-Item -Path $ieDriverPath -ItemType Directory -Force
|
||||
}
|
||||
|
||||
Write-Host "Setting the environment variables"
|
||||
Extract-7Zip -Path $driverZipFile -DestinationPath $ieDriverPath
|
||||
Remove-Item $driverZipFile
|
||||
|
||||
setx IEWebDriver "C:\SeleniumWebDrivers\IEDriver" /M
|
||||
Write-Host "Get the IEDriver version..."
|
||||
(Get-Item "$ieDriverPath\IEDriverServer.exe").VersionInfo.FileVersion | Out-File -FilePath "$ieDriverPath\versioninfo.txt"
|
||||
|
||||
Write-Host "Setting the IEWebDriver environment variables"
|
||||
setx IEWebDriver $ieDriverPath /M
|
||||
|
||||
@@ -3,37 +3,38 @@
|
||||
## Desc: Install Kind
|
||||
################################################################################
|
||||
|
||||
$stableKindTag = "v0.7.0"
|
||||
$tagToUse = $stableKindTag;
|
||||
$destFilePath = "C:\ProgramData\kind"
|
||||
function Get-LatestRelease
|
||||
{
|
||||
$url = 'https://api.github.com/repos/kubernetes-sigs/kind/releases/latest'
|
||||
(Invoke-RestMethod -Uri $url).assets.browser_download_url -match "kind-windows-amd64"
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$kindUrl = "https://github.com/kubernetes-sigs/kind/releases/download/$tagToUse/kind-windows-amd64"
|
||||
|
||||
Write-Host "Downloading kind.exe..."
|
||||
New-Item -Path $destFilePath -ItemType Directory -Force
|
||||
Write-Host "Starting Install kind.exe..."
|
||||
$destFilePath = "C:\ProgramData\kind"
|
||||
$null = New-Item -Path $destFilePath -ItemType Directory -Force
|
||||
|
||||
$kindUrl = Get-LatestRelease
|
||||
$kindInstallerPath = Start-DownloadWithRetry -Url $kindUrl -Name "kind.exe" -DownloadPath $destFilePath
|
||||
|
||||
Write-Host "Starting Install kind.exe..."
|
||||
$process = Start-Process -FilePath $kindInstallerPath -Wait -PassThru
|
||||
$exitCode = $process.ExitCode
|
||||
|
||||
if ($exitCode -eq 0 -or $exitCode -eq 3010)
|
||||
{
|
||||
Write-Host -Object 'Installation successful'
|
||||
Write-Host 'Installation successful'
|
||||
Add-MachinePathItem $destFilePath
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
|
||||
Write-Host "Non zero exit code returned by the installation process : $exitCode."
|
||||
exit $exitCode
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
Write-Host -Object "Failed to install the Executable kind.exe"
|
||||
Write-Host -Object $_.Exception.Message
|
||||
exit -1
|
||||
Write-Host "Failed to install the Executable kind.exe"
|
||||
Write-Host $_.Exception.Message
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -4,3 +4,4 @@
|
||||
################################################################################
|
||||
|
||||
Choco-Install -PackageName kubernetes-cli
|
||||
Choco-Install -PackageName minikube
|
||||
|
||||
@@ -9,8 +9,8 @@ Import-Module -Name ImageHelpers -Force
|
||||
|
||||
if (Test-IsWin19)
|
||||
{
|
||||
$winSdkUrl = "https://go.microsoft.com/fwlink/p/?linkid=2083338"
|
||||
$wdkUrl = "https://go.microsoft.com/fwlink/?linkid=2085767"
|
||||
$winSdkUrl = "https://go.microsoft.com/fwlink/p/?linkid=2120843"
|
||||
$wdkUrl = "https://go.microsoft.com/fwlink/?linkid=2128854"
|
||||
$FilePath = "C:\Program Files (x86)\Windows Kits\10\Vsix\VS2019\WDK.vsix"
|
||||
$VSver = "2019"
|
||||
}
|
||||
|
||||
@@ -26,3 +26,26 @@ _Environment:_
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
if((Get-Command -Name 'minikube'))
|
||||
{
|
||||
Write-Host "minikube $(minikube version --short) in path"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "minikube is not in path"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adding description of the software to Markdown
|
||||
$SoftwareName = "minikube"
|
||||
|
||||
$version = $(minikube version --short=true)
|
||||
|
||||
$Description = @"
|
||||
_Version:_ $version<br/>
|
||||
_Environment:_
|
||||
* PATH: contains location of minikube.exe
|
||||
"@
|
||||
|
||||
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description
|
||||
|
||||
@@ -7,7 +7,7 @@ Import-Module -Name ImageHelpers -Force
|
||||
|
||||
function Get-WDKVersion
|
||||
{
|
||||
$WDKVersion = (Get-WmiObject Win32_Product -Filter "Name = 'Windows Driver Kit'").version
|
||||
$WDKVersion = (Get-CimInstance -ClassName Win32_Product -Filter "Name = 'Windows Driver Kit'").Version
|
||||
|
||||
if (!$WDKVersion)
|
||||
{
|
||||
|
||||
@@ -72,6 +72,7 @@ $WorkLoads = '--allWorkloads --includeRecommended ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows10SDK.17134 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows10SDK.17763 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows10SDK.18362 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.Windows10SDK.19041 ' + `
|
||||
'--add Microsoft.VisualStudio.Component.WinXP ' + `
|
||||
'--add Microsoft.VisualStudio.ComponentGroup.Azure.CloudServices ' + `
|
||||
'--add Microsoft.VisualStudio.ComponentGroup.Azure.ResourceManager.Tools ' + `
|
||||
|
||||
Reference in New Issue
Block a user