-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmanifest.jps
131 lines (113 loc) · 4.06 KB
/
manifest.jps
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
_info : 'https://docs.cloudscripting.com/1.6.2/'
version: '1.6.2'
type: update
id: 'nodejs-php'
name: 'Node.js and NPM for PHP'
homepage: https://nodejs.org/en/
baseUrl: https://raw.githubusercontent.com/layershift/nodejs-php/master
logo: https://raw.githubusercontent.com/layershift/nodejs-php/master/node.png
description:
short: Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world.
globals:
message: ""
targetNodes:
nodeType:
- nginx
- nginxphp
- nginx-dockerized
- nginxphp-dockerized
- apache
- apache2
- nginx-ruby
- apache2-ruby
- litespeedphp
- llsmp
settings:
main:
fields:
- type: list
name: version
caption: Node.js version
hideLabel: false
required: true
default: setup_20.x
values:
setup_18.x: 18.x
setup_20.x: 20.x LTS
setup_21.x: 21.x
setup_22.x: 22.x LTS
menu:
- caption: Change Version
loadingText: Installing..
settings: main
confirmText: Are you sure you wish to uninstall the current version and install a new one?
action: install
onAfterRedeployContainer:
install:
name: Install Action
onAfterAddNode:
install:
name: Install Action
onAfterCloneNodes:
install:
name: Install Action
onInstall:
install:
name: Install Action
onUninstall:
uninstall:
name: Uninstall action
actions:
appendMessage:
setGlobals:
message: ${globals.message}${this}
install:
- setGlobals:
- message: ""
- forEach(node:targetNodes):
- cmd [${@node.id}]:
- which rpm 2>&1 >/dev/null; if [ $? -gt 0 ]; then echo -e "Details::\nrpm not found"; exit 0; fi;
- which yum 2>&1 >/dev/null; if [ $? -gt 0 ]; then echo -e "Details::\nyum not found"; exit 0; fi;
- glibcMinVersion=2.28;
- glibcVersion=$(rpm -q glibc | awk -F '-' '{print $2}'); if [ $(bc -l <<< "${glibcVersion/e/E} < ${glibcMinVersion/e/E}") -eq 1 ]; then echo -e "Details::\nglibc version ${glibcVersion} lower than the required ${glibcMinVersion}"; exit 0; fi;
- rpm -q yum-utils 2>&1 >/dev/null; if [ $? -ne 0 ]; then yum -y install yum-utils; fi;
- rpm -q nodejs 2>&1 >/dev/null; if [ $? -eq 0 ]; then yum -q -y remove nodejs 2>&1 >/dev/null; fi;
- tty -s && mesg n 2>&1;
- curl --silent --location https://rpm.nodesource.com/${settings.version} | bash - 2>/dev/null 1>/dev/null
- yum clean all && yum makecache;
- yumdownloader -q --url nodejs 2>/dev/null | xargs yum -y install 2>/dev/null 1>/dev/null; if [ $? -gt 0 ]; then echo -e "\nDetails::\nCan't install nodejs"; exit 0; fi;
- npmver="latest"; if [ ${settings.version} == "setup_18.x" ]; then npmver=10.8.2; fi;
- npm -g install npm@$npmver; if [ $? -gt 0 ]; then echo -e "\nDetails::\nCan't npm -g install npm@$npmver"; exit 0; fi;
sayYes: true
user: root
- appendMessage: ${response.out}
- cmd [${@node.id}]:
- echo -e "export PATH=$HOME/node_modules/.bin:$PATH" >> $HOME/.bashrc; if [ $? -gt 0 ]; then echo -e "\nDetails::\nCan't set export PATH"; exit 0; fi;
sayYes: true
user: jelastic
- appendMessage: ${response.out}
- if (globals.message.indexOf("Details::") !== -1):
message: ${globals.message}
script: |
return {result: 2309, message: message.replace(/\n/g, ' \n')}
uninstall:
- setGlobals:
- message: ""
- forEach(node:targetNodes):
- cmd [${@node.id}]:
- rpm -e nodejs 2>&1;
- echo "";
sayYes: true
user: root
- cmd [${@node.id}]:
- rm -rf $HOME/node_modules 2>&1;
- sed -i "/node_modules/d" $HOME/.bashrc 2>&1;
- echo "";
sayYes: true
user: jelastic
responses:
2308:
type: success
2309:
type: error
success: Node.js addon has been installed successfully.