mirror of
https://github.com/actions/runner-images.git
synced 2025-12-19 00:06:57 +00:00
Switch Linux toolcache to GitHub package registry (#316)
* Switch toolcache to GitHub package registry * Add Execute in /tmp & show failure code * Added boost 1.72 & tmp folder parameters * Change "github_feed_token" to "null"
This commit is contained in:
@@ -10,12 +10,23 @@ source $HELPER_SCRIPTS/document.sh
|
||||
# Fail out if any setups fail
|
||||
set -e
|
||||
|
||||
TOOLCACHE_REGISTRY="npm.pkg.github.com"
|
||||
|
||||
AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache
|
||||
mkdir $AGENT_TOOLSDIRECTORY
|
||||
echo "AGENT_TOOLSDIRECTORY=$AGENT_TOOLSDIRECTORY" | tee -a /etc/environment
|
||||
|
||||
chmod -R 777 $AGENT_TOOLSDIRECTORY
|
||||
|
||||
echo "Configure npm to use github package registry for '@actions' scope"
|
||||
npm config set @actions:registry "https://${TOOLCACHE_REGISTRY}"
|
||||
|
||||
# Execute in /imagegeneration/installers folder to avoid node_modules creation in $HOME
|
||||
pushd $INSTALLER_SCRIPT_FOLDER
|
||||
|
||||
# GitHub Package Registry doesn't support downloading public packages without auth so we have to authorize
|
||||
echo "Configure auth for github package registry"
|
||||
echo "//${TOOLCACHE_REGISTRY}/:_authToken=${GITHUB_FEED_TOKEN}" > ".npmrc"
|
||||
|
||||
echo "Installing npm-toolcache..."
|
||||
TOOLSET_PATH="$INSTALLER_SCRIPT_FOLDER/toolcache.json"
|
||||
|
||||
@@ -25,10 +36,19 @@ 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}
|
||||
npm install ${PACKAGE_NAME}@${PACKAGE_VERSION}
|
||||
|
||||
exit_code=$?
|
||||
if [ $exit_code -ne 0 ]; then
|
||||
echo "${PACKAGE_NAME}@${PACKAGE_VERSION} installation failure; Error:${exit_code}"
|
||||
|
||||
exit 1
|
||||
fi
|
||||
done;
|
||||
done;
|
||||
|
||||
popd
|
||||
|
||||
DocumentInstalledItem "Python:"
|
||||
pythons=$(ls $AGENT_TOOLSDIRECTORY/Python)
|
||||
for python in $pythons; do
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{
|
||||
"toolcache-python-ubuntu-1604-x64": [
|
||||
"@actions/toolcache-python-ubuntu-1604-x64": [
|
||||
"2.7", "3.5", "3.6", "3.7", "3.8"
|
||||
],
|
||||
"toolcache-ruby-ubuntu-1604-x64": [
|
||||
"@actions/toolcache-ruby-ubuntu-1604-x64": [
|
||||
"2.4", "2.5", "2.6", "2.7"
|
||||
],
|
||||
"toolcache-pypy-ubuntu-1604-x64": [
|
||||
"@actions/toolcache-pypy-ubuntu-1604-x64": [
|
||||
"2", "3"
|
||||
],
|
||||
"toolcache-boost-ubuntu-1604-x64": [
|
||||
"1.69"
|
||||
"@actions/toolcache-boost-ubuntu-1604-x64": [
|
||||
"1.69", "1.72"
|
||||
]
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
{
|
||||
"toolcache-python-ubuntu-1804-x64": [
|
||||
"@actions/toolcache-python-ubuntu-1804-x64": [
|
||||
"2.7", "3.5", "3.6", "3.7", "3.8"
|
||||
],
|
||||
"toolcache-ruby-ubuntu-1804-x64": [
|
||||
"@actions/toolcache-ruby-ubuntu-1804-x64": [
|
||||
"2.4", "2.5", "2.6", "2.7"
|
||||
],
|
||||
"toolcache-pypy-ubuntu-1804-x64": [
|
||||
"@actions/toolcache-pypy-ubuntu-1804-x64": [
|
||||
"2", "3"
|
||||
],
|
||||
"toolcache-boost-ubuntu-1804-x64": [
|
||||
"1.69"
|
||||
"@actions/toolcache-boost-ubuntu-1804-x64": [
|
||||
"1.69", "1.72"
|
||||
]
|
||||
}
|
||||
@@ -21,9 +21,9 @@
|
||||
"vm_size": "Standard_DS2_v2",
|
||||
"capture_name_prefix": "packer",
|
||||
"image_version": "dev",
|
||||
"toolcache_registry": "https://buildcanary.pkgs.visualstudio.com/PipelineCanary/_packaging/hostedtoolcache/npm/registry/"
|
||||
"github_feed_token": null
|
||||
},
|
||||
"sensitive-variables": ["client_secret"],
|
||||
"sensitive-variables": ["client_secret", "github_feed_token"],
|
||||
"builders": [
|
||||
{
|
||||
"type": "azure-arm",
|
||||
@@ -187,8 +187,8 @@
|
||||
"environment_vars": [
|
||||
"METADATA_FILE={{user `metadata_file`}}",
|
||||
"HELPER_SCRIPTS={{user `helper_script_folder`}}",
|
||||
"TOOLCACHE_REGISTRY={{user `toolcache_registry`}}",
|
||||
"INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}"
|
||||
"INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}",
|
||||
"GITHUB_FEED_TOKEN={{user `github_feed_token`}}"
|
||||
],
|
||||
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
||||
},
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
"vm_size": "Standard_DS2_v2",
|
||||
"capture_name_prefix": "packer",
|
||||
"image_version": "dev",
|
||||
"toolcache_registry": "https://buildcanary.pkgs.visualstudio.com/PipelineCanary/_packaging/hostedtoolcache/npm/registry/"
|
||||
"github_feed_token": null
|
||||
},
|
||||
"sensitive-variables": ["client_secret"],
|
||||
"sensitive-variables": ["client_secret", "github_feed_token"],
|
||||
"builders": [
|
||||
{
|
||||
"type": "azure-arm",
|
||||
@@ -190,8 +190,8 @@
|
||||
"environment_vars": [
|
||||
"METADATA_FILE={{user `metadata_file`}}",
|
||||
"HELPER_SCRIPTS={{user `helper_script_folder`}}",
|
||||
"TOOLCACHE_REGISTRY={{user `toolcache_registry`}}",
|
||||
"INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}"
|
||||
"INSTALLER_SCRIPT_FOLDER={{user `installer_script_folder`}}",
|
||||
"GITHUB_FEED_TOKEN={{user `github_feed_token`}}"
|
||||
],
|
||||
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user