-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ceph-website: setup nodejs for building the website
Signed-off-by: Nizamudeen A <[email protected]>
- Loading branch information
1 parent
6e02b6c
commit 9b0bb35
Showing
3 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,4 +55,5 @@ | |
builders: | ||
- shell: | ||
!include-raw: | ||
- ../../../scripts/ceph-website/install-deps.sh | ||
- ../../build/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,4 +32,5 @@ | |
builders: | ||
- shell: | ||
!include-raw: | ||
- ../../../scripts/ceph-website/install-deps.sh | ||
- ../../build/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
# install node.js | ||
NODEJS_MAJOR_VERSION=18 | ||
DISTRO="$(lsb_release -cs)" | ||
if [[ ! $(command -v node) || $(node --version | grep -oE "v([0-9])+" | cut -c 2-) < ${NODEJS_MAJOR_VERSION} ]]; then | ||
NODEJS_KEYRING=/usr/share/keyrings/nodesource.gpg | ||
NODESOURCE_PATH=/etc/apt/sources.list.d/nodesource.list | ||
|
||
# remove the manually installed node from the system | ||
sudo rm -f /usr/local/bin/node | ||
sudo rm -f /usr/local/bin/npm | ||
sudo rm -rf /usr/local/lib/node_modules/ | ||
sudo rm -f ${NODESOURCE_PATH} | ||
|
||
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | sudo tee "${NODEJS_KEYRING}" >/dev/null | ||
gpg --no-default-keyring --keyring "${NODEJS_KEYRING}" --list-keys | ||
|
||
NODEJS_VERSION="node_${NODEJS_MAJOR_VERSION}.x" | ||
echo "deb [signed-by=${NODEJS_KEYRING}] https://deb.nodesource.com/${NODEJS_VERSION} ${DISTRO} main" | sudo tee ${NODESOURCE_PATH} | ||
echo "deb-src [signed-by=${NODEJS_KEYRING}] https://deb.nodesource.com/${NODEJS_VERSION} ${DISTRO} main" | sudo tee -a ${NODESOURCE_PATH} | ||
|
||
sudo apt update -y | ||
sudo apt install -y nodejs | ||
sudo rm -f ${NODESOURCE_PATH} | ||
fi | ||
|
||
# print the version of node | ||
node --version |