From 9b1143ddddc87e3924cc36a7cefc3d14c4bf10cb Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Sat, 9 May 2020 04:31:49 +0000 Subject: [PATCH] Add nodejs tool cache for linux. (#839) * add nodejs * 4 node versions Co-authored-by: Dmitry Shibanov --- images/linux/scripts/installers/Install-Toolset.ps1 | 3 ++- images/linux/scripts/installers/Validate-Toolset.ps1 | 5 ++++- images/linux/toolset-1604.json | 12 ++++++++++++ images/linux/toolset-1804.json | 12 ++++++++++++ images/linux/ubuntu1604.json | 12 ++++++------ images/linux/ubuntu1804.json | 12 ++++++------ 6 files changed, 42 insertions(+), 14 deletions(-) diff --git a/images/linux/scripts/installers/Install-Toolset.ps1 b/images/linux/scripts/installers/Install-Toolset.ps1 index 518a1f9b..b6e4abbd 100644 --- a/images/linux/scripts/installers/Install-Toolset.ps1 +++ b/images/linux/scripts/installers/Install-Toolset.ps1 @@ -52,4 +52,5 @@ foreach ($tool in $tools) { } } -chown -R "$($env:SUDO_USER):$($env:SUDO_USER)" /opt/hostedtoolcache/Python \ No newline at end of file +chown -R "$($env:SUDO_USER):$($env:SUDO_USER)" /opt/hostedtoolcache/Python +chown -R "$($env:SUDO_USER):$($env:SUDO_USER)" /opt/hostedtoolcache/node \ No newline at end of file diff --git a/images/linux/scripts/installers/Validate-Toolset.ps1 b/images/linux/scripts/installers/Validate-Toolset.ps1 index 13847465..e0b42b64 100644 --- a/images/linux/scripts/installers/Validate-Toolset.ps1 +++ b/images/linux/scripts/installers/Validate-Toolset.ps1 @@ -26,7 +26,10 @@ function Run-ExecutableTests { $ErrorActionPreference = "Stop" # Define executables for cached tools -$toolsExecutables = @{ Python = @("python", "bin/pip") } +$toolsExecutables = @{ + Python = @("python", "bin/pip"); + node = @("bin/node", "bin/npm") +} # Get toolset content $toolsetJson = Get-Content -Path "$env:INSTALLER_SCRIPT_FOLDER/toolset.json" -Raw diff --git a/images/linux/toolset-1604.json b/images/linux/toolset-1604.json index e3953f81..23393b66 100644 --- a/images/linux/toolset-1604.json +++ b/images/linux/toolset-1604.json @@ -13,6 +13,18 @@ "3.7.*", "3.8.*" ] + }, + { + "name": "node", + "url" : "https://raw.githubusercontent.com/actions/node-versions/master/versions-manifest.json", + "platform" : "linux", + "arch": "x64", + "versions": [ + "8.*", + "10.*", + "12.*", + "14.*" + ] } ] } \ No newline at end of file diff --git a/images/linux/toolset-1804.json b/images/linux/toolset-1804.json index a854ae6b..188062c4 100644 --- a/images/linux/toolset-1804.json +++ b/images/linux/toolset-1804.json @@ -13,6 +13,18 @@ "3.7.*", "3.8.*" ] + }, + { + "name": "node", + "url" : "https://raw.githubusercontent.com/actions/node-versions/master/versions-manifest.json", + "platform" : "linux", + "arch": "x64", + "versions": [ + "8.*", + "10.*", + "12.*", + "14.*" + ] } ] } \ No newline at end of file diff --git a/images/linux/ubuntu1604.json b/images/linux/ubuntu1604.json index b4c1846c..fc47d0e9 100644 --- a/images/linux/ubuntu1604.json +++ b/images/linux/ubuntu1604.json @@ -324,12 +324,6 @@ ], "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" }, - { - "type": "shell", - "scripts":[ - "{{template_dir}}/scripts/installers/validate-disk-space.sh" - ] - }, { "type": "file", "source": "{{user `metadata_file`}}", @@ -345,6 +339,12 @@ ], "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" }, + { + "type": "shell", + "scripts":[ + "{{template_dir}}/scripts/installers/validate-disk-space.sh" + ] + }, { "type": "file", "source": "{{template_dir}}/config/ubuntu1604.conf", diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index 51a6ff9a..2471106f 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -328,12 +328,6 @@ ], "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" }, - { - "type": "shell", - "scripts":[ - "{{template_dir}}/scripts/installers/validate-disk-space.sh" - ] - }, { "type": "file", "source": "{{user `metadata_file`}}", @@ -349,6 +343,12 @@ ], "execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'" }, + { + "type": "shell", + "scripts":[ + "{{template_dir}}/scripts/installers/validate-disk-space.sh" + ] + }, { "type": "file", "source": "{{template_dir}}/config/ubuntu1804.conf",