Merge main into install-codeql-bundle.

This commit is contained in:
Chris Gavin
2020-09-16 07:50:05 +01:00
161 changed files with 8253 additions and 1184 deletions

View File

@@ -1,171 +0,0 @@
#!/bin/bash
################################################################################
## File: android.sh
## Desc: Installs Android SDK
################################################################################
set -e
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Set env variable for SDK Root (https://developer.android.com/studio/command-line/variables)
ANDROID_ROOT=/usr/local/lib/android
ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk
echo "ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT}" | tee -a /etc/environment
# ANDROID_HOME is deprecated, but older versions of Gradle rely on it
echo "ANDROID_HOME=${ANDROID_SDK_ROOT}" | tee -a /etc/environment
# Create android sdk directory
mkdir -p ${ANDROID_SDK_ROOT}
# Download the latest command line tools so that we can accept all of the licenses.
# See https://developer.android.com/studio/#command-tools
wget -O android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip android-sdk.zip -d ${ANDROID_SDK_ROOT}
rm -f android-sdk.zip
# Check sdk manager installation
/usr/local/lib/android/sdk/tools/bin/sdkmanager --list 1>/dev/null
if [ $? -eq 0 ]
then
echo "Android SDK manager was installed"
else
echo "Android SDK manager was not installed"
exit 1
fi
# Add required permissions
chmod -R a+rwx ${ANDROID_SDK_ROOT}
# Install the following SDKs and build tools, passing in "y" to accept licenses.
echo "y" | ${ANDROID_SDK_ROOT}/tools/bin/sdkmanager \
"ndk-bundle" \
"platform-tools" \
"platforms;android-30" \
"platforms;android-29" \
"platforms;android-28" \
"platforms;android-27" \
"platforms;android-26" \
"platforms;android-25" \
"platforms;android-24" \
"platforms;android-23" \
"platforms;android-22" \
"platforms;android-21" \
"platforms;android-19" \
"platforms;android-17" \
"platforms;android-15" \
"platforms;android-10" \
"build-tools;30.0.1" \
"build-tools;30.0.0" \
"build-tools;29.0.3" \
"build-tools;29.0.2" \
"build-tools;29.0.0" \
"build-tools;28.0.3" \
"build-tools;28.0.2" \
"build-tools;28.0.1" \
"build-tools;28.0.0" \
"build-tools;27.0.3" \
"build-tools;27.0.2" \
"build-tools;27.0.1" \
"build-tools;27.0.0" \
"build-tools;26.0.3" \
"build-tools;26.0.2" \
"build-tools;26.0.1" \
"build-tools;26.0.0" \
"build-tools;25.0.3" \
"build-tools;25.0.2" \
"build-tools;25.0.1" \
"build-tools;25.0.0" \
"build-tools;24.0.3" \
"build-tools;24.0.2" \
"build-tools;24.0.1" \
"build-tools;24.0.0" \
"build-tools;23.0.3" \
"build-tools;23.0.2" \
"build-tools;23.0.1" \
"build-tools;22.0.1" \
"build-tools;21.1.2" \
"build-tools;20.0.0" \
"build-tools;19.1.0" \
"build-tools;17.0.0" \
"extras;android;m2repository" \
"extras;google;m2repository" \
"extras;google;google_play_services" \
"extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.2" \
"extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.1" \
"extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2" \
"extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1" \
"add-ons;addon-google_apis-google-24" \
"add-ons;addon-google_apis-google-23" \
"add-ons;addon-google_apis-google-22" \
"add-ons;addon-google_apis-google-21" \
"cmake;3.6.4111459" \
"cmake;3.10.2.4988404" \
"patcher;v4"
# Document what was added to the image
echo "Lastly, document what was added to the metadata file"
DocumentInstalledItem "Google Repository $(cat ${ANDROID_SDK_ROOT}/extras/google/m2repository/source.properties 2>&1 | grep Pkg.Revision | cut -d '=' -f 2)"
DocumentInstalledItem "Google Play services $(cat ${ANDROID_SDK_ROOT}/extras/google/google_play_services/source.properties 2>&1 | grep Pkg.Revision | cut -d '=' -f 2)"
DocumentInstalledItem "Google APIs 24"
DocumentInstalledItem "Google APIs 23"
DocumentInstalledItem "Google APIs 22"
DocumentInstalledItem "Google APIs 21"
DocumentInstalledItem "CMake $(ls ${ANDROID_SDK_ROOT}/cmake 2>&1)"
DocumentInstalledItem "Android Support Repository 47.0.0"
DocumentInstalledItem "Android Solver for ConstraintLayout 1.0.2"
DocumentInstalledItem "Android Solver for ConstraintLayout 1.0.1"
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 30"
DocumentInstalledItem "Android SDK Platform 29"
DocumentInstalledItem "Android SDK Platform 28"
DocumentInstalledItem "Android SDK Platform 27"
DocumentInstalledItem "Android SDK Platform 26"
DocumentInstalledItem "Android SDK Platform 25"
DocumentInstalledItem "Android SDK Platform 24"
DocumentInstalledItem "Android SDK Platform 23"
DocumentInstalledItem "Android SDK Platform 22"
DocumentInstalledItem "Android SDK Platform 21"
DocumentInstalledItem "Android SDK Platform 19"
DocumentInstalledItem "Android SDK Platform 17"
DocumentInstalledItem "Android SDK Platform 15"
DocumentInstalledItem "Android SDK Platform 10"
DocumentInstalledItem "Android SDK Patch Applier v4"
DocumentInstalledItem "Android SDK Build-Tools 30.0.1"
DocumentInstalledItem "Android SDK Build-Tools 30.0.0"
DocumentInstalledItem "Android SDK Build-Tools 29.0.3"
DocumentInstalledItem "Android SDK Build-Tools 29.0.2"
DocumentInstalledItem "Android SDK Build-Tools 29.0.0"
DocumentInstalledItem "Android SDK Build-Tools 28.0.3"
DocumentInstalledItem "Android SDK Build-Tools 28.0.2"
DocumentInstalledItem "Android SDK Build-Tools 28.0.1"
DocumentInstalledItem "Android SDK Build-Tools 28.0.0"
DocumentInstalledItem "Android SDK Build-Tools 27.0.3"
DocumentInstalledItem "Android SDK Build-Tools 27.0.2"
DocumentInstalledItem "Android SDK Build-Tools 27.0.1"
DocumentInstalledItem "Android SDK Build-Tools 27.0.0"
DocumentInstalledItem "Android SDK Build-Tools 26.0.3"
DocumentInstalledItem "Android SDK Build-Tools 26.0.2"
DocumentInstalledItem "Android SDK Build-Tools 26.0.1"
DocumentInstalledItem "Android SDK Build-Tools 26.0.0"
DocumentInstalledItem "Android SDK Build-Tools 25.0.3"
DocumentInstalledItem "Android SDK Build-Tools 25.0.2"
DocumentInstalledItem "Android SDK Build-Tools 25.0.1"
DocumentInstalledItem "Android SDK Build-Tools 25.0.0"
DocumentInstalledItem "Android SDK Build-Tools 24.0.3"
DocumentInstalledItem "Android SDK Build-Tools 24.0.2"
DocumentInstalledItem "Android SDK Build-Tools 24.0.1"
DocumentInstalledItem "Android SDK Build-Tools 24.0.0"
DocumentInstalledItem "Android SDK Build-Tools 23.0.3"
DocumentInstalledItem "Android SDK Build-Tools 23.0.2"
DocumentInstalledItem "Android SDK Build-Tools 23.0.1"
DocumentInstalledItem "Android SDK Build-Tools 22.0.1"
DocumentInstalledItem "Android SDK Build-Tools 21.1.2"
DocumentInstalledItem "Android SDK Build-Tools 20.0.0"
DocumentInstalledItem "Android SDK Build-Tools 19.1.0"
DocumentInstalledItem "Android SDK Build-Tools 17.0.0"
DocumentInstalledItem "Android NDK $(cat ${ANDROID_SDK_ROOT}/ndk-bundle/source.properties 2>&1 | grep Pkg.Revision | cut -d ' ' -f 3)"
DocumentInstalledItem "Android ConstraintLayout 1.0.2"
DocumentInstalledItem "Android ConstraintLayout 1.0.1"

View File

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

View File

@@ -27,10 +27,10 @@ Function Install-Asset {
$ErrorActionPreference = "Stop"
# Get toolset content
$toolsetJson = Get-Content -Path "$env:INSTALLER_SCRIPT_FOLDER/toolset.json" -Raw
$toolset = Get-Content -Path "$env:INSTALLER_SCRIPT_FOLDER/toolset.json" -Raw
$toolsToInstall = @("Python", "Node", "Boost", "Go")
$tools = ConvertFrom-Json -InputObject $toolsetJson | Select-Object -ExpandProperty toolcache | Where-Object {$ToolsToInstall -contains $_.Name}
$tools = ConvertFrom-Json -InputObject $toolset | Select-Object -ExpandProperty toolcache | Where-Object {$ToolsToInstall -contains $_.Name}
foreach ($tool in $tools) {
# Get versions manifest for current tool

View File

@@ -46,8 +46,8 @@ $toolsExecutables = @{
}
# Get toolset content
$toolsetJson = Get-Content -Path "$env:INSTALLER_SCRIPT_FOLDER/toolset.json" -Raw
$tools = ConvertFrom-Json -InputObject $toolsetJson | Select-Object -ExpandProperty toolcache
$toolset = Get-Content -Path "$env:INSTALLER_SCRIPT_FOLDER/toolset.json" -Raw
$tools = ConvertFrom-Json -InputObject $toolset | Select-Object -ExpandProperty toolcache
foreach($tool in $tools) {
Invoke-Expression "bash -c `"source $env:HELPER_SCRIPTS/document.sh; DocumentInstalledItem '$($tool.name):'`""

View File

@@ -27,9 +27,6 @@ wget -O android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux
unzip android-sdk.zip -d ${ANDROID_SDK_ROOT}
rm -f android-sdk.zip
# Add required permissions
chmod -R a+rwx ${ANDROID_SDK_ROOT}
if isUbuntu20 ; then
# Sdk manager doesn't work with Java > 8, set version 8 explicitly
sed -i "2i export JAVA_HOME=${JAVA_HOME_8_X64}" /usr/local/lib/android/sdk/tools/bin/sdkmanager
@@ -45,56 +42,54 @@ else
exit 1
fi
toolset="$INSTALLER_SCRIPT_FOLDER/toolset.json"
platforms=$(jq -r '.android.platform_list[]|"platforms;" + .' $toolset)
buildtools=$(jq -r '.android.build_tools[]|"build-tools;" + .' $toolset)
extras=$(jq -r '.android.extra_list[]|"extras;" + .' $toolset)
addons=$(jq -r '.android.addon_list[]|"add-ons;" + .' $toolset)
additional=$(jq -r '.android.additional_tools[]' $toolset)
# Install the following SDKs and build tools, passing in "y" to accept licenses.
echo "y" | ${ANDROID_SDK_ROOT}/tools/bin/sdkmanager \
"ndk-bundle" \
"platform-tools" \
"platforms;android-30" \
"platforms;android-29" \
"platforms;android-28" \
"platforms;android-27" \
"build-tools;30.0.1" \
"build-tools;30.0.0" \
"build-tools;29.0.3" \
"build-tools;29.0.2" \
"build-tools;29.0.0" \
"build-tools;28.0.3" \
"build-tools;28.0.2" \
"build-tools;28.0.1" \
"build-tools;28.0.0" \
"build-tools;27.0.3" \
"build-tools;27.0.2" \
"build-tools;27.0.1" \
"build-tools;27.0.0" \
"extras;android;m2repository" \
"extras;google;m2repository" \
"extras;google;google_play_services" \
"cmake;3.10.2.4988404" \
"patcher;v4"
echo "y" | ${ANDROID_SDK_ROOT}/tools/bin/sdkmanager $platforms $buildtools $extras $google_api_list $addons $additional
# Document what was added to the image
google_api_versions_list=$(echo "$addons"|awk -F- '/addon-google_apis-google/ {print $5}')
constraint_layout_versions_list=$(echo "$extras"|awk -F';' '/constraint-layout;/ {print $8}')
constraint_layout_solver_versions_list=$(echo "$extras"|awk -F';' '/constraint-layout-solver;/ {print $8}')
platform_versions_list=$(echo "$platforms"|awk -F- '{print $2}')
buildtools_versions_list=$(echo "$buildtools"|awk -F';' '{print $2}')
# Add required permissions
chmod -R a+rwx ${ANDROID_SDK_ROOT}
echo "Lastly, document what was added to the metadata file"
DocumentInstalledItem "Google Repository $(cat ${ANDROID_SDK_ROOT}/extras/google/m2repository/source.properties 2>&1 | grep Pkg.Revision | cut -d '=' -f 2)"
DocumentInstalledItem "Google Play services $(cat ${ANDROID_SDK_ROOT}/extras/google/google_play_services/source.properties 2>&1 | grep Pkg.Revision | cut -d '=' -f 2)"
for version in $google_api_versions_list; do
DocumentInstalledItem "Google APIs $version"
done
DocumentInstalledItem "CMake $(ls ${ANDROID_SDK_ROOT}/cmake 2>&1)"
DocumentInstalledItem "Android Support Repository 47.0.0"
for version in $constraint_layout_versions_list; do
DocumentInstalledItem "Android ConstraintLayout $version"
done
for version in $constraint_layout_solver_versions_list; do
DocumentInstalledItem "Android ConstraintLayout Solver $version"
done
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 30"
DocumentInstalledItem "Android SDK Platform 29"
DocumentInstalledItem "Android SDK Platform 28"
DocumentInstalledItem "Android SDK Platform 27"
for version in $platform_versions_list; do
DocumentInstalledItem "Android SDK Platform $version"
done
DocumentInstalledItem "Android SDK Patch Applier v4"
DocumentInstalledItem "Android SDK Build-Tools 30.0.1"
DocumentInstalledItem "Android SDK Build-Tools 30.0.0"
DocumentInstalledItem "Android SDK Build-Tools 29.0.3"
DocumentInstalledItem "Android SDK Build-Tools 29.0.2"
DocumentInstalledItem "Android SDK Build-Tools 29.0.0"
DocumentInstalledItem "Android SDK Build-Tools 28.0.3"
DocumentInstalledItem "Android SDK Build-Tools 28.0.2"
DocumentInstalledItem "Android SDK Build-Tools 28.0.1"
DocumentInstalledItem "Android SDK Build-Tools 28.0.0"
DocumentInstalledItem "Android SDK Build-Tools 27.0.3"
DocumentInstalledItem "Android SDK Build-Tools 27.0.2"
DocumentInstalledItem "Android SDK Build-Tools 27.0.1"
DocumentInstalledItem "Android SDK Build-Tools 27.0.0"
for version in $buildtools_versions_list; do
DocumentInstalledItem "Android SDK Build-Tools $version"
done
DocumentInstalledItem "Android NDK $(cat ${ANDROID_SDK_ROOT}/ndk-bundle/source.properties 2>&1 | grep Pkg.Revision | cut -d ' ' -f 3)"

View File

@@ -9,11 +9,11 @@
source $HELPER_SCRIPTS/document.sh
# Download latest aws sam cli sources
TarballUrl=$(curl -s https://api.github.com/repos/awslabs/aws-sam-cli/releases/latest | jq -r '.tarball_url')
TarballUrl=$(curl -s https://api.github.com/repos/aws/aws-sam-cli/releases/latest | jq -r '.tarball_url')
TarballPath="/tmp/aws-sam-cli.tar.gz"
wget $TarballUrl -O $TarballPath
tar -xzvf $TarballPath -C /tmp
cd /tmp/awslabs-aws-sam-cli*
cd /tmp/aws-aws-sam-cli*
mkdir /opt/python-aws-sam-cli
cp -r /opt/hostedtoolcache/Python/3.7* /opt/python-aws-sam-cli

View File

@@ -12,8 +12,8 @@ source $HELPER_SCRIPTS/os.sh
if isUbuntu20 ; then
versions=$(pwsh -Command '(Find-Module -Name Az).Version')
else
toolsetJson="$INSTALLER_SCRIPT_FOLDER/toolset.json"
versions=$(cat $toolsetJson | jq -r '.azureModules[] | select(.name | contains("az")) | .versions[]')
toolset="$INSTALLER_SCRIPT_FOLDER/toolset.json"
versions=$(jq -r '.azureModules[] | select(.name | contains("az")) | .versions[]' $toolset)
fi
# Install Azure CLI (instructions taken from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)

View File

@@ -4,90 +4,13 @@
## Desc: Installs basic command line utilities and dev packages
################################################################################
set -e
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/os.sh
set -e
common_packages="dnsutils
iproute2
iputils-ping
libunwind8
locales
openssh-client
tzdata
upx
zstd
libxkbfile-dev
pkg-config
libsecret-1-dev
libxss1
libgconf-2-4
dbus
xvfb
libgbm-dev
libgtk-3-0
tk
fakeroot
dpkg
rpm
xz-utils
xorriso
zsync
gnupg2
lib32z1
texinfo
libsqlite3-dev
libc++-dev
libc++abi-dev"
cmd_packages="curl
file
ftp
jq
netcat
ssh
parallel
rsync
shellcheck
sudo
telnet
time
unzip
zip
wget
m4
bison
flex
patchelf
bzip2
sqlite3
brotli
yamllint"
if isUbuntu20 ; then
echo "Install python2"
apt-get install -y --no-install-recommends python-is-python2
fi
echo "Install libcurl"
if isUbuntu16 || isUbuntu18; then
libcurelVer="libcurl3"
fi
if isUbuntu20 ; then
libcurelVer="libcurl4"
fi
apt-get install -y --no-install-recommends $libcurelVer
# install additional packages only for Ubuntu16.04
if isUbuntu16; then
common_packages="$common_packages
libicu55"
fi
toolset="$INSTALLER_SCRIPT_FOLDER/toolset.json"
common_packages=$(jq -r ".apt.common_packages[]" $toolset)
cmd_packages=$(jq -r ".apt.cmd_packages[]" $toolset)
for package in $common_packages $cmd_packages; do
echo "Install $package"
apt-get install -y --no-install-recommends $package
@@ -108,5 +31,3 @@ DocumentInstalledItem "Basic packages:"
for package in $common_packages $cmd_packages; do
DocumentInstalledItemIndent $package
done
DocumentInstalledItemIndent "$libcurelVer"

View File

@@ -19,3 +19,7 @@ AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache
mkdir $AGENT_TOOLSDIRECTORY
echo "AGENT_TOOLSDIRECTORY=$AGENT_TOOLSDIRECTORY" | tee -a /etc/environment
chmod -R 777 $AGENT_TOOLSDIRECTORY
# https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html
# https://www.suse.com/support/kb/doc/?id=000016692
echo 'vm.max_map_count=262144' | tee -a /etc/sysctl.conf

View File

@@ -3,19 +3,20 @@
## File: docker-moby.sh
## Desc: Installs docker onto the image
################################################################################
set -e
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/install.sh
source $HELPER_SCRIPTS/os.sh
docker_package=moby
# There is no stable docker-moby for Ubuntu 20 at the moment
if isUbuntu20 ; then
add-apt-repository "deb [arch=amd64,armhf,arm64] https://packages.microsoft.com/ubuntu/20.04/prod testing main"
fi
## Check to see if docker is already installed
# Check to see if docker is already installed
docker_package=moby
echo "Determing if Docker ($docker_package) is installed"
if ! IsPackageInstalled $docker_package; then
echo "Docker ($docker_package) was not found. Installing..."
@@ -44,26 +45,17 @@ else
echo "Docker-moby and Docker-buildx checking the successfull"
# Docker daemon takes time to come up after installing
sleep 10
set -e
docker info
set +e
fi
docker pull node:10
docker pull node:12
docker pull buildpack-deps:stretch
docker pull buildpack-deps:buster
docker pull node:10-alpine
docker pull node:12-alpine
docker pull debian:8
docker pull debian:9
docker pull alpine:3.7
docker pull alpine:3.8
docker pull alpine:3.9
docker pull alpine:3.10
docker pull ubuntu:14.04
# Pull images
toolset="$INSTALLER_SCRIPT_FOLDER/toolset.json"
images=$(jq -r '.docker.images[]' $toolset)
for image in $images; do
docker pull "$image"
done
## Add version information to the metadata file
# Add version information to the metadata file
echo "Documenting Docker version"
docker_version=$(docker -v)
DocumentInstalledItem "Docker-Moby ($docker_version)"
@@ -71,3 +63,9 @@ DocumentInstalledItem "Docker-Moby ($docker_version)"
echo "Documenting Docker-buildx version"
DOCKER_BUILDX_VERSION=$(docker buildx version | cut -d ' ' -f2)
DocumentInstalledItem "Docker-Buildx ($DOCKER_BUILDX_VERSION)"
# Add container information to the metadata file
DocumentInstalledItem "Cached container images"
while read -r line; do
DocumentInstalledItemIndent "$line"
done <<< "$(docker images --digests --format '{{.Repository}}:{{.Tag}} (Digest: {{.Digest}})')"

View File

@@ -3,9 +3,11 @@
## File: git.sh
## Desc: Installs Git
################################################################################
set -e
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source "$HELPER_SCRIPTS"/document.sh
source "$HELPER_SCRIPTS"/install.sh
## Install git
add-apt-repository ppa:git-core/ppa -y
@@ -46,7 +48,13 @@ DocumentInstalledItem "Git Large File Storage (LFS) ($(git-lfs --version 2>&1 |
DocumentInstalledItem "Git-ftp ($(git-ftp --version | cut -d ' ' -f 3))"
#Install hub
snap install hub --classic
tmp_hub="/tmp/hub"
mkdir -p "$tmp_hub"
url=$(curl -s https://api.github.com/repos/github/hub/releases/latest | jq -r '.assets[].browser_download_url | select(contains("hub-linux-amd64"))')
download_with_retries "$url" "$tmp_hub"
tar xzvf "$tmp_hub"/hub-linux-amd64-*.tgz --strip-components 1 -C "$tmp_hub"
mv "$tmp_hub"/bin/hub /usr/local/bin
if command -v hub; then
echo "hub CLI was installed successfully"
DocumentInstalledItem "Hub CLI ($(hub --version | grep "hub version" | cut -d ' ' -f 3))"

View File

@@ -10,6 +10,15 @@ source $HELPER_SCRIPTS/os.sh
set -e
function javaTool {
if [[ "$2" =~ ([1]{0,1}.)?$DEFAULT_JDK_VERSION.* ]]; then
echo "$1 $2 is equal to default one $DEFAULT_JDK_VERSION"
else
echo "$1 $2 is not equal to default one $DEFAULT_JDK_VERSION"
exit 1
fi
}
# Install GPG Key for Adopt Open JDK. See https://adoptopenjdk.net/installation.html
wget -qO - "https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public" | apt-key add -
add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
@@ -38,6 +47,11 @@ apt-get -y install adoptopenjdk-8-hotspot=\*
apt-get -y install adoptopenjdk-11-hotspot=\*
# Set Default Java version.
if isUbuntu16; then
# issue: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=825987
# stackoverflow: https://askubuntu.com/questions/1187136/update-java-alternatives-only-java-but-not-javac-is-changed
sed -i 's/(hl|jre|jdk|plugin|DUMMY) /(hl|jre|jdk|jdkhl|plugin|DUMMY) /g' /usr/sbin/update-java-alternatives
fi
update-java-alternatives -s /usr/lib/jvm/adoptopenjdk-${DEFAULT_JDK_VERSION}-hotspot-amd64
echo "JAVA_HOME_8_X64=/usr/lib/jvm/adoptopenjdk-8-hotspot-amd64" | tee -a /etc/environment
@@ -46,7 +60,6 @@ if isUbuntu16 || isUbuntu18 ; then
echo "JAVA_HOME_12_X64=/usr/lib/jvm/adoptopenjdk-12-hotspot-amd64" | tee -a /etc/environment
fi
echo "JAVA_HOME=/usr/lib/jvm/adoptopenjdk-${DEFAULT_JDK_VERSION}-hotspot-amd64" | tee -a /etc/environment
echo "JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8" | tee -a /etc/environment
# Install Ant
apt-fast install -y --no-install-recommends ant ant-optional
@@ -86,6 +99,11 @@ for cmd in gradle java javac mvn ant; do
fi
done
javaVersion=$(java -version |& head -n 1 | cut -d\" -f 2)
javaTool "Java" $javaVersion
javacVersion=$(javac -version |& cut -d" " -f2)
javaTool "Javac" $javacVersion
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
if isUbuntu16 || isUbuntu18 ; then

View File

@@ -24,7 +24,9 @@ curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-
sudo install minikube-linux-amd64 /usr/local/bin/minikube
# Install kustomize
sudo snap install kustomize
download_url="https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
curl -s "$download_url" | bash
mv kustomize /usr/local/bin
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
@@ -58,4 +60,4 @@ 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)"
# kustomize version output has "{} in it". example {kustomize/v3.8.1 2020-07-16T00:58:46Z }
DocumentInstalledItem "kustomize ($(kustomize version --short))"
DocumentInstalledItem "kustomize ($(kustomize version --short))"

View File

@@ -15,7 +15,7 @@ LSB_CODENAME=$(lsb_release -cs)
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu stable-$LSB_CODENAME main" | tee /etc/apt/sources.list.d/mono-official-stable.list
apt-get update
apt-get install -y --no-install-recommends apt-transport-https mono-complete
apt-get install -y --no-install-recommends apt-transport-https mono-complete nuget
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
@@ -23,7 +23,12 @@ if ! command -v mono; then
echo "mono was not installed"
exit 1
fi
if ! command -v nuget; then
echo "nuget was not installed"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Mono ($(mono --version | head -n 1))"
DocumentInstalledItem "NuGet ($(nuget | tail -n +1 | head -n 1))" # Pipe to tail before piping to head because NuGet prints an ugly error if you close its stream before it's done writing.

View File

@@ -9,8 +9,8 @@ source $HELPER_SCRIPTS/document.sh
WriteItem "<!--- DO NOT EDIT - This markdown file is autogenerated. -->"
if [ $ANNOUNCEMENTS ]; then
WriteItem $ANNOUNCEMENTS
if [ -n "$ANNOUNCEMENTS" ]; then
WriteItem "$ANNOUNCEMENTS"
WriteItem "***"
fi

View File

@@ -0,0 +1,26 @@
#!/bin/bash
################################################################################
## File: pulumi.sh
## Desc: Installs Pulumi
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/install.sh
# Install Pulumi
VERSION=$(curl --fail --silent -L "https://www.pulumi.com/latest-version")
TARBALL_URL="https://get.pulumi.com/releases/sdk/pulumi-v${VERSION}-linux-x64.tar.gz"
download_with_retries ${TARBALL_URL} "/tmp" pulumi-v${VERSION}.tar.gz
tar --strip=1 -xvf /tmp/pulumi-v${VERSION}.tar.gz -C /usr/local/bin
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v pulumi ; then
echo "Pulumi was not installed"
exit 1
fi
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Pulumi $(pulumi version)"

View File

@@ -75,8 +75,8 @@ uri="https://downloads.python.org/pypy/"
download_with_retries $uri "/tmp" "pypyUrls.html" compressed
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[]')
toolset="$INSTALLER_SCRIPT_FOLDER/toolset.json"
toolsetVersions=$(jq -r '.toolcache[] | select(.name | contains("PyPy")) | .versions[]' $toolset)
# Fail out if any setups fail
set -e