Skip to content

Commit

Permalink
Merge pull request #213 from ronivay/revert-201-fix/nodesource-repo-c…
Browse files Browse the repository at this point in the history
…hanges

Revert "fix: replace deprecated nodesource repository installation"
  • Loading branch information
ronivay authored Feb 23, 2024
2 parents 98eebc8 + 194a8d9 commit 2145295
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions xo-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,6 @@ function InstallDependenciesRPM {
# only install nodejs repo if user allows it to be installed
if [[ "$INSTALL_REPOS" == "true" ]]; then
runcmd "curl -s -L https://rpm.nodesource.com/setup_${NODEVERSION}.x | bash -"
# enable these once https://github.com/ronivay/XenOrchestraInstallerUpdater/issues/200 is resolved
#runcmd "yum install https://rpm.nodesource.com/pub_${NODEVERSION}.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y"
#runcmd "yum install nodejs -y --setopt=nodesource-nodejs.module_hotfixes=1"
fi

runcmd "yum install -y nodejs"
Expand Down Expand Up @@ -326,10 +323,7 @@ function InstallDependenciesDeb {

# only install nodejs repo if user allows it to be installed
if [[ "$INSTALL_REPOS" == "true" ]]; then
runcmd "mkdir -p /usr/share/keyrings"
runcmd "curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --batch --yes --dearmor -o /usr/share/keyrings/nodesource.gpg"
runcmd "echo \"deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODEVERSION}.x nodistro main\" > /etc/apt/sources.list.d/nodesource.list"
runcmd "apt-get update"
runcmd "curl -sL https://deb.nodesource.com/setup_${NODEVERSION}.x | bash -"
fi

runcmd "apt-get install -y nodejs"
Expand Down Expand Up @@ -378,21 +372,6 @@ function UpdateNodeYarn {
return 0
fi

if [[ "$INSTALL_REPOS" == "true" ]]; then
printinfo "Installing nodesource repository"
# enable these once https://github.com/ronivay/XenOrchestraInstallerUpdater/issues/200 is resolved
#if [ "$PKG_FORMAT" == "rpm" ]; then
# runcmd "yum install https://rpm.nodesource.com/pub_${NODEVERSION}.x/nodistro/repo/nodesource-release-nodistro-1.noarch.rpm -y"
# runcmd "yum clean all"
#fi
if [ "$PKG_FORMAT" == "deb" ]; then
runcmd "mkdir -p /usr/share/keyrings"
runcmd "curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --batch --yes --dearmor -o /usr/share/keyrings/nodesource.gpg"
runcmd "echo \"deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODEVERSION}.x nodistro main\" > /etc/apt/sources.list.d/nodesource.list"
runcmd "apt-get update"
fi
fi

echo
printinfo "Checking current node.js version"
local NODEV=$(runcmd_stdout "node -v 2>/dev/null| grep -Eo '[0-9.]+' | cut -d'.' -f1")
Expand All @@ -404,10 +383,9 @@ function UpdateNodeYarn {
echo
printprog "node.js version is $NODEV, upgrading to ${NODEVERSION}.x"

# remove following two lines once https://github.com/ronivay/XenOrchestraInstallerUpdater/issues/200 is resolved
runcmd "curl -sL https://rpm.nodesource.com/setup_${NODEVERSION}.x | bash -"
runcmd "yum clean all"

runcmd "yum clean all"
runcmd "yum install -y nodejs"
printok "node.js version is $NODEV, upgrading to ${NODEVERSION}.x"
else
Expand All @@ -428,6 +406,8 @@ function UpdateNodeYarn {
echo
printprog "node.js version is $NODEV, upgrading to ${NODEVERSION}.x"

runcmd "curl -sL https://deb.nodesource.com/setup_${NODEVERSION}.x | bash -"

runcmd "apt-get install -y nodejs"
printok "node.js version is $NODEV, upgrading to ${NODEVERSION}.x"
else
Expand Down

0 comments on commit 2145295

Please sign in to comment.