@adobe/helix-deploy 5.0.0 → 5.0.4
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 +28 -0
- package/CONTRIBUTING.md +6 -0
- package/package.json +20 -20
- package/src/ActionBuilder.js +3 -3
- package/src/BaseConfig.js +1 -1
- package/src/bundler/BaseBundler.js +2 -2
- package/src/bundler/RollupBundler.js +1 -1
- package/src/bundler/WebpackBundler.js +1 -1
- package/src/cli.js +2 -2
- package/src/deploy/AWSDeployer.js +36 -19
- package/src/deploy/BaseDeployer.js +12 -12
- package/src/deploy/GoogleDeployer.js +1 -1
- package/src/deploy/OpenWhiskDeployer.js +8 -8
- package/src/gateway/FastlyGateway.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
## [5.0.4](https://github.com/adobe/helix-deploy/compare/v5.0.3...v5.0.4) (2022-01-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** update external fixes ([#349](https://github.com/adobe/helix-deploy/issues/349)) ([ab4ceda](https://github.com/adobe/helix-deploy/commit/ab4cedaf66372443c401d0a476af3b5f11860c4b))
|
|
7
|
+
|
|
8
|
+
## [5.0.3](https://github.com/adobe/helix-deploy/compare/v5.0.2...v5.0.3) (2021-12-14)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* wait for aws states completed between deploy steps ([#348](https://github.com/adobe/helix-deploy/issues/348)) ([9cf29ee](https://github.com/adobe/helix-deploy/commit/9cf29ee9807d6334fb951a2a21532ea56b7f9e72))
|
|
14
|
+
|
|
15
|
+
## [5.0.2](https://github.com/adobe/helix-deploy/compare/v5.0.1...v5.0.2) (2021-12-11)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **deps:** update external fixes ([b898a1d](https://github.com/adobe/helix-deploy/commit/b898a1da4e06a20cb616cf524458a98608124e6c))
|
|
21
|
+
|
|
22
|
+
## [5.0.1](https://github.com/adobe/helix-deploy/compare/v5.0.0...v5.0.1) (2021-12-07)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* **deps:** update external fixes ([eca546c](https://github.com/adobe/helix-deploy/commit/eca546ce271ba6c6d37fcf1572f5d1d0f5c068b2))
|
|
28
|
+
|
|
1
29
|
# [5.0.0](https://github.com/adobe/helix-deploy/compare/v4.15.1...v5.0.0) (2021-12-02)
|
|
2
30
|
|
|
3
31
|
|
package/CONTRIBUTING.md
CHANGED
|
@@ -72,3 +72,9 @@ The project's committers will release to the [Adobe organization on npmjs.org](h
|
|
|
72
72
|
Please contact the [Adobe Open Source Advisory Board](https://git.corp.adobe.com/OpenSourceAdvisoryBoard/discuss/issues) to get access to the npmjs organization.
|
|
73
73
|
|
|
74
74
|
The release process is fully automated using `semantic-release`, increasing the version numbers, etc. based on the contents of the commit messages found.
|
|
75
|
+
|
|
76
|
+
# Managing Secrets
|
|
77
|
+
|
|
78
|
+
## Azure
|
|
79
|
+
|
|
80
|
+
The Azure deployment is using an application secret that is expiring on a regular basis. To update the secret, refer to the [Azure Active Directory Documentation on configuring access policies on resources](https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal#option-2-create-a-new-application-secret)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-deploy",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.4",
|
|
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",
|
|
@@ -39,38 +39,38 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@adobe/fastly-native-promises": "2.0.0",
|
|
41
41
|
"@adobe/helix-fetch": "3.0.0",
|
|
42
|
-
"@aws-sdk/client-apigatewayv2": "3.
|
|
43
|
-
"@aws-sdk/client-lambda": "3.
|
|
44
|
-
"@aws-sdk/client-s3": "3.
|
|
45
|
-
"@aws-sdk/client-secrets-manager": "3.
|
|
46
|
-
"@aws-sdk/client-ssm": "3.
|
|
42
|
+
"@aws-sdk/client-apigatewayv2": "3.45.0",
|
|
43
|
+
"@aws-sdk/client-lambda": "3.45.0",
|
|
44
|
+
"@aws-sdk/client-s3": "3.45.0",
|
|
45
|
+
"@aws-sdk/client-secrets-manager": "3.45.0",
|
|
46
|
+
"@aws-sdk/client-ssm": "3.45.0",
|
|
47
47
|
"@azure/arm-appservice": "9.0.0",
|
|
48
|
-
"@azure/ms-rest-nodeauth": "3.1.
|
|
48
|
+
"@azure/ms-rest-nodeauth": "3.1.1",
|
|
49
49
|
"@fastly/js-compute": "0.2.1",
|
|
50
50
|
"@google-cloud/functions": "1.2.0",
|
|
51
51
|
"@google-cloud/secret-manager": "3.10.1",
|
|
52
|
-
"@google-cloud/storage": "5.16.
|
|
53
|
-
"@rollup/plugin-alias": "3.1.
|
|
52
|
+
"@google-cloud/storage": "5.16.1",
|
|
53
|
+
"@rollup/plugin-alias": "3.1.9",
|
|
54
54
|
"@rollup/plugin-commonjs": "21.0.1",
|
|
55
55
|
"@rollup/plugin-json": "4.1.0",
|
|
56
|
-
"@rollup/plugin-node-resolve": "13.
|
|
56
|
+
"@rollup/plugin-node-resolve": "13.1.2",
|
|
57
57
|
"archiver": "5.3.0",
|
|
58
|
-
"chalk": "
|
|
58
|
+
"chalk-template": "0.2.0",
|
|
59
59
|
"constants-browserify": "1.0.0",
|
|
60
60
|
"dotenv": "10.0.0",
|
|
61
|
-
"express": "4.17.
|
|
61
|
+
"express": "4.17.2",
|
|
62
62
|
"form-data": "4.0.0",
|
|
63
63
|
"fs-extra": "10.0.0",
|
|
64
64
|
"get-stream": "6.0.1",
|
|
65
|
-
"isomorphic-git": "1.10.
|
|
65
|
+
"isomorphic-git": "1.10.3",
|
|
66
66
|
"openwhisk": "3.21.5",
|
|
67
67
|
"proxyquire": "2.1.3",
|
|
68
|
-
"rollup": "2.
|
|
68
|
+
"rollup": "2.62.0",
|
|
69
69
|
"rollup-plugin-terser": "7.0.2",
|
|
70
70
|
"semver": "7.3.5",
|
|
71
71
|
"tar": "6.1.11",
|
|
72
|
-
"webpack": "5.
|
|
73
|
-
"yargs": "17.
|
|
72
|
+
"webpack": "5.65.0",
|
|
73
|
+
"yargs": "17.3.1"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@adobe/eslint-config-helix": "1.3.1",
|
|
@@ -79,15 +79,15 @@
|
|
|
79
79
|
"@adobe/helix-universal-logger": "2.0.0",
|
|
80
80
|
"@semantic-release/changelog": "6.0.1",
|
|
81
81
|
"@semantic-release/git": "10.0.1",
|
|
82
|
-
"c8": "7.
|
|
82
|
+
"c8": "7.11.0",
|
|
83
83
|
"chai": "4.3.4",
|
|
84
84
|
"chai-http": "4.3.0",
|
|
85
85
|
"codecov": "3.8.3",
|
|
86
|
-
"eslint": "8.
|
|
86
|
+
"eslint": "8.6.0",
|
|
87
87
|
"eslint-plugin-header": "3.1.1",
|
|
88
|
-
"eslint-plugin-import": "2.25.
|
|
88
|
+
"eslint-plugin-import": "2.25.4",
|
|
89
89
|
"husky": "7.0.4",
|
|
90
|
-
"lint-staged": "12.1.
|
|
90
|
+
"lint-staged": "12.1.5",
|
|
91
91
|
"mocha": "9.1.3",
|
|
92
92
|
"mocha-junit-reporter": "2.0.2",
|
|
93
93
|
"mocha-multi-reporters": "1.5.1",
|
package/src/ActionBuilder.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import path from 'path';
|
|
15
15
|
import fs from 'fs';
|
|
16
16
|
import fse from 'fs-extra';
|
|
17
|
-
import chalk from 'chalk';
|
|
17
|
+
import chalk from 'chalk-template';
|
|
18
18
|
import git from 'isomorphic-git';
|
|
19
19
|
import WebpackBundler from './bundler/WebpackBundler.js';
|
|
20
20
|
import EdgeBundler from './bundler/EdgeBundler.js';
|
|
@@ -310,7 +310,7 @@ export default class ActionBuilder {
|
|
|
310
310
|
// eslint-disable-next-line no-await-in-loop
|
|
311
311
|
await dep[fnName](...args);
|
|
312
312
|
} catch (e) {
|
|
313
|
-
cfg.log.error(
|
|
313
|
+
cfg.log.error(chalk`{red error:} ${dep.name} - ${e.message}`);
|
|
314
314
|
errors.push(e);
|
|
315
315
|
}
|
|
316
316
|
}
|
|
@@ -338,7 +338,7 @@ export default class ActionBuilder {
|
|
|
338
338
|
async updateLinks() {
|
|
339
339
|
const { cfg } = this;
|
|
340
340
|
if (cfg.baseName === cfg.name) {
|
|
341
|
-
cfg.log.warn(
|
|
341
|
+
cfg.log.warn(chalk`{yellow warn:} unable to create version links. unsupported action name format. should be: "name@version"`);
|
|
342
342
|
return false;
|
|
343
343
|
}
|
|
344
344
|
return this.execute('updateLinks', 'updating links on ');
|
package/src/BaseConfig.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import path from 'path';
|
|
13
13
|
import { fileURLToPath } from 'url';
|
|
14
14
|
import fse from 'fs-extra';
|
|
15
|
-
import chalk from 'chalk';
|
|
15
|
+
import chalk from 'chalk-template';
|
|
16
16
|
import archiver from 'archiver';
|
|
17
17
|
import semver from 'semver';
|
|
18
18
|
import { validateBundle } from '../utils.js';
|
|
@@ -65,7 +65,7 @@ export default class BaseBundler {
|
|
|
65
65
|
cfg.log.error(chalk`{red error:}`, result.error);
|
|
66
66
|
throw Error(`Validation failed: ${result.error}`);
|
|
67
67
|
}
|
|
68
|
-
cfg.log.info(chalk`{green ok:} bundle can be loaded and has a {
|
|
68
|
+
cfg.log.info(chalk`{green ok:} bundle can be loaded and has a {grey main()} function.`);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
async createArchive() {
|
|
@@ -14,7 +14,7 @@ import path from 'path';
|
|
|
14
14
|
import fse from 'fs-extra';
|
|
15
15
|
import { fileURLToPath } from 'url';
|
|
16
16
|
import { rollup } from 'rollup';
|
|
17
|
-
import chalk from 'chalk';
|
|
17
|
+
import chalk from 'chalk-template';
|
|
18
18
|
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
|
19
19
|
import commonjs from '@rollup/plugin-commonjs';
|
|
20
20
|
import alias from '@rollup/plugin-alias';
|
|
@@ -13,7 +13,7 @@ import { fileURLToPath } from 'url';
|
|
|
13
13
|
import path from 'path';
|
|
14
14
|
import fse from 'fs-extra';
|
|
15
15
|
import webpack from 'webpack';
|
|
16
|
-
import chalk from 'chalk';
|
|
16
|
+
import chalk from 'chalk-template';
|
|
17
17
|
import BaseBundler from './BaseBundler.js';
|
|
18
18
|
|
|
19
19
|
// eslint-disable-next-line no-underscore-dangle
|
package/src/cli.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
/* eslint-disable no-console */
|
|
14
14
|
import yargs from 'yargs';
|
|
15
|
-
import chalk from 'chalk';
|
|
15
|
+
import chalk from 'chalk-template';
|
|
16
16
|
import { config as envConfig } from 'dotenv';
|
|
17
17
|
import BaseConfig from './BaseConfig.js';
|
|
18
18
|
import OpenWhiskDeployer from './deploy/OpenWhiskDeployer.js';
|
|
@@ -71,7 +71,7 @@ export default class CLI {
|
|
|
71
71
|
console.log(JSON.stringify(res, null, 2));
|
|
72
72
|
}
|
|
73
73
|
} catch (err) {
|
|
74
|
-
console.log(
|
|
74
|
+
console.log(chalk`{red error:} ${err.message}`);
|
|
75
75
|
process.exitCode = 1;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
/* eslint-disable no-await-in-loop,no-restricted-syntax */
|
|
13
|
-
import chalk from 'chalk';
|
|
13
|
+
import chalk from 'chalk-template';
|
|
14
14
|
import {
|
|
15
15
|
CreateBucketCommand, DeleteBucketCommand, DeleteObjectCommand, DeleteObjectsCommand,
|
|
16
16
|
ListBucketsCommand,
|
|
@@ -215,26 +215,41 @@ export default class AWSDeployer extends BaseDeployer {
|
|
|
215
215
|
|
|
216
216
|
this.log.info(`--: using lambda role "${this._cfg.role}"`);
|
|
217
217
|
|
|
218
|
+
// check if function already exists
|
|
219
|
+
let baseARN;
|
|
218
220
|
try {
|
|
219
|
-
this.log.info(`--:
|
|
220
|
-
await this._lambda.send(new GetFunctionCommand({
|
|
221
|
+
this.log.info(chalk`--: checking existing Lambda function {yellow ${functionName}}`);
|
|
222
|
+
const { Configuration: { FunctionArn } } = await this._lambda.send(new GetFunctionCommand({
|
|
221
223
|
FunctionName: functionName,
|
|
222
224
|
}));
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
FunctionName: functionName,
|
|
226
|
-
...functionConfig.Code,
|
|
227
|
-
}));
|
|
225
|
+
baseARN = FunctionArn;
|
|
226
|
+
this.log.info(chalk`{green ok}: exist {yellow ${FunctionArn}}`);
|
|
228
227
|
} catch (e) {
|
|
229
228
|
if (e.name === 'ResourceNotFoundException') {
|
|
230
|
-
this.log.info(
|
|
229
|
+
this.log.info(chalk`{green ok}: does not exist yet.`);
|
|
230
|
+
this.log.info(chalk`--: creating new Lambda function {yellow ${functionName}}`);
|
|
231
231
|
await this._lambda.send(new CreateFunctionCommand(functionConfig));
|
|
232
232
|
} else {
|
|
233
|
-
this.log.error(`Unable to verify existence of Lambda function ${functionName}`);
|
|
233
|
+
this.log.error(chalk`Unable to verify existence of Lambda function {yellow ${functionName}}`);
|
|
234
234
|
throw e;
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
+
// update existing function
|
|
239
|
+
if (baseARN) {
|
|
240
|
+
await this.checkFunctionReady(baseARN);
|
|
241
|
+
this.log.info(chalk`--: updating existing Lambda function configuration {yellow ${functionName}}`);
|
|
242
|
+
await this._lambda.send(new UpdateFunctionConfigurationCommand(functionConfig));
|
|
243
|
+
await this.checkFunctionReady(baseARN);
|
|
244
|
+
this.log.info('--: updating Lambda function code...');
|
|
245
|
+
await this._lambda.send(new UpdateFunctionCodeCommand({
|
|
246
|
+
FunctionName: functionName,
|
|
247
|
+
...functionConfig.Code,
|
|
248
|
+
}));
|
|
249
|
+
}
|
|
250
|
+
await this.checkFunctionReady(baseARN);
|
|
251
|
+
|
|
252
|
+
this.log.info('--: publishing new version');
|
|
238
253
|
const versiondata = await this._lambda.send(new PublishVersionCommand({
|
|
239
254
|
FunctionName: functionName,
|
|
240
255
|
}));
|
|
@@ -242,22 +257,23 @@ export default class AWSDeployer extends BaseDeployer {
|
|
|
242
257
|
this._functionARN = versiondata.FunctionArn;
|
|
243
258
|
// eslint-disable-next-line prefer-destructuring
|
|
244
259
|
this._accountId = this._functionARN.split(':')[4];
|
|
245
|
-
|
|
246
260
|
const versionNum = versiondata.Version;
|
|
261
|
+
this.log.info(chalk`{green ok}: version {yellow ${versionNum}} published.`);
|
|
262
|
+
|
|
247
263
|
try {
|
|
248
264
|
await this._lambda.send(new GetAliasCommand({
|
|
249
265
|
FunctionName: functionName,
|
|
250
266
|
Name: functionVersion,
|
|
251
267
|
}));
|
|
252
268
|
|
|
253
|
-
this.log.info(`--: updating existing alias ${functionName}:${functionVersion} to
|
|
269
|
+
this.log.info(chalk`--: updating existing alias {yellow ${functionName}:${functionVersion}} to version {yellow ${versionNum}}`);
|
|
254
270
|
const updatedata = await this._lambda.send(new UpdateAliasCommand({
|
|
255
271
|
FunctionName: functionName,
|
|
256
272
|
Name: functionVersion,
|
|
257
273
|
FunctionVersion: versionNum,
|
|
258
274
|
}));
|
|
259
|
-
|
|
260
275
|
this._aliasARN = updatedata.AliasArn;
|
|
276
|
+
this.log.info(chalk`{green ok}: alias {yellow ${this._aliasARN}} updated.`);
|
|
261
277
|
} catch (e) {
|
|
262
278
|
if (e.name === 'ResourceNotFoundException') {
|
|
263
279
|
this.log.info(`--: creating new alias ${functionName}:${functionVersion} at v${versionNum}`);
|
|
@@ -267,6 +283,7 @@ export default class AWSDeployer extends BaseDeployer {
|
|
|
267
283
|
FunctionVersion: versionNum,
|
|
268
284
|
}));
|
|
269
285
|
this._aliasARN = createdata.AliasArn;
|
|
286
|
+
this.log.info(chalk`{green ok}: alias {yellow ${this._aliasARN}} created.`);
|
|
270
287
|
} else {
|
|
271
288
|
this.log.error(`Unable to verify existence of Lambda alias ${functionName}:${functionVersion}`);
|
|
272
289
|
throw e;
|
|
@@ -409,7 +426,7 @@ export default class AWSDeployer extends BaseDeployer {
|
|
|
409
426
|
// ignore, most likely the permission already exists
|
|
410
427
|
}
|
|
411
428
|
|
|
412
|
-
this.log.info(chalk`{green ok:} function deployed: ${
|
|
429
|
+
this.log.info(chalk`{green ok:} function deployed: {blueBright ${this._functionURL}}`);
|
|
413
430
|
}
|
|
414
431
|
|
|
415
432
|
async test() {
|
|
@@ -517,7 +534,7 @@ export default class AWSDeployer extends BaseDeployer {
|
|
|
517
534
|
});
|
|
518
535
|
const unused = [];
|
|
519
536
|
if (filter) {
|
|
520
|
-
this.log.info(chalk`Integrations / Routes for {
|
|
537
|
+
this.log.info(chalk`Integrations / Routes for {grey ${filter}}`);
|
|
521
538
|
} else {
|
|
522
539
|
this.log.info('Integrations / Routes');
|
|
523
540
|
}
|
|
@@ -676,17 +693,17 @@ export default class AWSDeployer extends BaseDeployer {
|
|
|
676
693
|
}
|
|
677
694
|
}
|
|
678
695
|
|
|
679
|
-
async checkFunctionReady() {
|
|
696
|
+
async checkFunctionReady(arn) {
|
|
680
697
|
let tries = 3;
|
|
681
698
|
while (tries > 0) {
|
|
682
699
|
try {
|
|
683
700
|
tries -= 1;
|
|
684
701
|
this.log.info(chalk`--: checking function state ...`);
|
|
685
702
|
const { Configuration } = await this._lambda.send(new GetFunctionCommand({
|
|
686
|
-
FunctionName: this._functionARN,
|
|
703
|
+
FunctionName: arn ?? this._functionARN,
|
|
687
704
|
}));
|
|
688
|
-
if (Configuration.State !== 'Active') {
|
|
689
|
-
this.log.
|
|
705
|
+
if (Configuration.State !== 'Active' || Configuration.LastUpdateStatus === 'InProgress') {
|
|
706
|
+
this.log.info(chalk`{yellow !!:} function is {blue ${Configuration.State}} and last update was {blue ${Configuration.LastUpdateStatus}} (retry...)`);
|
|
690
707
|
} else {
|
|
691
708
|
this.log.info(chalk`{green ok:} function is {blue ${Configuration.State}} and last update was {blue ${Configuration.LastUpdateStatus}}.`);
|
|
692
709
|
return;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
import path from 'path';
|
|
13
|
-
import chalk from 'chalk';
|
|
13
|
+
import chalk from 'chalk-template';
|
|
14
14
|
import semver from 'semver';
|
|
15
15
|
import { h1, context } from '@adobe/helix-fetch';
|
|
16
16
|
|
|
@@ -99,7 +99,7 @@ export default class BaseDeployer {
|
|
|
99
99
|
while (retry404 >= 0) {
|
|
100
100
|
// eslint-disable-next-line no-param-reassign
|
|
101
101
|
const testUrl = `${url}${this.cfg.testPath || ''}`;
|
|
102
|
-
this.log.info(`--: requesting: ${
|
|
102
|
+
this.log.info(chalk`--: requesting: {blueBright ${testUrl}} ...`);
|
|
103
103
|
// eslint-disable-next-line no-await-in-loop
|
|
104
104
|
const ret = await this.fetch(testUrl, {
|
|
105
105
|
headers,
|
|
@@ -110,21 +110,21 @@ export default class BaseDeployer {
|
|
|
110
110
|
const body = await ret.text();
|
|
111
111
|
const id = idHeader ? ret.headers.get(idHeader) : 'n/a';
|
|
112
112
|
if (ret.ok) {
|
|
113
|
-
this.log.info(`id: ${
|
|
114
|
-
this.log.info(
|
|
115
|
-
this.log.debug(chalk
|
|
113
|
+
this.log.info(chalk`id: {grey ${id}}`);
|
|
114
|
+
this.log.info(chalk`{green ok:} ${ret.status}`);
|
|
115
|
+
this.log.debug(chalk`{grey ${JSON.stringify(ret.headers.plain(), null, 2)}}`);
|
|
116
116
|
this.log.debug('');
|
|
117
|
-
this.log.debug(chalk
|
|
117
|
+
this.log.debug(chalk`{grey ${body}}`);
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
120
|
if (ret.status === 302 || ret.status === 301) {
|
|
121
|
-
this.log.info(
|
|
122
|
-
this.log.debug(chalk
|
|
121
|
+
this.log.info(chalk`{green ok:} ${ret.status}`);
|
|
122
|
+
this.log.debug(chalk`{grey Location: ${ret.headers.get('location')}}`);
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
|
-
this.log.info(`id: ${
|
|
125
|
+
this.log.info(chalk`id: {grey ${id}}`);
|
|
126
126
|
if ((ret.status === 404 || ret.status === 500) && retry404) {
|
|
127
|
-
this.log.info(
|
|
127
|
+
this.log.info(chalk`{yellow warn:} ${ret.status} (retry)`);
|
|
128
128
|
// eslint-disable-next-line no-param-reassign
|
|
129
129
|
retry404 -= 1;
|
|
130
130
|
// eslint-disable-next-line no-await-in-loop
|
|
@@ -132,7 +132,7 @@ export default class BaseDeployer {
|
|
|
132
132
|
setTimeout(resolve, 1500);
|
|
133
133
|
});
|
|
134
134
|
} else {
|
|
135
|
-
// this.log.info(
|
|
135
|
+
// this.log.info(chalk`{red error:} test failed: ${ret.status} ${body}`);
|
|
136
136
|
throw new Error(`test failed: ${ret.status} ${body}`);
|
|
137
137
|
}
|
|
138
138
|
}
|
|
@@ -164,7 +164,7 @@ export default class BaseDeployer {
|
|
|
164
164
|
if (link === 'major' || link === 'minor') {
|
|
165
165
|
if (!s) {
|
|
166
166
|
// eslint-disable-next-line no-underscore-dangle
|
|
167
|
-
this.log.warn(
|
|
167
|
+
this.log.warn(chalk`{yellow warn:} unable to create version sequences. error while parsing version: ${this.cfg.version}`);
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
170
|
if (link === 'major') {
|
|
@@ -14,7 +14,7 @@ import { SecretManagerServiceClient } from '@google-cloud/secret-manager';
|
|
|
14
14
|
import path from 'path';
|
|
15
15
|
import fs from 'fs';
|
|
16
16
|
import semver from 'semver';
|
|
17
|
-
import chalk from 'chalk';
|
|
17
|
+
import chalk from 'chalk-template';
|
|
18
18
|
import BaseDeployer from './BaseDeployer.js';
|
|
19
19
|
import GoogleConfig from './GoogleConfig.js';
|
|
20
20
|
import { filterActions } from '../utils.js';
|
|
@@ -14,7 +14,7 @@ import ow from 'openwhisk';
|
|
|
14
14
|
import os from 'os';
|
|
15
15
|
import fse from 'fs-extra';
|
|
16
16
|
import path from 'path';
|
|
17
|
-
import chalk from 'chalk';
|
|
17
|
+
import chalk from 'chalk-template';
|
|
18
18
|
import dotenv from 'dotenv';
|
|
19
19
|
import BaseDeployer from './BaseDeployer.js';
|
|
20
20
|
import OpenWhiskConfig from './OpenWhiskConfig.js';
|
|
@@ -86,7 +86,7 @@ export default class OpenWhiskDeployer extends BaseDeployer {
|
|
|
86
86
|
|
|
87
87
|
getOpenwhiskClient() {
|
|
88
88
|
if (!this._cfg.apiHost || !this._cfg.auth || !this._cfg.namespace) {
|
|
89
|
-
throw Error(chalk`\nMissing OpenWhisk credentials. Make sure you have a {grey .wskprops} in your home directory.\nYou can also set {grey WSK_NAMESPACE}, {
|
|
89
|
+
throw Error(chalk`\nMissing OpenWhisk credentials. Make sure you have a {grey .wskprops} in your home directory.\nYou can also set {grey WSK_NAMESPACE}, {grey WSK_AUTH} and {grey WSK_API_HOST} environment variables.`);
|
|
90
90
|
}
|
|
91
91
|
return ow({
|
|
92
92
|
apihost: this._cfg.apiHost,
|
|
@@ -115,7 +115,7 @@ export default class OpenWhiskDeployer extends BaseDeployer {
|
|
|
115
115
|
});
|
|
116
116
|
this.log.info(chalk`{green ok:} package created. ${res.namespace}/${res.name}`);
|
|
117
117
|
} else {
|
|
118
|
-
this.log.error(
|
|
118
|
+
this.log.error(chalk`{red error:} ${e.message}`);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
|
@@ -185,7 +185,7 @@ export default class OpenWhiskDeployer extends BaseDeployer {
|
|
|
185
185
|
fn = openwhisk.packages.create.bind(openwhisk.packages);
|
|
186
186
|
verb = 'created';
|
|
187
187
|
} else {
|
|
188
|
-
this.log.error(
|
|
188
|
+
this.log.error(chalk`{red error:} ${e.message}`);
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
|
|
@@ -201,9 +201,9 @@ export default class OpenWhiskDeployer extends BaseDeployer {
|
|
|
201
201
|
parameters,
|
|
202
202
|
},
|
|
203
203
|
});
|
|
204
|
-
this.log.info(
|
|
204
|
+
this.log.info(chalk`{green ok:} ${verb} package {whiteBright /${result.namespace}/${result.name}}`);
|
|
205
205
|
} catch (e) {
|
|
206
|
-
this.log.error(
|
|
206
|
+
this.log.error(chalk`{red error: failed processing package: } ${e.stack}`);
|
|
207
207
|
throw Error('abort.');
|
|
208
208
|
}
|
|
209
209
|
}
|
|
@@ -268,10 +268,10 @@ export default class OpenWhiskDeployer extends BaseDeployer {
|
|
|
268
268
|
try {
|
|
269
269
|
this.log.debug(`creating sequence: ${options.name} -> ${options.action.exec.components[0]}`);
|
|
270
270
|
const result = await openwhisk.actions.update(options);
|
|
271
|
-
this.log.info(
|
|
271
|
+
this.log.info(chalk`{green ok:} created sequence {whiteBright /${result.namespace}/${result.name}} -> {whiteBright ${fqn}}`);
|
|
272
272
|
} catch (e) {
|
|
273
273
|
hasErrors = true;
|
|
274
|
-
this.log.error(
|
|
274
|
+
this.log.error(chalk`{red error:} failed creating sequence: ${e.message}`);
|
|
275
275
|
}
|
|
276
276
|
}));
|
|
277
277
|
if (hasErrors) {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
import Fastly from '@adobe/fastly-native-promises';
|
|
13
|
-
import chalk from 'chalk';
|
|
13
|
+
import chalk from 'chalk-template';
|
|
14
14
|
import FastlyConfig from './FastlyConfig.js';
|
|
15
15
|
import BaseDeployer from '../deploy/BaseDeployer.js';
|
|
16
16
|
|