forked from jelastic-jps/wordpress-cluster
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanifest.jps
More file actions
155 lines (155 loc) · 6.04 KB
/
manifest.jps
File metadata and controls
155 lines (155 loc) · 6.04 KB
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
{
"jpsType": "install",
"jpsVersion": "1.1",
"name": "WordPress Cluster",
"categories": ["apps/clustered-dbs", "apps/popular", "apps/clusters", "apps/dev-and-admin-tools"],
"description": "Get your highly available and scalable clustered solution for WordPress, the extremely popular open source CMS and blogging tool. This package is designed to ensure the load tracking and distribution, as well as automatic adjusting the amount of allocated resources according to it.",
"logo": "https://raw.githubusercontent.com/jelastic-jps/wordpress-cluster/master/images/wp-cluster.png",
"settings": {
"fields": [{
"name": "wp_title",
"caption": "WP Title",
"type": "string",
"default": "HelloWorld",
"required": "true",
"regex": "^[\\w-.]*$",
"regexText": "Incorrect WP Title."
}]
},
"ssl": false,
"nodes": [{
"nodeType": "mysql",
"count": 2,
"cloudlets": 8,
"nodeGroup": "sqldb",
"displayName": "Database"
}, {
"nodeType": "nginxphp",
"count": 2,
"cloudlets": 8,
"nodeGroup": "cp",
"links": "sqldb:DB",
"volumes": ["/var/www/webroot/ROOT", "/var/ftp/webroot/ROOT"],
"volumeMounts": {
"/var/www/webroot/ROOT": {
"readOnly": false,
"sourcePath": "/data",
"sourceNodeGroup": "storage"
},
"/var/ftp/webroot/ROOT": {
"readOnly": false,
"sourcePath": "/data",
"sourceNodeGroup": "storage"
}
},
"displayName": "AppServer"
}, {
"nodeType": "storage",
"cloudlets": 8,
"nodeGroup": "storage",
"displayName": "Storage"
}, {
"nodeType": "nginx",
"count": 1,
"cloudlets": 8,
"nodeGroup": "bl",
"displayName": "Load balancer"
}],
"onAfterScaleOut[nodeGroup:cp]": {
"forEach(event.response.nodes)": {
"cmd [${@i.id}]": "sudo service nginx reload",
"setNodeDisplayName [${@i.id}]": "AppServer"
}
},
"onAfterScaleOut[nodeGroup:bl]": {
"forEach(event.response.nodes)": {
"setNodeDisplayName [${@i.id}]": "Load balancer"
}
},
"globals": {
"PATH": "https://raw.githubusercontent.com/jelastic-jps/wordpress-cluster/master",
"DB_USER": "jelastic-${fn.random}",
"DB_PASS": "${fn.password(20)}",
"ADMIN_PASSWD": "${fn.password(20)}"
},
"onInstall": [{
"log": "Auto Scaling Triggers"
}, {
"script": "${globals.PATH}/scripts/addTriggers.js"
}, {
"log": "DB Multi-Master Cluster Setup"
}, {
"installJps": {
"jps": "https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/master/scripts/multimaster-configuration.jps",
"settings": {
"db_user": "${globals.DB_USER}",
"db_pass": "${globals.DB_PASS}",
"custom_conf": "${globals.PATH}/configs/mysql/mysql.cnf"
}
}
}, {
"script": [
"jelastic.development.scripting.Eval(MARKETPLACE_APPID, session, 'GetNextEvent', { criteria: {'params.actionKey' : { like : '%${env.shortdomain}%' }}});",
"return { result : 0};"
]
}, {
"log": "CP Layer Setup"
}, {
"forEach(nodes.cp)": {
"setupNode": {
"nodeId": "${@i.id}"
}
}
}, {
"log": "Download and Unpack latest WordPress release"
}, {
"cmd[storage]": ["wget -qO- 'https://wordpress.org/latest.tar.gz' | tar xz -C /tmp && mv /tmp/wordpress/* /data"]
}, {
"log": "Setup WordPress"
}, {
"installJps": {
"jps": "${globals.PATH}/addons/setup-wordpress.jps",
"settings": {
"db_host": "DB_1",
"db_user": "${globals.DB_USER}",
"db_pass": "${globals.DB_PASS}",
"admin_passwd": "${globals.ADMIN_PASSWD}",
"wp_title": "${settings.wp_title}"
}
}
}, {
"log": "Install HyperDB - is an advanced database class that supports replication, failover, load balancing and partitioning. "
}, {
"cmd[storage]": [
"wget ${globals.PATH}/configs/wordpress/db-config.php -O /data/db-config.php",
"wget ${globals.PATH}/configs/wordpress/db.php -O /data/wp-content/db.php"
]
}, {
"log": "Additional configuration for WordPress."
}, {
"cmd[storage]": [
"wget ${globals.PATH}/configs/wordpress/wp-jelastic.php -O /data/wp-jelastic.php",
"echo \"require_once ABSPATH . 'wp-jelastic.php';\" >> /data/wp-config.php"
]
}, {
"log": "Plugins install"
}, {
"installJps": {
"jps": "${globals.PATH}/addons/install-plugins.jps",
"settings": {
"plugins_list": "${globals.PATH}/configs/wordpress/plugins"
}
}
}],
"actions": {
"setupNode": [{
"cmd[${this.nodeId}]": [
"wget ${globals.PATH}/configs/nginx/nginx.conf -O /etc/nginx/nginx.conf",
"wget ${globals.PATH}/configs/nginx/default.conf -O /etc/nginx/conf.d/default.conf",
"wget ${globals.PATH}/configs/php/wp-upload.ini -O /etc/php.d/wp-upload.ini",
"sudo service nginx restart"
]
}]
},
"success": "Below you will find your admin panel link, username and password.</br></br> <table style='font-size:14px'><tr><td>Admin panel URL:</td><td><a href='${env.protocol}://${env.domain}/wp-admin/' target='_blank'>${env.protocol}://${env.domain}/wp-admin/</a></td></tr><tr><td>Login:</td><td><b>admin</b></td></tr><tr><td>Password:</td><td><b>${globals.ADMIN_PASSWD}</b></td></tr></table></br>To add custom domain name for your WordPress installation follow the steps described in our <a href='http://docs.jelastic.com/custom-domains' target='_blank'>documentation</a>"
}