30 lines
792 B
Bash
Executable File
30 lines
792 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euxo pipefail
|
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
|
|
apt-get update
|
|
apt-get dist-upgrade -y
|
|
apt-get install -y curl gnupg lsb-release
|
|
|
|
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
|
|
curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
|
|
|
|
ubuntu_ver="$(lsb_release -rs)"
|
|
ubuntu_name="$(lsb_release -cs)"
|
|
|
|
node_repo="$(curl -sS https://deb.nodesource.com/setup_current.x | grep NODEREPO= | grep -Eo 'node_[0-9]+\.x' | head -n1)"
|
|
|
|
tee -a /etc/apt/sources.list.d/custom.list >/dev/null <<EOF
|
|
deb [arch=amd64] https://deb.nodesource.com/${node_repo} ${ubuntu_name} main
|
|
deb [arch=amd64] https://dl.yarnpkg.com/debian/ stable main
|
|
EOF
|
|
|
|
apt-get update
|
|
apt-get install -y make nodejs yarn
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
rm "$0"
|