This repository has been archived by the owner on May 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
update.yml
285 lines (258 loc) · 9.22 KB
/
update.yml
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
---
type: update
version: 1.5.2
name: Jahia - Update events
logo: /images/jahia-logo-70x70.png
id: jahia-jelastic
description:
short: Jahia - Update events
ssl: true
skipNodeEmails: true
mixins:
- common/common_actions.yml
- haproxy/haproxy_actions.yml
- jahia/jahia_actions.yml
- database/mariadb_actions.yml
- database/galera_actions.yml
- database/proxysql_actions.yml
globals:
haproxy_admin_stats_pass: ${fn.password(20)}
db_user: jahia-db-${fn.random}
db_pass: ${fn.password(20)}
db_user_datadog: ${fn.password(20)}
redis_pass: ${fn.password(20)}
mngr_user: manager
dx_version: ${settings.dxVersion}
operating_mode: ${settings.mode}
datadog_key: ${settings.ddogApikey}
shortdomain: ${settings.shortdomain}
displayName: ${settings.displayName}
jahia_docker_image: ${settings.jahiaDockerImage}
dbbaseUrl: https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/master
dbnodeType: mariadb-dockerized
xms: 256M
xmx: 3584M
expandImportedFilesOnDisk: "true"
jahiaFileUploadMaxSize: 268435456
imageService: ImageMagickImageService
org_jahia_ehcachemanager_maxBytesLocalHeap_dev: 700M
org_jahia_ehcachemanager_big_maxBytesLocalHeap_dev: 700M
org_jahia_ehcachemanager_maxBytesLocalHeap_prod: 800M
org_jahia_ehcachemanager_big_maxBytesLocalHeap_prod_cp: 2500M
org_jahia_ehcachemanager_big_maxBytesLocalHeap_prod_proc: 700M
java_opts:
-DDB_USER=${DB_USER}
-DDB_PASSWORD=${DB_PASSWORD}
-DREDIS_PASSWORD=${REDIS_PASSWORD}
-DMANAGER_USER=${MANAGER_USER}
-DMANAGER_PASSWORD=${MANAGER_PASSWORD}
-DSUPER_USER_PASSWORD=${SUPER_USER_PASSWORD}
-DHOST_NAME=$(hostname)
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=7199
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-XX:MaxPermSize=512m
-XX:+HeapDumpOnOutOfMemoryError
-XX:+PrintConcurrentLocks
-XX:+UseParallelGC
-XX:SurvivorRatio=8
-Xmn1G
# --Events --
onBeforeScaleIn[cp]:
- forEach(event.response.nodes):
- removeNodeFromHaproxy:
nodeId: ${@i.id}
nodeIp: ${@i.intIP}
onAfterScaleIn[cp]:
- refreshProxysqlInstancesList
onAfterServiceScaleOut[cp]:
- forEach(event.response.nodes):
- onAfterBrowsingScaleOut:
newNode: ${@i.id}
- resetHaproxyBackends
- refreshProxysqlInstancesList
onBeforeRestartNode[cp]:
removeNodeFromHaproxy:
nodeId: ${event.params.nodeId}
onAfterRestartNode[cp]:
forEach(nodes.cp):
if ("${event.params.nodeId}" == "${@i.id}"):
- startupJahiaHealthCheck: ${event.params.nodeId}
- addNodeToHaproxy:
nodeId: ${@i.id}
nodeIp: ${@i.intIP}
onAfterRestartNode[proc]:
startupJahiaHealthCheck: ${event.params.nodeId}
onBeforeRedeployContainer[cp]:
- if ('${event.params.nodeGroup:}'):
# Handle RedeployContainersByGroup
- forEach(nodes.cp):
removeNodeFromHaproxy:
nodeId: ${@i.id}
- cmd [cp]: |-
service tomcat stop
user: root
- elif ('${event.params.nodeId:}'):
# Handle RedeployContainerById
- removeNodeFromHaproxy:
nodeId: ${event.params.nodeId}
- cmd [${event.params.nodeId}]: |-
service tomcat stop
user: root
onAfterRedeployContainer[cp]:
- if ('${event.params.nodeGroup:}'):
# Handle RedeployContainersByGroup
- onAfterRedeployJahiaContainer: ${event.params.nodeGroup}
- startupJahiaHealthCheck: ${event.params.nodeGroup}
- resetHaproxyBackends
- elif ('${event.params.nodeId:}'):
# Handle RedeployContainerById
- onAfterRedeployJahiaContainer: ${event.params.nodeId}
- forEach(nodes.cp):
if ("${event.params.nodeId}" == "${@i.id}"):
- startupJahiaHealthCheck: ${event.params.nodeId}
- addNodeToHaproxy:
nodeId: ${@i.id}
nodeIp: ${@i.intIP}
onBeforeRedeployContainer[proc]:
- cmd [proc]: |-
service tomcat stop
user: root
onAfterRedeployContainer[proc]:
- if ('${event.params.nodeGroup:}'):
# Handle RedeployContainersByGroup
- onAfterRedeployJahiaContainer: ${event.params.nodeGroup}
- cmd [proc]: |-
echo $JAHIA_UPGRADE
user: root
- if ('${response.out}' == ''):
startupJahiaHealthCheck: ${event.params.nodeGroup}
- startupJahiaHealthCheck: ${event.params.nodeGroup}
- elif ('${event.params.nodeId:}'):
# Handle RedeployContainerById
- onAfterRedeployJahiaContainer: ${event.params.nodeId}
- startupJahiaHealthCheck: ${event.params.nodeId}
onAfterRedeployContainer[bl]:
- if ('${event.params.nodeGroup:}'):
# Handle RedeployContainersByGroup
- setSudoer: ${event.params.nodeGroup}
- splitHaproxyConf: ${event.params.nodeGroup}
- setupDatadogAgentHaproxy: ${event.params.nodeGroup}
- environment.control.ApplyNodeGroupData [bl]:
data:
productName: haproxy
productVersion: ${nodes.bl.first.version}
- elif ('${event.params.nodeId:}'):
# Handle RedeployContainerById
- setSudoer: ${event.params.nodeId}
- splitHaproxyConf: ${event.params.nodeId}
- setupDatadogAgentHaproxy: ${event.params.nodeId}
- environment.control.ApplyNodeGroupData [bl]:
data:
productName: haproxy
productVersion: ${nodes.bl.first.version}
onBeforeRedeployContainer[sqldb]:
# disable mysql autostart because JEM will do it
- if ('${event.params.nodeGroup:}'):
- mysqlService:
target: ${event.params.nodeGroup}
action: disable
- elif ('${event.params.nodeId:}'):
- mysqlService:
target: ${event.params.nodeId}
action: disable
onAfterRedeployContainer[sqldb]:
- if ('${event.params.nodeGroup:}'):
# Handle RedeployContainersByGroup
- setSudoer: ${event.params.nodeGroup}
- setupDatadogAgentSql: ${event.params.nodeGroup}
- mysqlService:
target: ${event.params.nodeGroup}
action: enable
- elif ('${event.params.nodeId:}'):
# Handle RedeployContainerById
- setSudoer: ${event.params.nodeId}
- setupDatadogAgentSql: ${event.params.nodeId}
- mysqlService:
target: ${event.params.nodeId}
action: enable
onBeforeStop:
- stopJahia: cp, proc
- stopGalera
- logEvent:
target: ${nodes.proc.first.id}
title: "Stopping environment $envName"
text: "$envName is going to stop"
onAfterStart:
- startupJahiaHealthCheck: cp, proc
- logEvent:
target: ${nodes.proc.first.id}
title: "$envName environment started"
text: "$envName is started"
onBeforeMigrate:
logEvent:
target: ${nodes.proc.first.id}
title: "Migration triggered for $envName environment"
text: "$envName going to be migrate"
onAfterMigrate:
- logEvent:
target: ${nodes.proc.first.id}
title: "Environment $envName migrated"
text: "$envName has been migrated"
onBeforeRestartNode:
logEvent:
target: ${event.params.nodeId}
title: "Restarting node ${event.params.nodeId}"
text: "${event.params.nodeId} node is going to be restarted"
onAfterRestartNode:
logEvent:
target: ${event.params.nodeId}
title: "Node ${event.params.nodeId} restarted"
text: "Node ${event.params.nodeId} has restarted"
onBeforeRedeployContainer:
- if ('${event.params.nodeGroup:}'):
# Handle RedeployContainersByGroup
logEvent:
target: ${event.params.nodeGroup}
title: "Redeploying ${event.params.nodeGroup} nodes to ${event.params.tag} version"
text: "${event.params.nodeGroup} nodes are going to be redeploy to ${event.params.tag} version"
- elif ('${event.params.nodeId:}'):
# Handle RedeployContainerById
logEvent:
target: ${event.params.nodeId}
title: "Redeploying node ${event.params.nodeId} to ${event.params.tag} version"
text: "Node ${event.params.nodeId} is going to be redeploy to ${event.params.tag} version"
onAfterRedeployContainer:
- if ('${event.params.nodeGroup:}'):
# Handle RedeployContainersByGroup
- getLogEventScript: ${event.params.nodeGroup}
- logEvent:
target: ${event.params.nodeGroup}
title: "${event.params.nodeGroup} nodes have been redeployed to ${event.params.tag} version"
text: "${event.params.nodeGroup} nodes have been redeployed to ${event.params.tag} version"
- elif ('${event.params.nodeId:}'):
# Handle RedeployContainerById
- getLogEventScript: ${event.params.nodeId}
- logEvent:
target: ${event.params.nodeId}
title: "Node ${event.params.nodeId} redeployed to ${event.params.tag} version"
text: "Node ${event.params.nodeId} has been redeploy to ${event.params.tag} version"
onBeforeScaleIn:
forEach(event.response.nodes):
logEvent:
target: ${@i.id}
title: "Scaling in ${event.params.nodeGroup} node group"
text: "Node ${@i.id} is going to be removed"
onAfterServiceScaleOut:
forEach(event.response.nodes):
logEvent:
target: ${@i.id}
title: "Scaled out ${event.params.nodeGroup} node group"
text: "Node ${@i.id} has been added"
onBeforeDelete:
- logEvent:
target: ${nodes.proc.first.id}
title: "Deleting environment $envName"
text: "$envName is going to be deleted"
- deleteEnvLink