forked from jelastic-jps/ghost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanifest.jps
97 lines (82 loc) · 2.91 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
version: '1.5'
appVersion: latest
type: install
id: ghost
name: Ghost
baseUrl: https://raw.githubusercontent.com/jelastic-jps/ghost/master
logo: /images/ghost-white.png
homepage: https://ghost.org/
categories:
- apps/content-management
description:
text: /texts/description.md
short: The professional publishing platform
success:
/texts/success.md
globals:
configPath: /home/jelastic/ROOT/core/server/config
defaultConfig: ${globals.configPath}/defaults.json
configDevelopment: ${globals.configPath}/env/config.development.json
configProduction: ${globals.configPath}/env/config.production.json
onBeforeInit: |
var url = "https://registry.hub.docker.com/v1/repositories/jelastic/nodejs/tags";
var tags = toNative(new com.hivext.api.core.utils.Transport().get(url)).sort();
var def = "13.1.0-forever", result = "", ver = {};
for (var i = 0; i < tags.length; i++) {
ver[tags[i].name] = tags[i].name;
if (tags[i].name == def) {
result = tags[i].name;
}
}
return {
result:0,
settings: {
fields: [{
name: "version",
caption: "Node.js Version",
type: "list",
values: ver,
"default": result || tags[0].name
}]
}
};
nodes:
- cloudlets: 18
nodeType: nodejs
tag: ${settings.version}
env:
NODE_ENV: production
- cloudlets: 8
nodeType: mysql
onInstall:
- deployArchive
- createDb
- deployHomeDir
- restartNodes:
nodeGroup: [cp]
- migration_lock_remove
- restartNodes:
nodeGroup: [cp]
actions:
deployArchive:
deploy:
name: Ghost-latest
context: ROOT
archive: https://download.jelastic.com/public.php?service=files&t=89c95da37d36c166e32bc0edcd32b38d&download
deployHomeDir:
cmd[cp]:
sed -i 's|"url":\ "http:\/\/localhost:2368",|"url":"http:\/\/${env.domain}",|g' ${globals.defaultConfig};
sed -i 's|"host":\ "127.0.0.1",|"host":"${nodes.cp.master.intIP}",|g' ${globals.defaultConfig};
sed -i 's|2368|8080|g' ${globals.defaultConfig};
sed -i 's|"url":\ "http:\/\/localhost:2368",|"url":\ "http:\/\/${env.domain}",|g' ${globals.configDevelopment};
sed -i 's|"client":\ "sqlite3",|"client":\ "mysql",|g' ${globals.configDevelopment};
sed -i 's|"filename":\ "content\/data\/ghost-dev.db"|"host":\ "${nodes.sqldb.master.intIP}",\n"user":\ "root",\n"password":\ "${nodes.mysql.password}",\n"database":\ "ghost"|g' ${globals.configDevelopment};
sed -i 's|127.0.0.1|${nodes.sqldb.master.intIP}|g' ${globals.configProduction};
sed -i 's|"password"\ :\ ""|"password"\ :\ "${nodes.mysql.password}"|g' ${globals.configProduction};
cd $HOME/ROOT;
createDb:
cmd[sqldb]:
mysql -uroot -p${nodes.mysql.password} -e "create database ghost" 2>&1 1>/dev/null
migration_lock_remove:
cmd[sqldb]:
mysql -uroot -p${nodes.mysql.password} -e "use ghost;UPDATE migrations_lock set locked=0 where lock_key='km01';"