Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
154 lines (125 sloc) 5.05 KB
jpsType: install
jpsVersion: '1.1'
id: wordpress
name: WordPress Standalone Kit
categories:
- apps/blogs
- apps/content-management
logo: https://raw.githubusercontent.com/jelastic-jps/wordpress/master/images/wp-standalone.png
homepage: http://wordpress.org/
description:
text: WordPress Standalone with built-in kit for choosing optimal application servers and a set of advanced features for running websites and blogs. WordPress CMS deployed as a lightweight standalone container with minimal allocated resources for cost efficiency.
short: WordPress Standalone with built-in kit for choosing optimal application servers and a set of advanced features for running websites and blogs
baseUrl: https://raw.githubusercontent.com/jelastic-jps/wordpress/master/wordpress
onBeforeInit: /scripts/settings.js?_r=${fn.random}
onBeforeInstall: /scripts/beforeinstall.js?_r=${fn.random}
skipNodeEmails: true
nodes: definedInOnBeforeInstall
globals:
DB_USER: jelastic-${fn.random}
DB_PASS: ${fn.password(10)}
DB_HOST: 127.0.0.1
PROTOCOL: http
WP_ADMIN_PASS: ${fn.password(10)}
SUCCESS: success
EMAIL: default
STACK: nginx
onAfterInstallAddon [nodeGroup:cp, id:cdn]:
- install: ${baseUrl}/scripts/setupCDN.jps
settings:
PATH: ${baseUrl}
onAfterBindSSL: setupDomain
onInstall:
- script: |
return {
result:0,
ssl: jelastic.billing.account.GetQuotas('environment.jelasticssl.enabled').array[0].value
}
- if (${response.ssl}):
setGlobals:
PROTOCOL: https
- script: ${baseUrl}/scripts/idna.js
- setGlobals:
DOMAIN: ${response.domain}
- log: Set Node Display Name
- setNodeDisplayName [cp]: AppServer
- creatUserDB
- setupNode:
nodeId: cp
- if (${settings.le-addon:false}):
- setGlobals:
PROTOCOL: https
- install-wordpress
- if (${settings.mu-addon:false}): configure-MU
- if (${settings.le-addon:false}):
- install-LE-addon
- setupDomain
- if (${settings.cdn-addon:false}): install-edgeport-CDN
- if (${settings.ls-addon:false}):
setGlobals:
STACK: ls
actions:
install-LE-addon:
- install: https://github.com/jelastic-jps/lets-encrypt/blob/master/manifest.jps?_r=${fn.random}
nodeGroup: cp
skipEmail: true
settings:
customDomains: ${globals.DOMAIN}
setupDomain:
- cmd[cp]: source /opt/letsencrypt/settings && echo $domain
- set:
domain: ${response.out}
- cmd[${nodes.cp.master.id}]: bash ~/bin/setupWP.sh --DOMAIN https://${this.domain}
install-edgeport-CDN:
- install: https://raw.githubusercontent.com/edgeport/cdn/master/manifest.yml?_r=${fn.random}
nodeGroup: cp
skipEmail: true
settings:
note: ${settings.noteCDN:}
- script: return jelastic.dev.scripting.Eval("c05ffa5b45628a2a0c95467ebca8a0b4", session, "cdn.info", {partnerCode:1})
- setGlobals:
CDN_URL: ${globals.PROTOCOL}://${env.envName}-${response.response.partnerCode}.cdn.edgeport.net/
CDN: ${env.envName}-${response.response.partnerCode}.cdn.edgeport.net
SUCCESS: success-cdn
EMAIL: cdn
- cmd[${nodes.cp.master.id}]: |-
wget ${baseUrl}/scripts/setupWP.sh?_r=${fn.random} -O ~/bin/setupWP.sh &>> /var/log/run.log
wget ${baseUrl}/scripts/checkCdnContent.txt?_r=${fn.random} -O ~/bin/checkCdnContent.txt &>> /var/log/run.log
bash ~/bin/setupWP.sh --edgeportCDN true --CDN_URL ${globals.CDN}
configure-MU:
- install: https://raw.githubusercontent.com/jelastic-jps/wordpress-cluster/master/addon/WPMU.jps
settings:
mode: subdir
install-wordpress:
- install: ${baseUrl}/scripts/installWP.jps
settings:
db_host: ${globals.DB_HOST}
db_user: ${globals.DB_USER}
db_pass: ${globals.DB_PASS}
wp_admin_pass: ${globals.WP_ADMIN_PASS}
wp_title: "Hello World"
wp_url: ${globals.PROTOCOL}://${globals.DOMAIN}/
targetNodeID: ${nodes.cp.master.id}
setupNode:
- log: OPTIMIZATION
- install: https://raw.githubusercontent.com/jelastic/templates/master/config.jps?_r=${fn.random}
settings:
targetGroup: cp
targetNodes: ${this.nodeId}
optimization: wordpress
- log: Wordpress CLI Installation
- install: ${baseUrl}/scripts/WP-CLI.jps?_r=${fn.random}
settings:
TARGET_NODES: ${this.nodeId}
creatUserDB:
- log: Create user for DataBase
- cmd [cp]: |-
wget ${baseUrl}/configs/sqldb/wordpress.cnf -O /etc/mysql/conf.d/wordpress.cnf &>> /var/log/run.log
wget https://raw.githubusercontent.com/jelastic-jps/mysql-cluster/master/scripts/setupUser.sh -O ~/setupUser.sh &>> /var/log/run.log
bash ~/setupUser.sh ${globals.DB_USER} ${globals.DB_PASS} &>> /var/log/run.log
jem passwd set -p ${globals.DB_PASS} &>> /var/log/run.log
user: root
success:
email: success/email/success-${globals.STACK}-${globals.EMAIL}.md?_r=${fn.random}
text: success/text/${globals.SUCCESS}.md?_r=${fn.random}
startPage: ${globals.PROTOCOL}://${env.domain}/
You can’t perform that action at this time.