From 70e67878b775f9cdc15ac0d6bd220b4290750e64 Mon Sep 17 00:00:00 2001 From: Rafi Shamim Date: Wed, 1 Nov 2023 16:23:37 +0000 Subject: [PATCH] roachtest: fix javascript installation commands Once again, the "proper" way to install nodejs has changed. This new way uses the latest instructions from https://github.com/nodesource/distributions Release note: None --- pkg/cmd/roachtest/tests/knex.go | 11 ++++++++--- pkg/cmd/roachtest/tests/nodejs_postgres.go | 11 ++++++++--- pkg/cmd/roachtest/tests/sequelize.go | 11 ++++++++--- pkg/cmd/roachtest/tests/typeorm.go | 11 ++++++++--- 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/pkg/cmd/roachtest/tests/knex.go b/pkg/cmd/roachtest/tests/knex.go index 28824dac8c56..c8d55809d38e 100644 --- a/pkg/cmd/roachtest/tests/knex.go +++ b/pkg/cmd/roachtest/tests/knex.go @@ -64,13 +64,18 @@ func registerKnex(r registry.Registry) { t, c, node, - "add nodesource repository", - `sudo apt install ca-certificates && curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -`, + "add nodesource key and deb repository", + ` +sudo apt-get update && \ +sudo apt-get install -y ca-certificates curl gnupg && \ +sudo mkdir -p /etc/apt/keyrings && \ +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list`, ) require.NoError(t, err) err = repeatRunE( - ctx, t, c, node, "install nodejs and npm", `sudo apt-get -qq install nodejs`, + ctx, t, c, node, "install nodejs and npm", `sudo apt-get update && sudo apt-get -qq install nodejs`, ) require.NoError(t, err) diff --git a/pkg/cmd/roachtest/tests/nodejs_postgres.go b/pkg/cmd/roachtest/tests/nodejs_postgres.go index b61038d5eb12..1ec0094f1ba9 100644 --- a/pkg/cmd/roachtest/tests/nodejs_postgres.go +++ b/pkg/cmd/roachtest/tests/nodejs_postgres.go @@ -72,13 +72,18 @@ func registerNodeJSPostgres(r registry.Registry) { t, c, node, - "add nodesource repository", - `sudo apt install ca-certificates && curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -`, + "add nodesource key and deb repository", + ` +sudo apt-get update && \ +sudo apt-get install -y ca-certificates curl gnupg && \ +sudo mkdir -p /etc/apt/keyrings && \ +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list`, ) require.NoError(t, err) err = repeatRunE( - ctx, t, c, node, "install nodejs and npm", `sudo apt-get -qq install nodejs`, + ctx, t, c, node, "install nodejs and npm", `sudo apt-get update && sudo apt-get -qq install nodejs`, ) require.NoError(t, err) diff --git a/pkg/cmd/roachtest/tests/sequelize.go b/pkg/cmd/roachtest/tests/sequelize.go index 5578a59c820e..69006d9afa9c 100644 --- a/pkg/cmd/roachtest/tests/sequelize.go +++ b/pkg/cmd/roachtest/tests/sequelize.go @@ -95,14 +95,19 @@ func registerSequelize(r registry.Registry) { t, c, node, - "add nodesource repository", - `sudo apt install ca-certificates && curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -`, + "add nodesource key and deb repository", + ` +sudo apt-get update && \ +sudo apt-get install -y ca-certificates curl gnupg && \ +sudo mkdir -p /etc/apt/keyrings && \ +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list`, ); err != nil { t.Fatal(err) } if err := repeatRunE( - ctx, t, c, node, "install nodejs and npm", `sudo apt-get -qq install nodejs`, + ctx, t, c, node, "install nodejs and npm", `sudo apt-get update && sudo apt-get -qq install nodejs`, ); err != nil { t.Fatal(err) } diff --git a/pkg/cmd/roachtest/tests/typeorm.go b/pkg/cmd/roachtest/tests/typeorm.go index 87bf133010e5..8d487b7a68a3 100644 --- a/pkg/cmd/roachtest/tests/typeorm.go +++ b/pkg/cmd/roachtest/tests/typeorm.go @@ -92,14 +92,19 @@ func registerTypeORM(r registry.Registry) { t, c, node, - "add nodesource repository", - `sudo apt install ca-certificates && curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -`, + "add nodesource key and deb repository", + ` +sudo apt-get update && \ +sudo apt-get install -y ca-certificates curl gnupg && \ +sudo mkdir -p /etc/apt/keyrings && \ +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list`, ); err != nil { t.Fatal(err) } if err := repeatRunE( - ctx, t, c, node, "install nodejs and npm", `sudo apt-get install -y nodejs`, + ctx, t, c, node, "install nodejs and npm", `sudo apt-get update && sudo apt-get -qq install nodejs`, ); err != nil { t.Fatal(err) }