mirror of
https://github.com/actions/runner-images.git
synced 2025-12-11 11:37:00 +00:00
Inital commit.
This commit is contained in:
40
images/linux/scripts/installers/1604/hosted-tool-cache.sh
Normal file
40
images/linux/scripts/installers/1604/hosted-tool-cache.sh
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/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 (available through the [setup-python](https://github.com/actions/setup-python/blob/master/README.md) task)"
|
||||
pythons=$(ls $AGENT_TOOLSDIRECTORY/Python)
|
||||
for python in $pythons; do
|
||||
DocumentInstalledItemIndent "Python $python"
|
||||
done;
|
||||
|
||||
DocumentInstalledItem "Ruby (available through the [setup-ruby](https://github.com/actions/setup-ruby/blob/master/README.md) task)"
|
||||
rubys=$(ls $AGENT_TOOLSDIRECTORY/Ruby)
|
||||
for ruby in $rubys; do
|
||||
DocumentInstalledItemIndent "Ruby $ruby"
|
||||
done;
|
||||
Reference in New Issue
Block a user