mirror of
https://github.com/actions/runner-images.git
synced 2025-12-16 06:40:32 +00:00
Merge branch 'master' into v-dmshib/update-gem-latest
This commit is contained in:
@@ -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 "***"
|
||||
|
||||
@@ -10,9 +10,6 @@ source $HELPER_SCRIPTS/apt.sh
|
||||
|
||||
set -e
|
||||
|
||||
echo "Install curl"
|
||||
apt-get install -y --no-install-recommends curl
|
||||
|
||||
echo "Install dnsutils"
|
||||
apt-get install -y --no-install-recommends dnsutils
|
||||
|
||||
|
||||
@@ -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/ubuntu-1804 \
|
||||
--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;
|
||||
@@ -7,6 +7,6 @@
|
||||
|
||||
source $HELPER_SCRIPTS/document.sh
|
||||
|
||||
AddTitle "Hosted Ubuntu 1804 Image ($(lsb_release -ds))"
|
||||
WriteItem "The following software is installed on machines in the Hosted Ubuntu 1804 (v$IMAGE_VERSION) pool"
|
||||
AddTitle "$(lsb_release -ds)"
|
||||
WriteItem "The following software is installed on machines with the $IMAGE_VERSION update."
|
||||
WriteItem "***"
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
# Source the helpers for use with the script
|
||||
source $HELPER_SCRIPTS/document.sh
|
||||
|
||||
BOOST_ZIP_PATH=/opt/hostedtoolcache/Boost
|
||||
BOOST_LIB=/usr/local/share/boost
|
||||
|
||||
# Install Boost
|
||||
@@ -15,9 +14,6 @@ for BOOST_VERSION in ${BOOST_VERSIONS//,/ }
|
||||
do
|
||||
BOOST_SYMLINK_VER=`echo "${BOOST_VERSION//[.]/_}"`
|
||||
BOOST_ROOT="BOOST_ROOT_$BOOST_SYMLINK_VER"
|
||||
BOOST_ZIP="boost_`echo $BOOST_VERSION`_gcc.zip"
|
||||
|
||||
unzip $BOOST_ZIP_PATH/$BOOST_ZIP -d $BOOST_LIB
|
||||
|
||||
echo "$BOOST_ROOT=$BOOST_LIB/$BOOST_VERSION" | tee -a /etc/environment
|
||||
if [[ $BOOST_VERSION == $BOOST_DEFAULT ]]; then
|
||||
@@ -26,6 +22,3 @@ do
|
||||
|
||||
DocumentInstalledItem "Boost C++ Libraries $BOOST_VERSION"
|
||||
done
|
||||
|
||||
# Deleting archives with Boost Libraries
|
||||
rm -rf $BOOST_ZIP_PATH
|
||||
|
||||
@@ -28,4 +28,4 @@ done
|
||||
|
||||
# Document what was added to the image
|
||||
echo "Lastly, documenting what we added to the metadata file"
|
||||
DocumentInstalledItem "Clang 6.0 ($(clang-6.0 --version | head -n 1))"
|
||||
DocumentInstalledItem "Clang 6.0 ($(clang-6.0 --version | head -n 1 | sed 's/~/\\~/g'))"
|
||||
|
||||
@@ -12,7 +12,7 @@ echo "Checking to see if the installer script has already been run"
|
||||
if command -v cmake; then
|
||||
echo "Example variable already set to $EXAMPLE_VAR"
|
||||
else
|
||||
curl -sL https://cmake.org/files/v3.12/cmake-3.12.4-Linux-x86_64.sh -o cmakeinstall.sh \
|
||||
curl -sL https://cmake.org/files/v3.16/cmake-3.16.2-Linux-x86_64.sh -o cmakeinstall.sh \
|
||||
&& chmod +x cmakeinstall.sh \
|
||||
&& ./cmakeinstall.sh --prefix=/usr/local --exclude-subdir \
|
||||
&& rm cmakeinstall.sh
|
||||
|
||||
@@ -43,6 +43,7 @@ CHROMEDRIVER_BIN="/usr/bin/chromedriver"
|
||||
mv "chromedriver" $CHROMEDRIVER_BIN
|
||||
chown root:root $CHROMEDRIVER_BIN
|
||||
chmod +x $CHROMEDRIVER_BIN
|
||||
echo "CHROMEWEBDRIVER=$CHROMEDRIVER_BIN" | tee -a /etc/environment
|
||||
|
||||
# Run tests to determine that the chromedriver installed as expected
|
||||
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
||||
@@ -52,7 +53,7 @@ if ! command -v chromedriver; then
|
||||
fi
|
||||
|
||||
echo "Lastly, documenting what we added to the metadata file"
|
||||
DocumentInstalledItem "Chromedriver ($(chromedriver --version))"
|
||||
DocumentInstalledItem "Chromedriver ($(chromedriver --version)); Chrome Driver is available via CHROMEWEBDRIVER environment variable"
|
||||
|
||||
# Determine latest selenium standalone server version
|
||||
SELENIUM_LATEST_VERSION_URL=https://api.github.com/repos/SeleniumHQ/selenium/releases/latest
|
||||
@@ -61,7 +62,7 @@ SELENIUM_VERSION_MAJOR_MINOR=$(echo $SELENIUM_VERSION | cut -d '.' -f 1,2)
|
||||
|
||||
# Download selenium standalone server
|
||||
echo "Downloading selenium-server-standalone v$SELENIUM_VERSION..."
|
||||
SELENIUM_JAR_NAME=selenium-server-standalone-$SELENIUM_VERSION.jar
|
||||
SELENIUM_JAR_NAME="selenium-server-standalone-$SELENIUM_VERSION.jar"
|
||||
wget https://selenium-release.storage.googleapis.com/$SELENIUM_VERSION_MAJOR_MINOR/$SELENIUM_JAR_NAME
|
||||
|
||||
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
||||
@@ -70,8 +71,9 @@ if [ ! -f "$SELENIUM_JAR_NAME" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mv "selenium-server-standalone-$SELENIUM_VERSION.jar" "/usr/share/java/selenium-server-standalone.jar"
|
||||
echo "CLASSPATH=/usr/share/java/selenium-server-standalone.jar:.:$CLASSPATH" | tee -a /etc/environment
|
||||
SELENIUM_JAR_PATH="/usr/share/java/selenium-server-standalone.jar"
|
||||
mv $SELENIUM_JAR_NAME $SELENIUM_JAR_PATH
|
||||
echo "SELENIUM_JAR_PATH=$SELENIUM_JAR_PATH" | tee -a /etc/environment
|
||||
|
||||
echo "Lastly, documenting what we added to the metadata file"
|
||||
DocumentInstalledItem "Selenium server standalone"
|
||||
DocumentInstalledItem "Selenium server standalone (available via SELENIUM_JAR_PATH environment variable)"
|
||||
|
||||
@@ -10,21 +10,23 @@ source $HELPER_SCRIPTS/document.sh
|
||||
# Fail out if any setups fail
|
||||
set -e
|
||||
|
||||
# Download hosted tool cache
|
||||
AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache
|
||||
mkdir $AGENT_TOOLSDIRECTORY
|
||||
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;
|
||||
chmod -R 777 $AGENT_TOOLSDIRECTORY
|
||||
|
||||
echo "Installing npm-toolcache..."
|
||||
TOOLSET_PATH="$INSTALLER_SCRIPT_FOLDER/toolcache.json"
|
||||
|
||||
PACKAGE_LIST=($(jq -r 'keys | .[]' $TOOLSET_PATH))
|
||||
|
||||
for PACKAGE_NAME in ${PACKAGE_LIST[@]}; do
|
||||
PACKAGE_VERSIONS=($(jq -r ".[\"$PACKAGE_NAME\"] | .[]" $TOOLSET_PATH))
|
||||
for PACKAGE_VERSION in ${PACKAGE_VERSIONS[@]}; do
|
||||
echo "Install ${PACKAGE_NAME}@${PACKAGE_VERSION}"
|
||||
npm install ${PACKAGE_NAME}@${PACKAGE_VERSION} --registry=${TOOLCACHE_REGISTRY}
|
||||
done;
|
||||
done;
|
||||
|
||||
DocumentInstalledItem "Python:"
|
||||
@@ -33,22 +35,14 @@ 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;
|
||||
done;
|
||||
|
||||
DocumentInstalledItem "PyPy:"
|
||||
pypys=$(ls $AGENT_TOOLSDIRECTORY/PyPy)
|
||||
for pypy in $pypys; do
|
||||
DocumentInstalledItemIndent "PyPy $pypy"
|
||||
done;
|
||||
@@ -6,65 +6,69 @@
|
||||
|
||||
# Must be procecessed after tool cache setup(hosted-tool-cache.sh).
|
||||
|
||||
Test_Hostedtoolcache_Tool() {
|
||||
TOOL_NAME=$1
|
||||
TOOL_EXEC_TEST=$2
|
||||
|
||||
if [ -d "$AGENT_TOOLSDIRECTORY/$TOOL_NAME" ]; then
|
||||
cd $AGENT_TOOLSDIRECTORY/$TOOL_NAME
|
||||
|
||||
tool_dirs=($(find . -mindepth 1 -maxdepth 1 -type d | sed "s|^\./||"))
|
||||
|
||||
echo "--------------------------------------------"
|
||||
echo "$TOOL_NAME versions folders: ${tool_dirs[@]}"
|
||||
echo "--------------------------------------------"
|
||||
|
||||
if [ -n "$tool_dirs" ]; then
|
||||
tool_key=$(echo $TOOL_NAME | tr "[:upper:]" "[:lower:]")
|
||||
package_versions=($(jq -r ".[\"${TOOLCACHE_KEY_VALUE[$tool_key]}\"] | .[]" "$INSTALLER_SCRIPT_FOLDER/toolcache.json"))
|
||||
|
||||
for tool_version in ${package_versions[@]}
|
||||
do
|
||||
version_dir=$(find . -name "$tool_version.*" -print -quit)
|
||||
|
||||
echo "Test $AGENT_TOOLSDIRECTORY/$TOOL_NAME/$version_dir:"
|
||||
|
||||
actual_version=$(eval $AGENT_TOOLSDIRECTORY/$TOOL_NAME/$version_dir/$TOOL_EXEC_TEST)
|
||||
|
||||
if [ "$actual_version" = "$tool_version" ]; then
|
||||
echo "Passed!"
|
||||
else
|
||||
echo "Expected: $tool_version; Actual: $actual_version"
|
||||
|
||||
exit 1
|
||||
fi
|
||||
done;
|
||||
else
|
||||
echo "$AGENT_TOOLSDIRECTORY/$tool_version does not include any folders"
|
||||
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "$AGENT_TOOLSDIRECTORY/$tool_version does not exist"
|
||||
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Fail out if any tests fail
|
||||
set -e
|
||||
|
||||
# define dictionary for key_alias and its values
|
||||
declare -A TOOLCACHE_KEY_VALUE
|
||||
|
||||
package_list=($(jq -r 'keys | .[]' "$INSTALLER_SCRIPT_FOLDER/toolcache.json"))
|
||||
|
||||
for package_name in ${package_list[@]}; do
|
||||
# get key alias
|
||||
key_alias=$(echo $package_name | cut -f2 -d-)
|
||||
|
||||
# set dictionary
|
||||
TOOLCACHE_KEY_VALUE+=(["$key_alias"]="$package_name")
|
||||
done;
|
||||
|
||||
AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache
|
||||
|
||||
# Python test
|
||||
if [ -d "$AGENT_TOOLSDIRECTORY/Python" ]; then
|
||||
cd $AGENT_TOOLSDIRECTORY/Python
|
||||
python_dirs=($(find . -mindepth 1 -maxdepth 1 -type d | sed "s|^\./||"))
|
||||
echo "Python versions folders: ${python_dirs[@]}"
|
||||
echo "------------------------------------------"
|
||||
if [ -n "$python_dirs" ]; then
|
||||
for version_dir in "${python_dirs[@]}"
|
||||
do
|
||||
echo "Test $AGENT_TOOLSDIRECTORY/Python/$version_dir:"
|
||||
expected_ver=$(echo $version_dir | egrep -o '[0-9]+\.[0-9]+')
|
||||
actual_ver=$($AGENT_TOOLSDIRECTORY/Python/$version_dir/x64/python -c 'import sys;print(sys.version)'| head -1 | egrep -o '[0-9]+\.[0-9]+')
|
||||
|
||||
if [ "$expected_ver" = "$actual_ver" ]; then
|
||||
echo "Passed!"
|
||||
else
|
||||
echo "Expected: $expected_ver; Actual: $actual_ver"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "$AGENT_TOOLSDIRECTORY/Python does not include any folders"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "$AGENT_TOOLSDIRECTORY/Python does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ruby test
|
||||
if [ -d "$AGENT_TOOLSDIRECTORY/Ruby" ]; then
|
||||
cd $AGENT_TOOLSDIRECTORY/Ruby
|
||||
ruby_dirs=($(find . -mindepth 1 -maxdepth 1 -type d | sed "s|^\./||"))
|
||||
echo "Ruby versions folders: ${ruby_dirs[@]}"
|
||||
echo "--------------------------------------"
|
||||
if [ -n "$ruby_dirs" ]; then
|
||||
for version_dir in "${ruby_dirs[@]}"
|
||||
do
|
||||
echo "Test $AGENT_TOOLSDIRECTORY/Ruby/$version_dir:"
|
||||
expected_ver=$(echo $version_dir | egrep -o '[0-9]+\.[0-9]+')
|
||||
actual_ver=$($AGENT_TOOLSDIRECTORY/Ruby/$version_dir/x64/bin/ruby -e "puts RUBY_VERSION" | egrep -o '[0-9]+\.[0-9]+')
|
||||
|
||||
if [ "$expected_ver" = "$actual_ver" ]; then
|
||||
echo "Passed!"
|
||||
else
|
||||
echo "Expected: $expected_ver; Actual: $actual_ver"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "$AGENT_TOOLSDIRECTORY/Ruby does not include any folders"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "$AGENT_TOOLSDIRECTORY/Ruby does not exist"
|
||||
exit 1
|
||||
fi
|
||||
Test_Hostedtoolcache_Tool "Python" "x64/python -c 'import sys;print(sys.version)'| head -1 | egrep -o '[0-9]+\.[0-9]+'"
|
||||
Test_Hostedtoolcache_Tool "Ruby" "x64/bin/ruby -e 'puts RUBY_VERSION' | egrep -o '[0-9]+\.[0-9]+'"
|
||||
Test_Hostedtoolcache_Tool "PyPy" "x64/bin/python -c 'import sys;print(sys.version)'| head -1 | egrep -o '[0-9]+\.[0-9]+' | cut -d '.' -f 1"
|
||||
|
||||
Reference in New Issue
Block a user