]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/dashboard: ensure node 16 is installed
authorErnesto Puerta <epuertat@redhat.com>
Thu, 13 Jan 2022 16:21:12 +0000 (17:21 +0100)
committerErnesto Puerta <epuertat@redhat.com>
Fri, 28 Jan 2022 11:51:34 +0000 (12:51 +0100)
For Ubuntu: https://github.com/nodesource/distributions#manual-installation

Fixes: https://tracker.ceph.com/issues/53843
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
(cherry picked from commit 7225b68e46173350954beb418ecd43e9eca4d179)

qa/workunits/cephadm/test_dashboard_e2e.sh

index 9d8e90cebc2915b40f39e8ea80a098395516d5a5..e2e5dbf2ff27875527469112abbcda8a6cbb90a3 100755 (executable)
@@ -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."