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