#!/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;