From b6fe4a35f2889e3133ba34813beb9f63a5e53f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20B=C3=A9rtoli?= Date: Sat, 6 Nov 2021 19:18:04 -0300 Subject: [PATCH] feat(version): update to the current nodejs version --- node/defaults.yaml | 9 +++++---- node/map.jinja | 3 ++- node/osfamilymap.yaml | 18 ++++++++++-------- node/package/install.sls | 8 ++------ pillar.example | 12 +++++++++--- test/salt/pillar/archive.sls | 4 ++-- test/salt/pillar/default.sls | 6 +++--- test/salt/pillar/source.sls | 4 ++-- 8 files changed, 35 insertions(+), 29 deletions(-) diff --git a/node/defaults.yaml b/node/defaults.yaml index 19e95d4..f8b37c1 100644 --- a/node/defaults.yaml +++ b/node/defaults.yaml @@ -2,7 +2,7 @@ # vim: ft=yaml --- node: - version: 13.12.0 + version: 17.0.1 config_file: /etc/npmrc config: {} environ_file: /etc/default/node.sh @@ -19,7 +19,7 @@ node: source: /usr/local/src pkg: name: nodejs - version: '14' + # version: 17.0.1 use_upstream_repo: false use_upstream_archive: false use_upstream_source: false @@ -34,13 +34,14 @@ node: suffix: tar.gz archive: uri: https://nodejs.org/dist - source_hash: 3e66b14bbeb9ea1ba129fae7c65374844f4ddaf1e48e2bc19b3b2570e158e362 + # node-v17.0.1.tar.gz + source_hash: 6ec480f872cb7c34877044985e3d7bd89329ace5b8e2ad90b57980601786341c enforce_toplevel: false trim_output: true options: '--strip-components=1' source: uri: https://github.com/nodejs/node/archive - source_hash: 37aff6cc2f451d1dbe693d18ad87fad352ed4f74f7b8e232590dd7f2f6b5d525 + source_hash: ef8544d55b9f514a30824e8c59cb25349a00d7a9ea325ed5c6f2e366f99cfc1a trim_output: true enforce_toplevel: false options: '--strip-components=1' diff --git a/node/map.jinja b/node/map.jinja index f7f4657..4eb5ffc 100644 --- a/node/map.jinja +++ b/node/map.jinja @@ -35,7 +35,8 @@ 'source': '%s/v%s/%s.%s'|format(node.pkg.archive.uri, node.version, dirname, node.pkg.suffix)}) %} {%- endif %} {%- if node.pkg.use_upstream_repo -%} - {%- set full_repo_name = 'deb %s/node_%s.x %s'|format(node.pkg.repo.url, node.pkg.version, node.pkg.repo.dist) -%} + {%- set repo_version = node.version.split('.')[0] | default('') %} + {%- set full_repo_name = 'deb %s/node_%s.x %s'|format(node.pkg.repo.url, repo_version, node.pkg.repo.dist) -%} {%- do node.pkg.repo.update({ 'name': full_repo_name}) -%} {%- endif -%} diff --git a/node/osfamilymap.yaml b/node/osfamilymap.yaml index d4c86bb..361a9c3 100644 --- a/node/osfamilymap.yaml +++ b/node/osfamilymap.yaml @@ -15,9 +15,11 @@ {%- set macos_rootgroup = salt['cmd.run']("stat -f '%Sg' /dev/console") %} {%- endif %} +# Source hashes taken from https://nodejs.org/dist/vnode.version/SHASUMS256.txt + Debian: - version: 14.18.1-deb-1nodesource1 pkg: + version: 17.0.1-deb-1nodesource1 deps: - pkg-config - build-essential @@ -66,15 +68,15 @@ FreeBSD: pkg: name: node source: - # node-v13.12.0.tar.gz ???? - source_hash: 1b74d624493f17210b96dbd925066034e2d540090a36a99d5c50155cd6726a38 + # node-v17.0.1.tar.gz ???? + source_hash: f06242a7958b89f1bc3c7070af1ff5e477a9d3b76d2348456617f87e8f4f6988 OpenBSD: pkg: name: node source: - # node-v13.12.0.tar.gz ???? - source_hash: 1b74d624493f17210b96dbd925066034e2d540090a36a99d5c50155cd6726a38 + # node-v17.0.1.tar.gz ???? + source_hash: f06242a7958b89f1bc3c7070af1ff5e477a9d3b76d2348456617f87e8f4f6988 Solaris: {} @@ -82,7 +84,7 @@ Windows: pkg: source: # win-x64/node.exe - source_hash: a5c49d8053f399bf8eb3de86426b2274982ddceaeade7fb2f3446b4ebc7cd2e4 + source_hash: 9f85861d85abeeb5fbd1ef6cea6bc7b672bc66aa13643e609941ee84b9402596 archive_suffix: exe MacOS: @@ -91,5 +93,5 @@ MacOS: pkg: name: node # homebrew; macports: nodejs7 source: - # darwin amd64 tarball, node-v13.12.0-darwin-x64.tar.gz - source_hash: 1fe3103610e8eb66ae71872ea1b4e868a638292a4e7ad0e41976a9fe417a09c7 + # darwin amd64 tarball, node-v17.0.1-darwin-x64.tar.gz + source_hash: 0dfe6f904f3f20652e3d34c60885b790603f120d5d51a53031355827a4eaf6a9 diff --git a/node/package/install.sls b/node/package/install.sls index da69b23..2606676 100644 --- a/node/package/install.sls +++ b/node/package/install.sls @@ -16,10 +16,6 @@ node-package-install-pkg-installed: pkg.installed: - name: {{ node.pkg.name }} - reload_modules: true - # node:pkg.version is the major version only - # while the full version is passed as `node:version` - # to make it suitable to be used in other install modes - {%- if node.pkg.version %} - {# use node:version for pinning #} - - version: {{ node.version }} + {%- if node.pkg.version is defined %} + - version: {{ node.pkg.version }} {%- endif %} diff --git a/pillar.example b/pillar.example index 79cb109..745247d 100644 --- a/pillar.example +++ b/pillar.example @@ -2,18 +2,24 @@ # vim: ft=yaml --- node: - version: 13.12.0 + # This version is used in archive/source installations, and it's major number + # is used in to build the upstream's repo URL when using package installations + # (the default) and `use_upstream_repo: true` + version: 17.0.1 config: prefix: '/home/vagrant/.npm-packages' environ: a: b pkg: + # This version is used only in `package` based installations, to pin to + # specific package version, specially if the repo has more than one available + # version: 17.0.1 use_upstream_repo: false use_upstream_archive: false use_upstream_source: false archive: uri: https://nodejs.org/dist - source_hash: 3e66b14bbeb9ea1ba129fae7c65374844f4ddaf1e48e2bc19b3b2570e158e362 + source_hash: 6ec480f872cb7c34877044985e3d7bd89329ace5b8e2ad90b57980601786341c source: uri: https://github.com/nodejs/node/archive - source_hash: 37aff6cc2f451d1dbe693d18ad87fad352ed4f74f7b8e232590dd7f2f6b5d525 + source_hash: ef8544d55b9f514a30824e8c59cb25349a00d7a9ea325ed5c6f2e366f99cfc1a diff --git a/test/salt/pillar/archive.sls b/test/salt/pillar/archive.sls index 125d567..f2c0cba 100644 --- a/test/salt/pillar/archive.sls +++ b/test/salt/pillar/archive.sls @@ -2,12 +2,12 @@ # vim: ft=yaml --- node: - version: 13.12.0 + version: 17.0.1 pkg: use_upstream_archive: true # from NodeSource archive: uri: https://nodejs.org/dist - source_hash: 3e66b14bbeb9ea1ba129fae7c65374844f4ddaf1e48e2bc19b3b2570e158e362 + source_hash: 6ec480f872cb7c34877044985e3d7bd89329ace5b8e2ad90b57980601786341c config: prefix: '/home/vagrant/.npm-packages' diff --git a/test/salt/pillar/default.sls b/test/salt/pillar/default.sls index 79cb109..8ac40d8 100644 --- a/test/salt/pillar/default.sls +++ b/test/salt/pillar/default.sls @@ -2,7 +2,7 @@ # vim: ft=yaml --- node: - version: 13.12.0 + version: 17.0.1 config: prefix: '/home/vagrant/.npm-packages' environ: @@ -13,7 +13,7 @@ node: use_upstream_source: false archive: uri: https://nodejs.org/dist - source_hash: 3e66b14bbeb9ea1ba129fae7c65374844f4ddaf1e48e2bc19b3b2570e158e362 + source_hash: 6ec480f872cb7c34877044985e3d7bd89329ace5b8e2ad90b57980601786341c source: uri: https://github.com/nodejs/node/archive - source_hash: 37aff6cc2f451d1dbe693d18ad87fad352ed4f74f7b8e232590dd7f2f6b5d525 + source_hash: ef8544d55b9f514a30824e8c59cb25349a00d7a9ea325ed5c6f2e366f99cfc1a diff --git a/test/salt/pillar/source.sls b/test/salt/pillar/source.sls index a66cb04..7a82101 100644 --- a/test/salt/pillar/source.sls +++ b/test/salt/pillar/source.sls @@ -2,12 +2,12 @@ # vim: ft=yaml --- node: - version: 13.12.0 + version: 17.0.1 pkg: use_upstream_source: true source: uri: https://github.com/nodejs/node/archive - source_hash: 37aff6cc2f451d1dbe693d18ad87fad352ed4f74f7b8e232590dd7f2f6b5d525 + source_hash: ef8544d55b9f514a30824e8c59cb25349a00d7a9ea325ed5c6f2e366f99cfc1a config: prefix: '/home/vagrant/.npm-packages'