Merge branch 'master' into add-parallel-on-linux

This commit is contained in:
RammusXu
2020-02-03 09:43:20 +08:00
committed by GitHub
62 changed files with 2336 additions and 1755 deletions

View File

@@ -32,6 +32,7 @@ apt-fast install -y --no-install-recommends \
telnet \
time \
unzip \
upx \
wget \
zip \
tzdata
@@ -55,7 +56,7 @@ apt-fast install -y --no-install-recommends \
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
for cmd in curl file ftp jq netcat ssh parallel rsync shellcheck sudo telnet time unzip wget zip; do
for cmd in curl file ftp jq netcat ssh parallel rsync shellcheck sudo telnet time unzip upx wget zip; do
if ! command -v $cmd; then
echo "$cmd was not installed"
exit 1
@@ -85,6 +86,7 @@ DocumentInstalledItemIndent "sudo"
DocumentInstalledItemIndent "telnet"
DocumentInstalledItemIndent "time"
DocumentInstalledItemIndent "unzip"
DocumentInstalledItemIndent "upx"
DocumentInstalledItemIndent "wget"
DocumentInstalledItemIndent "zip"
DocumentInstalledItemIndent "tzdata"

View File

@@ -7,7 +7,7 @@
source $HELPER_SCRIPTS/apt.sh
source $HELPER_SCRIPTS/document.sh
LATEST_DOTNET_PACKAGE=dotnet-sdk-3.0
LATEST_DOTNET_PACKAGES=("dotnet-sdk-3.0" "dotnet-sdk-3.1")
LSB_RELEASE=$(lsb_release -rs)
@@ -30,21 +30,23 @@ mksamples()
set -e
echo "Determing if .NET Core ($LATEST_DOTNET_PACKAGE) is installed"
if ! IsInstalled $LATEST_DOTNET_PACKAGE; then
echo "Could not find .NET Core ($LATEST_DOTNET_PACKAGE), installing..."
wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb
apt-get update
apt-get install apt-transport-https
apt-get update
apt-get install $LATEST_DOTNET_PACKAGE
else
echo ".NET Core ($LATEST_DOTNET_PACKAGE) is already installed"
fi
for latest_package in ${LATEST_DOTNET_PACKAGES[@]}; do
echo "Determing if .NET Core ($latest_package) is installed"
if ! IsInstalled $latest_package; then
echo "Could not find .NET Core ($latest_package), installing..."
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-bionic-prod bionic main" > /etc/apt/sources.list.d/dotnetdev.list'
apt-get install apt-transport-https
apt-get update
apt-get install $latest_package -y
else
echo ".NET Core ($latest_package) is already installed"
fi
done
# Get list of all released SDKs from channels which are not end-of-life or preview
release_urls=("https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/2.1/releases.json" "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/2.2/releases.json" "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/2.1/releases.json")
release_urls=("https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/2.1/releases.json" "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/2.2/releases.json" "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/3.0/releases.json" "https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/3.1/releases.json")
sdks=()
for release_url in ${release_urls[@]}; do
echo "${release_url}"

View File

@@ -1,54 +0,0 @@
#!/bin/bash
################################################################################
## File: hosted-tool-cache.sh
## Desc: Downloads and installs hosted tools cache
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
# Fail out if any setups fail
set -e
# Download hosted tool cache
AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache
echo "AGENT_TOOLSDIRECTORY=$AGENT_TOOLSDIRECTORY" | tee -a /etc/environment
azcopy --recursive \
--source https://vstsagenttools.blob.core.windows.net/tools/hostedtoolcache/linux \
--destination $AGENT_TOOLSDIRECTORY
# Install tools from hosted tool cache
original_directory=$PWD
setups=$(find $AGENT_TOOLSDIRECTORY -name setup.sh)
for setup in $setups; do
chmod +x $setup;
cd $(dirname $setup);
./$(basename $setup);
cd $original_directory;
done;
DocumentInstalledItem "Python:"
pythons=$(ls $AGENT_TOOLSDIRECTORY/Python)
for python in $pythons; do
DocumentInstalledItemIndent "Python $python"
done;
# PyPy is also configured using the setup-python action
pypys=$(ls $AGENT_TOOLSDIRECTORY/PyPy)
for pypy in $pypys; do
DocumentInstalledItemIndent "PyPy $pypy"
# Add symlinks for pypy2 and pypy3 to usr/local/bin, there should only be 2 versions of PyPy in the tools cache that is downloaded
if [ ${pypy:0:1} -eq "3" ] ; then
# add pypy 3.X to PATH
ln -s $AGENT_TOOLSDIRECTORY/PyPy/$pypy/x64/bin/pypy3 /usr/local/bin/pypy3
else
# add pypy 2.X to PATH
ln -s $AGENT_TOOLSDIRECTORY/PyPy/$pypy/x64/bin/pypy /usr/local/bin/pypy
fi
done;
DocumentInstalledItem "Ruby:"
rubys=$(ls $AGENT_TOOLSDIRECTORY/Ruby)
for ruby in $rubys; do
DocumentInstalledItemIndent "Ruby $ruby"
done;

View File

@@ -7,6 +7,6 @@
source $HELPER_SCRIPTS/document.sh
AddTitle "Hosted Ubuntu 1604 Image ($(lsb_release -ds))"
WriteItem "The following software is installed on machines in the Hosted Ubuntu 1604 ($IMAGE_VERSION) pool"
AddTitle "$(lsb_release -ds)"
WriteItem "The following software is installed on machines with the $IMAGE_VERSION update."
WriteItem "***"