File tree Expand file tree Collapse file tree 4 files changed +57
-8
lines changed Expand file tree Collapse file tree 4 files changed +57
-8
lines changed Original file line number Diff line number Diff line change @@ -7,12 +7,24 @@ This formula installs [node.js](https://nodejs.org/en/).
7
7
An example pillar file looks as follows:
8
8
9
9
node:
10
- version: 5.1 .0
11
- checksum: 25b2d3b7dd57fe47a483539fea240a3c6bbbdab4d89a45a812134cf1380ecb94
10
+ version: 5.4 .0
11
+ checksum: 1dfe37a00cf0ed62beb73071f571ac56697f544a98cc2ff3318faec6363d72ab
12
12
make_jobs: 2
13
+ install_from_source: True
13
14
14
15
Available versions can be found on [ nodejs.org/dist/] ( https://nodejs.org/dist/ ) ; the checksums are listed in the
15
- file ` SHASUMS256.txt ` in the respective version’s directory.
16
+ file ` SHASUMS256.txt ` in the respective version’s directory. The * node-v….tar.gz* checksum is used.
17
+
18
+ ## Installing binary packages
19
+
20
+ On Linux, the binary node.js distribution can be installed to ` /usr/local/share/ ` with the following pillar file:
21
+
22
+ node:
23
+ version: 5.4.0
24
+ checksum: f037e2734f52b9de63e6d4a4e80756477b843e6f106e0be05591a16b71ec2bd0
25
+ install_from_binary: True
26
+
27
+ The checksum for the * node-v…-linux-x64.tar.gz* file has to be provided.
16
28
17
29
### Older versions
18
30
Original file line number Diff line number Diff line change
1
+ {% set node = pillar.get(' node' , {}) - %}
2
+ {% set version = node.get(' version' , ' 5.4.0' ) - %}
3
+ {% set checksum = node.get(' checksum' , ' f037e2734f52b9de63e6d4a4e80756477b843e6f106e0be05591a16b71ec2bd0' ) - %}
4
+ {% set pkgname = ' node-v' ~ version ~ ' -linux-x64' - %}
5
+
6
+ Get binary package :
7
+ file.managed :
8
+ - name: /usr/local/src/ {{ pkgname }}.tar.gz
9
+ - source: https://nodejs.org/dist/v {{ version }}/{{ pkgname }}.tar.gz
10
+ - source_hash: sha256= {{ checksum }}
11
+
12
+ Extract binary package :
13
+ archive.extracted :
14
+ - name: /usr/local/src/
15
+ - source: /usr/local/src/ {{ pkgname }}.tar.gz
16
+ - archive_format: tar
17
+ - if_missing: /usr/local/src/ {{ pkgname }}
18
+
19
+ Copy lib :
20
+ cmd.run :
21
+ - cwd: /usr/local/src/ {{ pkgname }}/
22
+ - name: cp -r bin/ include/ lib/ share/ /usr/local/
23
+ - unless: cmp /usr/local/bin/node /usr/local/src/ {{ pkgname }}/bin/node
Original file line number Diff line number Diff line change 2
2
include:
3
3
{%- if pillar_get('node:install_from_source ' ) %}
4
4
- .source
5
+ {%- elif pillar_get('node:install_from_binary ' ) %}
6
+ - .binary
5
7
{%- else %}
6
8
- .pkg
7
9
{%- endif %}
Original file line number Diff line number Diff line change
1
+ # Install from source:
1
2
node:
2
- version: 5.1.0
3
- checksum: 25b2d3b7dd57fe47a483539fea240a3c6bbbdab4d89a45a812134cf1380ecb94
3
+ version: 5.4.0
4
+ install_from_source: True
5
+ checksum: 1dfe37a00cf0ed62beb73071f571ac56697f544a98cc2ff3318faec6363d72ab
4
6
make_jobs: 2
5
- # install_from_ppa: True
6
- # ppa:
7
- # repository_url: https://deb.nodesource.com/node_4.x
7
+
8
+ # Install from binary:
9
+ node:
10
+ version: 5.4.0
11
+ install_from_binary: True
12
+ checksum: f037e2734f52b9de63e6d4a4e80756477b843e6f106e0be05591a16b71ec2bd0
13
+
14
+ # Install from PPA:
15
+ node:
16
+ version: 5.4.0
17
+ install_from_ppa: True
18
+ ppa:
19
+ repository_url: https://deb.nodesource.com/node_5.x
You can’t perform that action at this time.
0 commit comments