Skip to content

Commit

Permalink
feat(version): update to the current nodejs version
Browse files Browse the repository at this point in the history
  • Loading branch information
javierbertoli committed Nov 6, 2021
1 parent 41a2bbf commit b6fe4a3
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 29 deletions.
9 changes: 5 additions & 4 deletions node/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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'
Expand Down
3 changes: 2 additions & 1 deletion node/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -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 -%}
18 changes: 10 additions & 8 deletions node/osfamilymap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -66,23 +68,23 @@ 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: {}

Windows:
pkg:
source:
# win-x64/node.exe
source_hash: a5c49d8053f399bf8eb3de86426b2274982ddceaeade7fb2f3446b4ebc7cd2e4
source_hash: 9f85861d85abeeb5fbd1ef6cea6bc7b672bc66aa13643e609941ee84b9402596
archive_suffix: exe

MacOS:
Expand All @@ -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
8 changes: 2 additions & 6 deletions node/package/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
12 changes: 9 additions & 3 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions test/salt/pillar/archive.sls
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 3 additions & 3 deletions test/salt/pillar/default.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# vim: ft=yaml
---
node:
version: 13.12.0
version: 17.0.1
config:
prefix: '/home/vagrant/.npm-packages'
environ:
Expand All @@ -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
4 changes: 2 additions & 2 deletions test/salt/pillar/source.sls
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit b6fe4a3

Please sign in to comment.