diff --git a/.buildkite/scripts/install_macos_tools.sh b/.buildkite/scripts/install_macos_tools.sh index c9d27cbc9dbc..124025b4a5ad 100755 --- a/.buildkite/scripts/install_macos_tools.sh +++ b/.buildkite/scripts/install_macos_tools.sh @@ -106,6 +106,28 @@ config_git() { fi } +withNodeJSEnv() { + local version=$1 + echo "~~~ Installing nvm and Node.js" + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash + export NVM_DIR="$HOME/.nvm" + [ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh" + echo "Installing Node.js version: $version" + nvm install "$version" + # export PATH="${nvmPath}:${PATH}" + nvm use "$version" + node --version + echo "~~~ Resuming commands" +} + +installNodeJsDependencies() { + echo "~~~ Installing Node.js packages" + # needed for beats-xpack-heartbeat + echo "Install @elastic/synthetics" + npm i -g @elastic/synthetics + echo "~~~ Resuming commands" +} + add_bin_path with_go "${GO_VERSION}" with_mage