mirror of
https://github.com/actions/runner-images.git
synced 2025-12-19 00:06:57 +00:00
Add Ubuntu-Slim image definition (#13423)
Add ubuntu-slim image definition
This commit is contained in:
29
images/ubuntu-slim/scripts/build/install-nodejs.sh
Normal file
29
images/ubuntu-slim/scripts/build/install-nodejs.sh
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash -e
|
||||
################################################################################
|
||||
## File: install-nodejs.sh
|
||||
## Desc: Install Node.js LTS and related tooling (Gulp, Grunt)
|
||||
################################################################################
|
||||
|
||||
# Source the helpers for use with the script
|
||||
source $HELPER_SCRIPTS/install.sh
|
||||
|
||||
# Install default Node.js
|
||||
default_version=$(get_toolset_value '.node.default')
|
||||
|
||||
curl -fsSL https://raw.githubusercontent.com/tj/n/master/bin/n -o ~/n
|
||||
sudo bash ~/n $default_version
|
||||
|
||||
# Install node modules
|
||||
node_modules=$(get_toolset_value '.node_modules[].name')
|
||||
if [ -n "$node_modules" ]; then
|
||||
npm install -g $node_modules
|
||||
else
|
||||
echo "No node modules to install"
|
||||
fi
|
||||
|
||||
# fix global modules installation as regular user
|
||||
# related issue https://github.com/actions/runner-images/issues/3727
|
||||
sudo chmod -R 777 /usr/local/lib/node_modules
|
||||
sudo chmod -R 777 /usr/local/bin
|
||||
|
||||
rm -rf ~/n
|
||||
Reference in New Issue
Block a user