diff --git a/packages.yml b/packages.yml index fa64e1e..85df184 100644 --- a/packages.yml +++ b/packages.yml @@ -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 diff --git a/sequent-ui/templates/install_node.sh b/sequent-ui/templates/install_node.sh new file mode 100644 index 0000000..eb36092 --- /dev/null +++ b/sequent-ui/templates/install_node.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# This file is part of deployment-tool. +# Copyright (C) 2023 Sequent Tech Inc + +# 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 . +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; \ No newline at end of file