mirror of
https://github.com/actions/runner-images.git
synced 2026-01-06 10:09:20 +08:00
Add Ubuntu-Slim image definition (#13423)
Add ubuntu-slim image definition
This commit is contained in:
22
images/ubuntu-slim/scripts/build/install-nvm.sh
Normal file
22
images/ubuntu-slim/scripts/build/install-nvm.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash -e
|
||||
################################################################################
|
||||
## File: install-nvm.sh
|
||||
## Desc: Install Nvm
|
||||
################################################################################
|
||||
|
||||
# Source the helpers for use with the script
|
||||
source $HELPER_SCRIPTS/etc-environment.sh
|
||||
|
||||
export NVM_DIR="/etc/skel/.nvm"
|
||||
mkdir ${NVM_DIR}
|
||||
nvm_version=$(curl -fsSL https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r '.tag_name')
|
||||
curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/$nvm_version/install.sh | bash
|
||||
set_etc_environment_variable "NVM_DIR" '$HOME/.nvm'
|
||||
|
||||
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' | tee -a /etc/skel/.bash_profile
|
||||
[ -s "${NVM_DIR}/nvm.sh" ] && \. "${NVM_DIR}/nvm.sh"
|
||||
|
||||
echo "source ${NVM_DIR}/nvm.sh" | tee -a /etc/skel/.bashrc
|
||||
|
||||
# set system node.js as default one
|
||||
nvm alias default system
|
||||
Reference in New Issue
Block a user