Revert
parent
3042f27f17
commit
b9b56619bc
|
@ -31,12 +31,13 @@ globals:
|
||||||
DB_PASS: ${fn.password(10)}
|
DB_PASS: ${fn.password(10)}
|
||||||
DB_HOST: 127.0.0.1
|
DB_HOST: 127.0.0.1
|
||||||
PROTOCOL: http
|
PROTOCOL: http
|
||||||
WP_ADMIN_PASS: ${settings.WP_ADMIN_PASS:[fn.password(10)]}
|
WP_ADMIN_PASS: ${fn.password(10)}
|
||||||
|
SUCCESS: default
|
||||||
le-addon: true
|
le-addon: true
|
||||||
DOMAIN: ${env.domain}
|
DOMAIN: ${env.domain}
|
||||||
|
WP_ADMIN_PASS: ${fn.password(10)}
|
||||||
WP_TITLE: ${env.domain}
|
WP_TITLE: ${env.domain}
|
||||||
WP_URL: ${globals.PROTOCOL}://${globals.DOMAIN}/
|
WP_URL: ${globals.PROTOCOL}://${globals.DOMAIN}/
|
||||||
SUCCESS: default
|
|
||||||
|
|
||||||
onInstall:
|
onInstall:
|
||||||
- addLimits
|
- addLimits
|
||||||
|
@ -127,7 +128,6 @@ actions:
|
||||||
user: root
|
user: root
|
||||||
|
|
||||||
installWordpress:
|
installWordpress:
|
||||||
- log: INSTALLING WordPress
|
|
||||||
- install: ${globals.BASE_URL}/scripts/installWP.jps
|
- install: ${globals.BASE_URL}/scripts/installWP.jps
|
||||||
settings:
|
settings:
|
||||||
db_host: ${globals.DB_HOST}
|
db_host: ${globals.DB_HOST}
|
||||||
|
@ -136,12 +136,11 @@ actions:
|
||||||
redis_host: /var/run/redis/redis.sock
|
redis_host: /var/run/redis/redis.sock
|
||||||
redis_port: 0
|
redis_port: 0
|
||||||
wp_admin_pass: ${globals.WP_ADMIN_PASS}
|
wp_admin_pass: ${globals.WP_ADMIN_PASS}
|
||||||
wp_title: ${globals.WP_TITLE}
|
wp_title: "Hello World"
|
||||||
wp_url: ${globals.PROTOCOL}://${globals.DOMAIN}/
|
wp_url: ${globals.PROTOCOL}://${globals.DOMAIN}/
|
||||||
cluster: false
|
cluster: false
|
||||||
|
|
||||||
installMBaddons:
|
installMBaddons:
|
||||||
- log: INSTALLING MightyBox Add-Ons
|
|
||||||
- install: https://deploy.mightybox.io/addons/mb-backup-manager/raw/branch/main/manifest.jps
|
- install: https://deploy.mightybox.io/addons/mb-backup-manager/raw/branch/main/manifest.jps
|
||||||
nodeGroup: cp
|
nodeGroup: cp
|
||||||
|
|
||||||
|
|
|
@ -2,18 +2,53 @@ actions:
|
||||||
applyEnvSettings:
|
applyEnvSettings:
|
||||||
script: |
|
script: |
|
||||||
var envs = '${this.targetAppid}'.split(',');
|
var envs = '${this.targetAppid}'.split(',');
|
||||||
for (var i=0, n = envs.length; i < n; i++) {
|
var desiredCloudlets = parseInt('${this.cloudlets}');
|
||||||
let targetAppid = envs[i];
|
var desiredDiskSpace = parseInt('${this.diskspace}');
|
||||||
let resp = jelastic.env.control.GetEnvInfo(targetAppid, session);
|
|
||||||
if (resp.result != 0) return resp;
|
for (var i = 0, n = envs.length; i < n; i++) {
|
||||||
let node = resp.nodes[0];
|
var targetAppid = envs[i];
|
||||||
if (String(node.flexibleCloudlets) != '${this.cloudlets}') {
|
var resp = jelastic.env.control.GetEnvInfo(targetAppid, session);
|
||||||
resp = jelastic.env.control.SetCloudletsCountByGroup({ appid: targetAppid, session: session, nodeGroup: node.nodeGroup, fixedCloudlets: node.fixedCloudlets, flexibleCloudlets: '${this.cloudlets}'});
|
if (resp.result != 0) {
|
||||||
if (resp.result != 0) return resp;
|
return {
|
||||||
|
result: resp.result,
|
||||||
|
error: 'Failed to get environment info for ' + targetAppid + ': ' + resp.error,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
if (String(node.diskLimit) != '${this.diskspace}') {
|
if (!resp.nodes || resp.nodes.length === 0) {
|
||||||
resp = jelastic.env.control.SetDiskLimitByGroup({ appid: targetAppid, session: session, nodeGroup: node.nodeGroup, limit: '${this.diskspace}' });
|
return {
|
||||||
if (resp.result != 0) return resp;
|
result: 1,
|
||||||
|
error: 'No nodes found in environment ' + targetAppid,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
var node = resp.nodes[0];
|
||||||
|
if (parseInt(node.flexibleCloudlets) !== desiredCloudlets) {
|
||||||
|
resp = jelastic.env.control.SetCloudletsCountByGroup({
|
||||||
|
envName: targetAppid,
|
||||||
|
session: session,
|
||||||
|
nodeGroup: node.nodeGroup,
|
||||||
|
fixedCloudlets: parseInt(node.fixedCloudlets),
|
||||||
|
flexibleCloudlets: desiredCloudlets,
|
||||||
|
});
|
||||||
|
if (resp.result != 0) {
|
||||||
|
return {
|
||||||
|
result: resp.result,
|
||||||
|
error: 'Failed to set cloudlets for ' + targetAppid + ': ' + resp.error,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (parseInt(node.diskLimit) !== desiredDiskSpace) {
|
||||||
|
resp = jelastic.env.control.SetDiskLimitByGroup({
|
||||||
|
envName: targetAppid,
|
||||||
|
session: session,
|
||||||
|
nodeGroup: node.nodeGroup,
|
||||||
|
limit: desiredDiskSpace,
|
||||||
|
});
|
||||||
|
if (resp.result != 0) {
|
||||||
|
return {
|
||||||
|
result: resp.result,
|
||||||
|
error: 'Failed to set disk space for ' + targetAppid + ': ' + resp.error,
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return { result: 0 };
|
return { result: 0 };
|
Loading…
Reference in New Issue