@fishawack/lab-env 5.9.0-beta.4 → 5.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/README.md +78 -0
- package/_Test/force-managed-updates.js +1205 -0
- package/cli.js +1 -0
- package/commands/create/cmds/force-managed-updates.js +689 -0
- package/commands/create/services/aws/elasticbeanstalk.js +131 -0
- package/drupal/9/php/CHANGELOG.md +3 -0
- package/drupal/9/php/Dockerfile +1 -1
- package/drupal/9/php/package.json +1 -1
- package/globals.js +12 -4
- package/laravel/10/php/CHANGELOG.md +3 -0
- package/laravel/10/php/package.json +1 -1
- package/laravel/9/php/CHANGELOG.md +3 -0
- package/laravel/9/php/Dockerfile +1 -1
- package/laravel/9/php/package.json +1 -1
- package/package.json +1 -1
- package/php/8.2/CHANGELOG.md +3 -0
- package/php/8.2/package.json +1 -1
- package/wordpress/1/php/CHANGELOG.md +3 -0
- package/wordpress/1/php/Dockerfile +1 -1
- package/wordpress/1/php/package.json +1 -1
|
@@ -18,6 +18,12 @@ const {
|
|
|
18
18
|
ListAvailableSolutionStacksCommand,
|
|
19
19
|
ListTagsForResourceCommand,
|
|
20
20
|
RestartAppServerCommand,
|
|
21
|
+
DescribeEnvironmentManagedActionsCommand,
|
|
22
|
+
DescribeEnvironmentManagedActionHistoryCommand,
|
|
23
|
+
ApplyEnvironmentManagedActionCommand,
|
|
24
|
+
DescribePlatformVersionCommand,
|
|
25
|
+
ListPlatformVersionsCommand,
|
|
26
|
+
DescribeEventsCommand,
|
|
21
27
|
} = require("@aws-sdk/client-elastic-beanstalk");
|
|
22
28
|
const { Spinner, poll } = require("../../libs/utilities");
|
|
23
29
|
const { eb, secretGroups, awsClientConfig } = require("../../libs/vars");
|
|
@@ -25,6 +31,131 @@ const { template } = require("lodash");
|
|
|
25
31
|
|
|
26
32
|
const getClient = () => new ElasticBeanstalkClient(awsClientConfig);
|
|
27
33
|
|
|
34
|
+
module.exports.describePlatformVersion = async (PlatformArn) => {
|
|
35
|
+
const response = await getClient().send(
|
|
36
|
+
new DescribePlatformVersionCommand({ PlatformArn }),
|
|
37
|
+
);
|
|
38
|
+
return response.PlatformDescription || null;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
module.exports.listBranchPlatformVersions = async (PlatformBranchName) => {
|
|
42
|
+
const versions = [];
|
|
43
|
+
let NextToken;
|
|
44
|
+
do {
|
|
45
|
+
const response = await getClient().send(
|
|
46
|
+
new ListPlatformVersionsCommand({
|
|
47
|
+
Filters: [
|
|
48
|
+
{
|
|
49
|
+
Type: "PlatformBranchName",
|
|
50
|
+
Operator: "=",
|
|
51
|
+
Values: [PlatformBranchName],
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
Type: "PlatformStatus",
|
|
55
|
+
Operator: "=",
|
|
56
|
+
Values: ["Ready"],
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
MaxRecords: 100,
|
|
60
|
+
NextToken,
|
|
61
|
+
}),
|
|
62
|
+
);
|
|
63
|
+
versions.push(...(response.PlatformSummaryList || []));
|
|
64
|
+
NextToken = response.NextToken;
|
|
65
|
+
} while (NextToken);
|
|
66
|
+
return versions;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
module.exports.updateEnvironmentPlatform = async (
|
|
70
|
+
EnvironmentId,
|
|
71
|
+
PlatformArn,
|
|
72
|
+
) => {
|
|
73
|
+
return new ElasticBeanstalkClient({
|
|
74
|
+
...awsClientConfig,
|
|
75
|
+
maxAttempts: 1,
|
|
76
|
+
}).send(new UpdateEnvironmentCommand({ EnvironmentId, PlatformArn }));
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
module.exports.getEnvironmentUpdateEvents = async (
|
|
80
|
+
EnvironmentId,
|
|
81
|
+
StartTime,
|
|
82
|
+
) => {
|
|
83
|
+
const events = [];
|
|
84
|
+
let NextToken;
|
|
85
|
+
do {
|
|
86
|
+
const response = await getClient().send(
|
|
87
|
+
new DescribeEventsCommand({
|
|
88
|
+
EnvironmentId,
|
|
89
|
+
StartTime,
|
|
90
|
+
NextToken,
|
|
91
|
+
MaxRecords: 100,
|
|
92
|
+
}),
|
|
93
|
+
);
|
|
94
|
+
events.push(...(response.Events || []));
|
|
95
|
+
NextToken = response.NextToken;
|
|
96
|
+
} while (NextToken);
|
|
97
|
+
return events;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
module.exports.listAccountEnvironments = async () => {
|
|
101
|
+
const environments = [];
|
|
102
|
+
let NextToken;
|
|
103
|
+
|
|
104
|
+
do {
|
|
105
|
+
const response = await getClient().send(
|
|
106
|
+
new DescribeEnvironmentsCommand({
|
|
107
|
+
IncludeDeleted: false,
|
|
108
|
+
MaxRecords: 100,
|
|
109
|
+
NextToken,
|
|
110
|
+
}),
|
|
111
|
+
);
|
|
112
|
+
environments.push(...(response.Environments || []));
|
|
113
|
+
NextToken = response.NextToken;
|
|
114
|
+
} while (NextToken);
|
|
115
|
+
|
|
116
|
+
return environments.filter(
|
|
117
|
+
(environment) =>
|
|
118
|
+
!["Terminated", "Terminating"].includes(environment.Status),
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
module.exports.getManagedActions = async (EnvironmentId) => {
|
|
123
|
+
const response = await getClient().send(
|
|
124
|
+
new DescribeEnvironmentManagedActionsCommand({ EnvironmentId }),
|
|
125
|
+
);
|
|
126
|
+
return response.ManagedActions || [];
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
module.exports.getManagedActionHistory = async (EnvironmentId, ActionId) => {
|
|
130
|
+
let NextToken;
|
|
131
|
+
|
|
132
|
+
do {
|
|
133
|
+
const response = await getClient().send(
|
|
134
|
+
new DescribeEnvironmentManagedActionHistoryCommand({
|
|
135
|
+
EnvironmentId,
|
|
136
|
+
MaxItems: 100,
|
|
137
|
+
NextToken,
|
|
138
|
+
}),
|
|
139
|
+
);
|
|
140
|
+
const action = (response.ManagedActionHistoryItems || []).find(
|
|
141
|
+
(item) => item.ActionId === ActionId,
|
|
142
|
+
);
|
|
143
|
+
if (action) return action;
|
|
144
|
+
NextToken = response.NextToken;
|
|
145
|
+
} while (NextToken);
|
|
146
|
+
|
|
147
|
+
return null;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
module.exports.applyManagedAction = async (EnvironmentId, ActionId) => {
|
|
151
|
+
return new ElasticBeanstalkClient({
|
|
152
|
+
...awsClientConfig,
|
|
153
|
+
maxAttempts: 1,
|
|
154
|
+
}).send(
|
|
155
|
+
new ApplyEnvironmentManagedActionCommand({ EnvironmentId, ActionId }),
|
|
156
|
+
);
|
|
157
|
+
};
|
|
158
|
+
|
|
28
159
|
module.exports.createElasticBeanstalkApplication = async (name, tags = []) => {
|
|
29
160
|
let res = await Spinner.prototype.simple(
|
|
30
161
|
`Creating elasticbeanstalk application ${name}`,
|
package/drupal/9/php/Dockerfile
CHANGED
package/globals.js
CHANGED
|
@@ -236,7 +236,9 @@ if (composer && composer.require && composer.require["laravel/framework"]) {
|
|
|
236
236
|
args[0] !== "rekey" &&
|
|
237
237
|
args[0] !== "lint" &&
|
|
238
238
|
args[0] !== "workspace" &&
|
|
239
|
-
args[0] !== "prune"
|
|
239
|
+
args[0] !== "prune" &&
|
|
240
|
+
args[0] !== "force-managed-updates" &&
|
|
241
|
+
args[0] !== "fmu"
|
|
240
242
|
) {
|
|
241
243
|
unknownLabEnvConfig(platform, version);
|
|
242
244
|
}
|
|
@@ -283,7 +285,9 @@ if (composer && composer.require && composer.require["laravel/framework"]) {
|
|
|
283
285
|
args[0] !== "rekey" &&
|
|
284
286
|
args[0] !== "lint" &&
|
|
285
287
|
args[0] !== "workspace" &&
|
|
286
|
-
args[0] !== "prune"
|
|
288
|
+
args[0] !== "prune" &&
|
|
289
|
+
args[0] !== "force-managed-updates" &&
|
|
290
|
+
args[0] !== "fmu"
|
|
287
291
|
) {
|
|
288
292
|
unknownLabEnvConfig(platform, version);
|
|
289
293
|
}
|
|
@@ -359,7 +363,9 @@ if (process.env.FW_NEXT || forced) {
|
|
|
359
363
|
args[0] !== "rekey" &&
|
|
360
364
|
args[0] !== "lint" &&
|
|
361
365
|
args[0] !== "workspace" &&
|
|
362
|
-
args[0] !== "prune"
|
|
366
|
+
args[0] !== "prune" &&
|
|
367
|
+
args[0] !== "force-managed-updates" &&
|
|
368
|
+
args[0] !== "fmu"
|
|
363
369
|
) {
|
|
364
370
|
if (version) {
|
|
365
371
|
unknownLabEnvConfig("core", version);
|
|
@@ -720,7 +726,9 @@ if (
|
|
|
720
726
|
args[0] !== "rekey" &&
|
|
721
727
|
args[0] !== "lint" &&
|
|
722
728
|
args[0] !== "workspace" &&
|
|
723
|
-
args[0] !== "prune"
|
|
729
|
+
args[0] !== "prune" &&
|
|
730
|
+
args[0] !== "force-managed-updates" &&
|
|
731
|
+
args[0] !== "fmu"
|
|
724
732
|
) {
|
|
725
733
|
if (!forced) {
|
|
726
734
|
// Stop here if diagnosis either unset or outdated
|
package/laravel/9/php/Dockerfile
CHANGED
package/package.json
CHANGED
package/php/8.2/CHANGELOG.md
CHANGED
package/php/8.2/package.json
CHANGED