@adobe/helix-deploy 9.5.1 → 9.6.1
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 +14 -0
- package/package.json +2 -2
- package/src/deploy/AWSConfig.js +14 -2
- package/src/deploy/AWSDeployer.js +36 -0
- package/src/deploy/ComputeAtEdgeDeployer.js +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [9.6.1](https://github.com/adobe/helix-deploy/compare/v9.6.0...v9.6.1) (2024-01-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **fastly:** guard against missing gateway name ([#634](https://github.com/adobe/helix-deploy/issues/634)) ([da6a45c](https://github.com/adobe/helix-deploy/commit/da6a45ca8217454d68664937c28eacd54d1ee033))
|
|
7
|
+
|
|
8
|
+
# [9.6.0](https://github.com/adobe/helix-deploy/compare/v9.5.1...v9.6.0) (2024-01-08)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* clean up unused versions ([#636](https://github.com/adobe/helix-deploy/issues/636)) ([e516d1e](https://github.com/adobe/helix-deploy/commit/e516d1e3312e1fadbdfe57121c6f6099ec289af1))
|
|
14
|
+
|
|
1
15
|
## [9.5.1](https://github.com/adobe/helix-deploy/compare/v9.5.0...v9.5.1) (2024-01-06)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-deploy",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.6.1",
|
|
4
4
|
"description": "Library and Commandline Tools to build and deploy OpenWhisk Actions",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/adobe/helix-deploy#readme",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"@adobe/helix-status": "10.0.11",
|
|
76
76
|
"@semantic-release/changelog": "6.0.3",
|
|
77
77
|
"@semantic-release/git": "10.0.1",
|
|
78
|
-
"c8": "
|
|
78
|
+
"c8": "9.0.0",
|
|
79
79
|
"eslint": "8.56.0",
|
|
80
80
|
"husky": "8.0.3",
|
|
81
81
|
"lint-staged": "15.2.0",
|
package/src/deploy/AWSConfig.js
CHANGED
|
@@ -20,6 +20,7 @@ export default class AWSConfig {
|
|
|
20
20
|
role: '',
|
|
21
21
|
apiId: '',
|
|
22
22
|
cleanUpIntegrations: false,
|
|
23
|
+
cleanUpVersions: false,
|
|
23
24
|
createRoutes: false,
|
|
24
25
|
lambdaFormat: DEFAULT_LAMBDA_FORMAT,
|
|
25
26
|
parameterMgr: ['secret'],
|
|
@@ -47,6 +48,7 @@ export default class AWSConfig {
|
|
|
47
48
|
.withAWSAttachAuthorizer(argv.awsAttachAuthorizer)
|
|
48
49
|
.withAWSIdentitySources(argv.awsIdentitySource)
|
|
49
50
|
.withAWSCleanUpIntegrations(argv.awsCleanupIntegrations)
|
|
51
|
+
.withAWSCleanUpVersions(argv.awsCleanupVersions)
|
|
50
52
|
.withAWSCreateRoutes(argv.awsCreateRoutes)
|
|
51
53
|
.withAWSParamsManager(argv.awsParameterManager)
|
|
52
54
|
.withAWSDeployBucket(argv.awsDeployBucket)
|
|
@@ -90,6 +92,11 @@ export default class AWSConfig {
|
|
|
90
92
|
return this;
|
|
91
93
|
}
|
|
92
94
|
|
|
95
|
+
withAWSCleanUpVersions(value) {
|
|
96
|
+
this.cleanUpVersions = value;
|
|
97
|
+
return this;
|
|
98
|
+
}
|
|
99
|
+
|
|
93
100
|
withAWSCreateRoutes(value) {
|
|
94
101
|
this.createRoutes = value;
|
|
95
102
|
return this;
|
|
@@ -148,8 +155,8 @@ export default class AWSConfig {
|
|
|
148
155
|
static yarg(yargs) {
|
|
149
156
|
return yargs
|
|
150
157
|
.group(['aws-region', 'aws-api', 'aws-role', 'aws-cleanup-buckets', 'aws-cleanup-integrations',
|
|
151
|
-
'aws-
|
|
152
|
-
'aws-parameter-manager', 'aws-deploy-template', 'aws-arch', 'aws-update-secrets',
|
|
158
|
+
'aws-cleanup-versions', 'aws-create-routes', 'aws-create-authorizer', 'aws-attach-authorizer',
|
|
159
|
+
'aws-lambda-format', 'aws-parameter-manager', 'aws-deploy-template', 'aws-arch', 'aws-update-secrets',
|
|
153
160
|
'aws-deploy-bucket', 'aws-identity-source', 'aws-log-format', 'aws-layers',
|
|
154
161
|
'aws-tracing-mode', 'aws-extra-permissions'], 'AWS Deployment Options')
|
|
155
162
|
.option('aws-region', {
|
|
@@ -214,6 +221,11 @@ export default class AWSConfig {
|
|
|
214
221
|
type: 'boolean',
|
|
215
222
|
default: false,
|
|
216
223
|
})
|
|
224
|
+
.option('aws-cleanup-versions', {
|
|
225
|
+
description: 'Cleans up unused versions',
|
|
226
|
+
type: 'boolean',
|
|
227
|
+
default: false,
|
|
228
|
+
})
|
|
217
229
|
.option('aws-deploy-bucket', {
|
|
218
230
|
description: 'Name of the deploy S3 bucket to use (default is helix-deploy-bucket-{accountId})',
|
|
219
231
|
type: 'string',
|
|
@@ -634,6 +634,39 @@ export default class AWSDeployer extends BaseDeployer {
|
|
|
634
634
|
}
|
|
635
635
|
}
|
|
636
636
|
|
|
637
|
+
async cleanUpVersions() {
|
|
638
|
+
const { functionName } = this;
|
|
639
|
+
|
|
640
|
+
this.log.info('Clean up unused versions');
|
|
641
|
+
this.log.info(chalk`--: fetching aliases...`);
|
|
642
|
+
const aliases = await this.listAliases(functionName);
|
|
643
|
+
this.log.info(chalk`--: fetching versions...`);
|
|
644
|
+
const versions = (await this.listVersions(functionName))
|
|
645
|
+
.map((version) => ({
|
|
646
|
+
...version,
|
|
647
|
+
Aliases: aliases
|
|
648
|
+
.filter(({ FunctionVersion }) => version.Version === FunctionVersion)
|
|
649
|
+
.map(({ Name }) => Name),
|
|
650
|
+
}));
|
|
651
|
+
|
|
652
|
+
const unusedVersions = versions
|
|
653
|
+
.filter(({ Version }) => Version !== '$LATEST')
|
|
654
|
+
.filter(({ Aliases }) => Aliases.length === 0);
|
|
655
|
+
this.log.info(`Found ${unusedVersions.length} unused versions`);
|
|
656
|
+
|
|
657
|
+
if (unusedVersions.length) {
|
|
658
|
+
this.log.info(chalk`--: deleting unused versions...`);
|
|
659
|
+
const deleted = await processQueue(unusedVersions, async ({ Version }) => {
|
|
660
|
+
await this._lambda.send(new DeleteFunctionCommand({
|
|
661
|
+
FunctionName: functionName,
|
|
662
|
+
Qualifier: Version,
|
|
663
|
+
}));
|
|
664
|
+
return Version;
|
|
665
|
+
}, 2);
|
|
666
|
+
this.log.info(chalk`{green ok}: deleted ${deleted.length} unused versions.`);
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
|
|
637
670
|
async cleanUpIntegrations(filter) {
|
|
638
671
|
this.log.info('Clean up Integrations');
|
|
639
672
|
const { ApiId } = await this.initApiId();
|
|
@@ -959,6 +992,9 @@ export default class AWSDeployer extends BaseDeployer {
|
|
|
959
992
|
if (this._cfg.cleanUpIntegrations) {
|
|
960
993
|
await this.cleanUpIntegrations();
|
|
961
994
|
}
|
|
995
|
+
if (this._cfg.cleanUpVersions) {
|
|
996
|
+
await this.cleanUpVersions();
|
|
997
|
+
}
|
|
962
998
|
if (this._cfg.updateSecrets !== undefined) {
|
|
963
999
|
await this.updateSecrets();
|
|
964
1000
|
}
|
|
@@ -137,8 +137,10 @@ service_id = ""
|
|
|
137
137
|
max_conn: 200,
|
|
138
138
|
use_ssl: true,
|
|
139
139
|
};
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
if (host) {
|
|
141
|
+
this.log.debug(`--: updating gateway backend: ${host}`);
|
|
142
|
+
await this._fastly.writeBackend(version, 'gateway', backend);
|
|
143
|
+
}
|
|
142
144
|
}, true);
|
|
143
145
|
|
|
144
146
|
await this._fastly.discard();
|