From 7225b68e46173350954beb418ecd43e9eca4d179 Mon Sep 17 00:00:00 2001 From: Ernesto Puerta Date: Thu, 13 Jan 2022 17:21:12 +0100 Subject: [PATCH] qa/dashboard: ensure node 16 is installed For Ubuntu: https://github.com/nodesource/distributions#manual-installation Fixes: https://tracker.ceph.com/issues/53843 Signed-off-by: Ernesto Puerta --- qa/workunits/cephadm/test_dashboard_e2e.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/qa/workunits/cephadm/test_dashboard_e2e.sh b/qa/workunits/cephadm/test_dashboard_e2e.sh index 9d8e90cebc2..e2e5dbf2ff2 100755 --- a/qa/workunits/cephadm/test_dashboard_e2e.sh +++ b/qa/workunits/cephadm/test_dashboard_e2e.sh @@ -6,10 +6,21 @@ DASHBOARD_FRONTEND_DIR=${SCRIPT_DIR}/../../../src/pybind/mgr/dashboard/frontend [ -z "$SUDO" ] && SUDO=sudo install_common () { + NODEJS_VERSION="16" if grep -q debian /etc/*-release; then $SUDO apt-get update - $SUDO apt-get install -y jq npm + # https://github.com/nodesource/distributions#manual-installation + $SUDO apt-get install curl gpg + KEYRING=/usr/share/keyrings/nodesource.gpg + curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | $SUDO tee "$KEYRING" >/dev/null + DISTRO="$(source /etc/lsb-release; echo $DISTRIB_CODENAME)" + VERSION="node_$NODEJS_VERSION.x" + echo "deb [signed-by=$KEYRING] https://deb.nodesource.com/$VERSION $DISTRO main" | $SUDO tee /etc/apt/sources.list.d/nodesource.list + echo "deb-src [signed-by=$KEYRING] https://deb.nodesource.com/$VERSION $DISTRO main" | $SUDO tee -a /etc/apt/sources.list.d/nodesource.list + $SUDO apt-get update + $SUDO apt-get install nodejs elif grep -q rhel /etc/*-release; then + $SUDO yum module -y enable nodejs:$NODEJS_VERSION $SUDO yum install -y jq npm else echo "Unsupported distribution."