mirror of
https://ops.gitlab.net/gitlab-org/gitlab-build-images.git
synced 2025-12-09 10:02:56 +01:00
bullseye is the latest stable, and this is what we will be using for Cloud Native GitLab going forward so we should test with this. Since an upgrade of the operating system may break pre-compiled C extensions, we now introduce a DEBIAN environment flag that defaults to the legacy buster install but allows us to roll out a bullseye image with `debian-bullseye` as the image name prefix.
26 lines
717 B
Bash
Executable file
26 lines
717 B
Bash
Executable file
#!/bin/bash
|
|
set -xeuo pipefail
|
|
IFS=$'\n\t'
|
|
|
|
NODE_INSTALL_VERSION=${1:-14.16.0}
|
|
YARN_INSTALL_VERSION=${2:-1.22.10}
|
|
|
|
# Map MAJOR.MINOR.patch -> MAJOR.x
|
|
NODE_MAJOR=`echo $NODE_INSTALL_VERSION | sed -r -e "s/([0-9]+)\.[0-9]+.*/\1\.x/g"`
|
|
|
|
# add official debian repos for node
|
|
curl -sS -L https://deb.nodesource.com/setup_${NODE_MAJOR} | bash -
|
|
|
|
apt-get update
|
|
|
|
NODE_FILE_NAME="nodejs_$NODE_INSTALL_VERSION-deb-1nodesource1_amd64.deb"
|
|
curl -s -O "https://deb.nodesource.com/node_$NODE_MAJOR/pool/main/n/nodejs/$NODE_FILE_NAME"
|
|
dpkg -i "$NODE_FILE_NAME"
|
|
rm -f "$NODE_FILE_NAME"
|
|
|
|
npm install --global yarn@${YARN_INSTALL_VERSION}
|
|
npm cache clean --force
|
|
|
|
apt-get autoremove -yq
|
|
apt-get clean -yqq
|
|
rm -rf /var/lib/apt/lists/*
|