-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
hosted-tool-cache.sh
40 lines (34 loc) · 1.39 KB
/
hosted-tool-cache.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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;