Merge pull request #9 from actions/master

Update master branch
This commit is contained in:
Dibir Magomedsaygitov
2020-06-01 14:41:11 +03:00
committed by GitHub
23 changed files with 202 additions and 177 deletions
+30
View 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
}
+23 -77
View File
@@ -8,90 +8,36 @@
source $HELPER_SCRIPTS/document.sh source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/os.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 if isUbuntu20 ; then
latestVersion=$(pwsh -Command '(Find-Module -Name Az).Version') versions=$(pwsh -Command '(Find-Module -Name Az).Version')
modulePath="/usr/share/az_$latestVersion" else
echo "Save Az Module ($latestVersion) to $modulePath" 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)
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
fi fi
# 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)
sudo pwsh -Command 'Save-Module -Name Az -LiteralPath /usr/share/az_1.0.0 -RequiredVersion 1.0.0 -Force' for version in ${versions[@]}; do
sudo pwsh -Command 'Save-Module -Name Az -LiteralPath /usr/share/az_1.6.0 -RequiredVersion 1.6.0 -Force' pwsh -Command "Save-Module -Name Az -LiteralPath /usr/share/az_$version -RequiredVersion $version -Force"
sudo pwsh -Command 'Save-Module -Name Az -LiteralPath /usr/share/az_2.3.2 -RequiredVersion 2.3.2 -Force' done
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'
# 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 ! pwsh -Command '$actualPSModulePath = $env:PSModulePath ; $env:PSModulePath = "/usr/share/az_1.0.0:" + $env:PSModulePath; for version in ${versions[@]}; do
if (!(get-module -listavailable -name Az.accounts)) { modulePath="/usr/share/az_$version"
Write-Host "Az Module was not installed"; $env:PSModulePath = $actualPSModulePath; exit 1 pwsh -Command "
} \$env:PSModulePath = '${modulePath}:' + \$env:PSModulePath;
$env:PSModulePath = $actualPSModulePath if ( -not (Get-Module -ListAvailable -Name Az.Accounts)) {
$actualPSModulePath = $env:PSModulePath ; $env:PSModulePath = "/usr/share/az_1.6.0:" + $env:PSModulePath; Write-Host 'Az Module was not installed'
if (!(get-module -listavailable -name Az.accounts)) { exit 1
Write-Host "Az Module was not installed"; $env:PSModulePath = $actualPSModulePath; exit 1 }"
} if [ $? -ne 0 ]; then
$env:PSModulePath = $actualPSModulePath echo "Az version $version is not installed"
$actualPSModulePath = $env:PSModulePath ; $env:PSModulePath = "/usr/share/az_2.3.2:" + $env:PSModulePath; exit 1
if (!(get-module -listavailable -name Az.accounts)) { fi
Write-Host "Az Module was not installed"; $env:PSModulePath = $actualPSModulePath; exit 1 done
}
$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
# 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 "Az Module (1.0.0)" for version in ${versions[@]}; do
DocumentInstalledItem "Az Module (1.6.0)" DocumentInstalledItem "Az Module ($version)"
DocumentInstalledItem "Az Module (2.3.2)" done
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)"
@@ -6,9 +6,16 @@
# 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/os.sh
# Install Azure CLI (instructions taken from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli) # Install Azure CLI (instructions taken from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
# 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 # 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"
@@ -99,5 +99,6 @@ done
# NuGetFallbackFolder at /usr/share/dotnet/sdk/NuGetFallbackFolder is warmed up by smoke test # 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 # 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_SKIP_FIRST_TIME_EXPERIENCE 1
setEtcEnvironmentVariable DOTNET_NOLOGO 1
prependEtcEnvironmentPath /home/runner/.dotnet/tools prependEtcEnvironmentPath /home/runner/.dotnet/tools
echo 'export PATH="$PATH:$HOME/.dotnet/tools"' | tee -a /etc/skel/.bashrc echo 'export PATH="$PATH:$HOME/.dotnet/tools"' | tee -a /etc/skel/.bashrc
+9
View File
@@ -17,6 +17,9 @@ git --version
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
# Install git-ftp
apt-get install git-ftp -y
# 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
@@ -28,6 +31,11 @@ if ! command -v git-lfs; then
echo "git-lfs was not installed" echo "git-lfs was not installed"
exit 1 exit 1
fi 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 # Document what was added to the image
echo "Lastly, document the installed versions" 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))" 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))"
DocumentInstalledItem "Git-ftp ($(git-ftp --version | cut -d ' ' -f 3))"
#Install hub #Install hub
snap install hub --classic snap install hub --classic
+21 -28
View File
@@ -6,7 +6,6 @@
# 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/os.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
@@ -14,25 +13,21 @@ 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 # Get 3 latest Haskell Major.Minor versions
if isUbuntu20 ; then allGhcVersions=$(apt-cache search "^ghc-" | grep -Po '(\d*\.){2}\d*' | sort --unique --version-sort)
ghcVersions="8.6.5 8.8.3 8.10.1" ghcMajorMinorVersions=$(echo "$allGhcVersions" | cut -d "." -f 1,2 | sort --unique --version-sort | tail -3)
cabalVersions="3.2"
fi
if isUbuntu16 || isUbuntu18 ; then for version in $ghcMajorMinorVersions; do
# Install various versions of ghc and cabal # Get latest patch version for given Major.Minor one (ex. 8.6.5 for 8.6) and install it
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" exactVersion=$(echo "$allGhcVersions" | grep $version | sort --unique --version-sort | tail -1)
cabalVersions="2.0 2.2 2.4 3.0 3.2" apt-get install -y ghc-$exactVersion
fi ghcInstalledVersions+=("$exactVersion")
for version in $ghcVersions; do
apt-get install -y ghc-$version
done done
for version in $cabalVersions; do # Get latest cabal version
apt-get install -y cabal-install-$version cabalVersion=$(apt-cache search cabal-install-[0-9] | grep -Po '\d*\.\d*' | sort --unique --version-sort | tail -1)
done
apt-get install -y cabal-install-$cabalVersion
# Install the latest stable release of haskell stack # Install the latest stable release of haskell stack
curl -sSL https://get.haskellstack.org/ | sh curl -sSL https://get.haskellstack.org/ | sh
@@ -46,13 +41,13 @@ for version in $ghcVersions; do
exit 1 exit 1
fi fi
done done
# Check all cabal versions
for version in $cabalVersions; do # Check cabal
if ! command -v /opt/cabal/$version/bin/cabal; then if ! command -v /opt/cabal/$cabalVersion/bin/cabal; then
echo "cabal $version was not installed" echo "cabal $cabalVersion was not installed"
exit 1 exit 1
fi fi
done
# Check stack # Check stack
if ! command -v stack; then if ! command -v stack; then
exit 1 exit 1
@@ -60,10 +55,8 @@ 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 $cabalVersions; do DocumentInstalledItem "Haskell Cabal ($(/opt/cabal/$cabalVersion/bin/cabal --version))"
DocumentInstalledItem "Haskell Cabal ($(/opt/cabal/$version/bin/cabal --version))" for version in ${ghcInstalledVersions[@]}; do
done
for version in $ghcVersions; 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))"
+2 -4
View File
@@ -6,12 +6,10 @@
# 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
# Install KIND # Install KIND
KIND_VERSION="v0.7.0" URL=$(curl -s https://api.github.com/repos/kubernetes-sigs/kind/releases/latest | jq -r '.assets[].browser_download_url | select(contains("kind-linux-amd64"))')
curl -L -o /usr/local/bin/kind $URL
curl -L -o /usr/local/bin/kind "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
@@ -20,6 +20,11 @@ apt-get install -y kubectl
# Install Helm # Install Helm
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash 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 # 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
@@ -32,7 +37,16 @@ if ! command -v helm; then
exit 1 exit 1
fi 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 # 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 --client --short |& head -n 1))" DocumentInstalledItem "kubectl ($(kubectl version --client --short |& head -n 1))"
DocumentInstalledItem "helm ($(helm version --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 -22
View File
@@ -6,6 +6,7 @@
# 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/install.sh
# This function installs PyPy using the specified arguments: # This function installs PyPy using the specified arguments:
# $1=PACKAGE_URL # $1=PACKAGE_URL
@@ -16,7 +17,7 @@ function InstallPyPy
PACKAGE_TAR_NAME=$(echo $PACKAGE_URL | awk -F/ '{print $NF}') PACKAGE_TAR_NAME=$(echo $PACKAGE_URL | awk -F/ '{print $NF}')
echo "Downloading tar archive '$PACKAGE_TAR_NAME' - '$PACKAGE_URL'" echo "Downloading tar archive '$PACKAGE_TAR_NAME' - '$PACKAGE_URL'"
PACKAGE_TAR_TEMP_PATH="/tmp/$PACKAGE_TAR_NAME" 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" echo "Expand '$PACKAGE_TAR_NAME' to the /tmp folder"
tar xf $PACKAGE_TAR_TEMP_PATH -C /tmp tar xf $PACKAGE_TAR_TEMP_PATH -C /tmp
@@ -69,28 +70,11 @@ function InstallPyPy
rm -f $PACKAGE_TAR_TEMP_PATH 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 # 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" toolsetJson="$INSTALLER_SCRIPT_FOLDER/toolset.json"
toolsetVersions=$(cat $toolsetJson | jq -r '.toolcache[] | select(.name | contains("PyPy")) | .versions[]') toolsetVersions=$(cat $toolsetJson | jq -r '.toolcache[] | select(.name | contains("PyPy")) | .versions[]')
@@ -7,16 +7,25 @@
# 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 Vercel CLI
npm i -g now npm i -g vercel
# Validate the installation # Validate the installation
echo "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 if ! command -v now; then
echo "Zeit Now CLI was not installed" echo "Now link to Zeit Vercel CLI was not created"
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 Vercel CLI ($(vercel --version))"
+1 -1
View File
@@ -229,7 +229,7 @@
"{{template_dir}}/scripts/installers/terraform.sh", "{{template_dir}}/scripts/installers/terraform.sh",
"{{template_dir}}/scripts/installers/packer.sh", "{{template_dir}}/scripts/installers/packer.sh",
"{{template_dir}}/scripts/installers/vcpkg.sh", "{{template_dir}}/scripts/installers/vcpkg.sh",
"{{template_dir}}/scripts/installers/zeit-now.sh", "{{template_dir}}/scripts/installers/zeit-vercel.sh",
"{{template_dir}}/scripts/installers/dpkg-config.sh", "{{template_dir}}/scripts/installers/dpkg-config.sh",
"{{template_dir}}/scripts/installers/mongodb.sh", "{{template_dir}}/scripts/installers/mongodb.sh",
"{{template_dir}}/scripts/installers/rndgenerator.sh" "{{template_dir}}/scripts/installers/rndgenerator.sh"
+1 -1
View File
@@ -233,7 +233,7 @@
"{{template_dir}}/scripts/installers/terraform.sh", "{{template_dir}}/scripts/installers/terraform.sh",
"{{template_dir}}/scripts/installers/packer.sh", "{{template_dir}}/scripts/installers/packer.sh",
"{{template_dir}}/scripts/installers/vcpkg.sh", "{{template_dir}}/scripts/installers/vcpkg.sh",
"{{template_dir}}/scripts/installers/zeit-now.sh", "{{template_dir}}/scripts/installers/zeit-vercel.sh",
"{{template_dir}}/scripts/installers/dpkg-config.sh", "{{template_dir}}/scripts/installers/dpkg-config.sh",
"{{template_dir}}/scripts/installers/mongodb.sh", "{{template_dir}}/scripts/installers/mongodb.sh",
"{{template_dir}}/scripts/installers/rndgenerator.sh" "{{template_dir}}/scripts/installers/rndgenerator.sh"
+1 -1
View File
@@ -230,7 +230,7 @@
"{{template_dir}}/scripts/installers/terraform.sh", "{{template_dir}}/scripts/installers/terraform.sh",
"{{template_dir}}/scripts/installers/packer.sh", "{{template_dir}}/scripts/installers/packer.sh",
"{{template_dir}}/scripts/installers/vcpkg.sh", "{{template_dir}}/scripts/installers/vcpkg.sh",
"{{template_dir}}/scripts/installers/zeit-now.sh", "{{template_dir}}/scripts/installers/zeit-vercel.sh",
"{{template_dir}}/scripts/installers/dpkg-config.sh", "{{template_dir}}/scripts/installers/dpkg-config.sh",
"{{template_dir}}/scripts/installers/rndgenerator.sh" "{{template_dir}}/scripts/installers/rndgenerator.sh"
], ],
@@ -377,7 +377,7 @@ function Get-ToolsByName {
function Get-WinVersion function Get-WinVersion
{ {
(Get-WmiObject -class Win32_OperatingSystem).Caption (Get-CimInstance -ClassName Win32_OperatingSystem).Caption
} }
function Test-IsWin19 function Test-IsWin19
@@ -3,7 +3,8 @@
## Desc: Install Azure CLI ## 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' $AzureCliExtensionPath = Join-Path $Env:CommonProgramFiles 'AzureCliExtensionDirectory'
New-Item -ItemType "directory" -Path $AzureCliExtensionPath New-Item -ItemType "directory" -Path $AzureCliExtensionPath
@@ -8,7 +8,8 @@
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]) { $cpu = (Get-CimInstance -ClassName Win32_Processor)[0]
if ($cpu.VirtualizationFirmwareEnabled -and $cpu.SecondLevelAddressTranslationExtensions) {
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 {
@@ -2,31 +2,37 @@
## File: Install-SeleniumWebDrivers.ps1 ## File: Install-SeleniumWebDrivers.ps1
## Desc: Install Selenium Web Drivers ## Desc: Install Selenium Web Drivers
################################################################################ ################################################################################
$DestinationPath = "$($env:SystemDrive)\"
$DriversZipFile = "SeleniumWebDrivers.zip"
Write-Host "Destination path: [$DestinationPath]"
Write-Host "Selenium drivers download and install..."
try { try {
Invoke-WebRequest -UseBasicParsing -Uri "https://seleniumwebdrivers.blob.core.windows.net/seleniumwebdrivers/${DriversZipFile}" -OutFile $DriversZipFile $latestReleaseUrl = "https://selenium-release.storage.googleapis.com/"
} $latestReleaseInfo = Invoke-RestMethod -Uri $latestReleaseUrl
catch { $latestIEVersion = $latestReleaseInfo.ListBucketResult.Contents | Where-Object Key -match "IEDriverServer_x64" | Sort-Object LastModified | Select-Object -ExpandProperty Key -Last 1
Write-Error "[!] Failed to download $DriversZipFile" $ieDriverUrl = -join ($latestReleaseUrl, $latestIEVersion)
} catch {
Write-Error "[!] Failed to get IEDriver version [$latestReleaseUrl]: $_"
exit 1 exit 1
} }
$TempSeleniumDir = Join-Path $Env:TEMP "SeleniumWebDrivers" # Download IE selenium driver
Extract-7Zip -Path $DriversZipFile -DestinationPath $Env:TEMP try {
Remove-Item $DriversZipFile Write-Host "Selenium IEDriverServer download and install..."
$driverZipFile = Start-DownloadWithRetry -Url $ieDriverUrl -Name "SeleniumWebDrivers.zip"
$SeleniumWebDriverPath = Join-Path $DestinationPath "SeleniumWebDrivers" }
$IEDriverPathTemp = Join-Path $TempSeleniumDir 'IEDriver' catch {
Write-Error "[!] Failed to download $ieDriverUrl"
if (-not (Test-Path -Path $SeleniumWebDriverPath)) { exit 1
New-Item -Path $SeleniumWebDriverPath -ItemType "directory"
} }
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
+14 -13
View File
@@ -3,37 +3,38 @@
## Desc: Install Kind ## Desc: Install Kind
################################################################################ ################################################################################
$stableKindTag = "v0.7.0" function Get-LatestRelease
$tagToUse = $stableKindTag; {
$destFilePath = "C:\ProgramData\kind" $url = 'https://api.github.com/repos/kubernetes-sigs/kind/releases/latest'
(Invoke-RestMethod -Uri $url).assets.browser_download_url -match "kind-windows-amd64"
}
try try
{ {
$kindUrl = "https://github.com/kubernetes-sigs/kind/releases/download/$tagToUse/kind-windows-amd64" Write-Host "Starting Install kind.exe..."
$destFilePath = "C:\ProgramData\kind"
Write-Host "Downloading kind.exe..." $null = New-Item -Path $destFilePath -ItemType Directory -Force
New-Item -Path $destFilePath -ItemType Directory -Force
$kindUrl = Get-LatestRelease
$kindInstallerPath = Start-DownloadWithRetry -Url $kindUrl -Name "kind.exe" -DownloadPath $destFilePath $kindInstallerPath = Start-DownloadWithRetry -Url $kindUrl -Name "kind.exe" -DownloadPath $destFilePath
Write-Host "Starting Install kind.exe..."
$process = Start-Process -FilePath $kindInstallerPath -Wait -PassThru $process = Start-Process -FilePath $kindInstallerPath -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 'Installation successful'
Add-MachinePathItem $destFilePath Add-MachinePathItem $destFilePath
} }
else 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 exit $exitCode
} }
} }
catch catch
{ {
Write-Host -Object "Failed to install the Executable kind.exe" Write-Host "Failed to install the Executable kind.exe"
Write-Host -Object $_.Exception.Message Write-Host $_.Exception.Message
exit -1 exit 1
} }
@@ -4,3 +4,4 @@
################################################################################ ################################################################################
Choco-Install -PackageName kubernetes-cli Choco-Install -PackageName kubernetes-cli
Choco-Install -PackageName minikube
@@ -9,8 +9,8 @@ Import-Module -Name ImageHelpers -Force
if (Test-IsWin19) if (Test-IsWin19)
{ {
$winSdkUrl = "https://go.microsoft.com/fwlink/p/?linkid=2083338" $winSdkUrl = "https://go.microsoft.com/fwlink/p/?linkid=2120843"
$wdkUrl = "https://go.microsoft.com/fwlink/?linkid=2085767" $wdkUrl = "https://go.microsoft.com/fwlink/?linkid=2128854"
$FilePath = "C:\Program Files (x86)\Windows Kits\10\Vsix\VS2019\WDK.vsix" $FilePath = "C:\Program Files (x86)\Windows Kits\10\Vsix\VS2019\WDK.vsix"
$VSver = "2019" $VSver = "2019"
} }
@@ -26,3 +26,26 @@ _Environment:_
"@ "@
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description 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 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) if (!$WDKVersion)
{ {
@@ -72,6 +72,7 @@ $WorkLoads = '--allWorkloads --includeRecommended ' + `
'--add Microsoft.VisualStudio.Component.Windows10SDK.17134 ' + ` '--add Microsoft.VisualStudio.Component.Windows10SDK.17134 ' + `
'--add Microsoft.VisualStudio.Component.Windows10SDK.17763 ' + ` '--add Microsoft.VisualStudio.Component.Windows10SDK.17763 ' + `
'--add Microsoft.VisualStudio.Component.Windows10SDK.18362 ' + ` '--add Microsoft.VisualStudio.Component.Windows10SDK.18362 ' + `
'--add Microsoft.VisualStudio.Component.Windows10SDK.19041 ' + `
'--add Microsoft.VisualStudio.Component.WinXP ' + ` '--add Microsoft.VisualStudio.Component.WinXP ' + `
'--add Microsoft.VisualStudio.ComponentGroup.Azure.CloudServices ' + ` '--add Microsoft.VisualStudio.ComponentGroup.Azure.CloudServices ' + `
'--add Microsoft.VisualStudio.ComponentGroup.Azure.ResourceManager.Tools ' + ` '--add Microsoft.VisualStudio.ComponentGroup.Azure.ResourceManager.Tools ' + `