Skip to content

Commit

Permalink
🐞 Fix nodejs installation (#346)
Browse files Browse the repository at this point in the history
Parent issue: sequentech/meta#304
  • Loading branch information
Findeton authored Nov 1, 2023
1 parent 37db46e commit 6be2f64
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 11 deletions.
12 changes: 1 addition & 11 deletions packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,9 @@
apt:
update_cache: yes

# we use curl directly because it's the recommended method
- name: Packages, Adding nodejs dependency
become: true
shell: curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
args:
warn: false

# we use apt-get directly because otherwise it does not work
- name: Packages, Ensuring the upgrade of nodejs
become: true
shell: apt-get install -y nodejs
args:
warn: false
script: sequent-ui/templates/install_node.sh

- name: Packages, Installing packages
become: true
Expand Down
27 changes: 27 additions & 0 deletions sequent-ui/templates/install_node.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# This file is part of deployment-tool.
# Copyright (C) 2023 Sequent Tech Inc <[email protected]>

# deployment-tool is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License.

# deployment-tool is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.

# You should have received a copy of the GNU Lesser General Public License
# along with deployment-tool. If not, see <http://www.gnu.org/licenses/>.
set -uex; \
apt-get update; \
apt-get install -y ca-certificates curl gnupg; \
mkdir -p /etc/apt/keyrings; \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
| gpg --yes --dearmor -o /etc/apt/keyrings/nodesource.gpg; \
NODE_MAJOR=18; \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" \
> /etc/apt/sources.list.d/nodesource.list; \
apt-get -qy update; \
apt-get -qy install nodejs;

0 comments on commit 6be2f64

Please sign in to comment.