forked from edgeport/cdn
-
Notifications
You must be signed in to change notification settings - Fork 1
/
manifest.yml
185 lines (164 loc) · 5.44 KB
/
manifest.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
version: 1.1
type: update
categories:
- apps/dev-tools
id: cdn
baseUrl: https://raw.githubusercontent.com/edgeport/cdn/master
name: HTTP/3 Premium CDN
logo: /images/edgeport-blue-logo-70x70.png
homepage: https://www.virtuozzo.com/company/blog/enterprise-cdn-verizon-integration/
description:
short: Enterprise-level HTTP-over-QUIC CDN
targetNodes:
nodeGroup:
- bl
- cp
mixins:
- https://raw.githubusercontent.com/jelastic-jps/common/main/clustered-addon-utils.yml
onBeforeInit: |
var resp = api.dev.scripting.Eval("c05ffa5b45628a2a0c95467ebca8a0b4", session, "cdn.wizard.ui");
return resp.response ? resp.response:resp;
globals:
app_id: cdn
valueRR: RR
valuePF: PF
appid: c05ffa5b45628a2a0c95467ebca8a0b4
#appName: CDN EdgePort Service
buttons:
- settings: config
action: config
caption: Configure
submitButtonText: Apply
menu:
- caption: Purge
confirmText: Are you sure?
loadingText: We are purging your files
action: purgeSingle
successText: Purge was successfully!
settings: purge
title: Purge
submitButtonText: Submit
- caption: Purge All
confirmText: Are you sure?
loadingText: We are purging your files
action: purge
successText: Purge was successfully!
title: Purge All
submitButtonText: Submit
onInstall:
- checkClustering:
nodeGroup: ${targetNodes.nodeGroup}
app_id: ${globals.app_id}
- if (globals.cluster):
- if (!${globals.isSecondaryEnv}):
- createFile:
envName: ${globals.secondaryEnvName}
nodeGroup: ${targetNodes.nodeGroup}
app_id: ${globals.app_id}
- installAddon
- script: return api.dev.scripting.Eval("${globals.appid}", session, "cdn.info", { partnerCode:true })
- cmd[${nodes.cp.master.id}]: |-
bash ~/bin/setupWP.sh --edgeportCDN true --CDN_URL '${env.envName}-${response.response.partnerCode}.cdn.jelastic.net'
- install:
jps: ${baseUrl}/manifest.yml
nodeGroup: ${targetNodes.nodeGroup}
skipEmail: true
envName: ${globals.secondaryEnvName}
settings:
note: ${settings.noteCDN:}
masterEnv: ${env.name}
- else:
- installAddon
- else: installAddon
onAfterScaleOut:
scale: ${event.params.nodeGroup}
onAfterScaleIn:
scale: ${event.params.nodeGroup}
onAfterMigrate:
eval:
act: migrate
onAfterClone:
- script: delete MANIFEST.id; return {result:0, jps:MANIFEST};
- install[${targetNodes.nodeGroup}]: ${response.jps}
envName: ${event.response.env.envName}
settings: ${settings.toJSON()}
onBeforeDelete: cdnUninstall
onUninstall: cdnUninstall
actions:
installAddon:
- eval:
act: install
- if ("${settings.masterEnv:}"):
setGlobals:
envName: ${settings.masterEnv:}
- if (!"${settings.masterEnv:}"):
setGlobals:
envName: ${env.envName}
scale:
if ('${this}' == 'bl' || ('${this}' == 'cp' && !nodes.bl)):
eval:
act: scale
eval:
script: |-
var params = {masterEnv:"${settings.masterEnv:}", envName:"${env.envName}", action:"${this.act:script}", ha:"${settings.ha:}", header:"${settings.header:}", customCname:"${settings.customCname:}", path:"${this.path:}", note:"${settings.note:}"},
resp = api.dev.scripting.Eval("${globals.appid}", session, "cdn.${this.script:install}", params);
return resp.response ? resp.response:resp;
#TODO: send message to owner after change SSL option, strore in DB for charging job
config:
- checkClustering:
nodeGroup: ${targetNodes.nodeGroup}
app_id: ${globals.app_id}
- if (globals.cluster):
- if (!${globals.isSecondaryEnv}):
- eval:
act: config
- else:
- executeAction:
envName: ${globals.primaryEnvName}
nodeGroup: ${targetNodes.nodeGroup}
action: ${this.act:config}
app_id: ${globals.app_id}
settings:
customCname: ${settings.customCname:}
header: ${settings.header:}
- else:
- eval:
act: config
purgeSingle:
purge: ${settings.purgefile}
purge:
eval:
script: purge
path: ${this:}
cdnUninstall:
- eval:
script: uninstall
- checkClustering:
nodeGroup: ${targetNodes.nodeGroup}
app_id: ${globals.app_id}
- if (globals.cluster):
- if (!globals.isSecondaryExecuted):
- markExecutedEnvFile:
nodeGroup: ${targetNodes.nodeGroup}
app_id: ${globals.app_id}
- if (!globals.isOppositeExecuted):
- if (globals.isSecondaryEnv):
executeAction:
envName: ${globals.primaryEnvName}
nodeGroup: ${targetNodes.nodeGroup}
action: uninstall
app_id: ${globals.app_id}
- else:
executeAction:
envName: ${globals.secondaryEnvName}
nodeGroup: ${targetNodes.nodeGroup}
action: uninstall
app_id: ${globals.app_id}
- removeExecutedEnvFile:
nodeGroup: ${targetNodes.nodeGroup}
app_id: ${globals.app_id}
- removeExecutedEnvFile:
nodeGroup: ${targetNodes.nodeGroup}
app_id: ${globals.app_id}
extension: lock
success: /text/success.md