@dotcom-tool-kit/serverless 2.2.8 → 2.2.10
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/tasks/deploy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAA;AAI/E,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,IAAI,CAAC,OAAO,gBAAgB,CAAC;IACzE,MAAM,CAAC,WAAW,SAAmB;IAE/B,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/tasks/deploy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAA;AAI/E,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,IAAI,CAAC,OAAO,gBAAgB,CAAC;IACzE,MAAM,CAAC,WAAW,SAAmB;IAE/B,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA2C3B"}
|
package/lib/tasks/deploy.js
CHANGED
|
@@ -12,10 +12,17 @@ class ServerlessDeploy extends types_1.Task {
|
|
|
12
12
|
if (buildNum === undefined) {
|
|
13
13
|
throw new error_1.ToolKitError(`the ${logger_1.styles.task('ServerlessDeploy')} task requires the ${logger_1.styles.code(`$${buildNumVariable}`)} environment variable to be defined`);
|
|
14
14
|
}
|
|
15
|
-
let
|
|
15
|
+
let vaultEnv = {};
|
|
16
16
|
if (useVault) {
|
|
17
|
-
const
|
|
18
|
-
|
|
17
|
+
const dopplerCi = new doppler_1.DopplerEnvVars(this.logger, 'ci');
|
|
18
|
+
const vaultCi = await dopplerCi.fallbackToVault();
|
|
19
|
+
// HACK:20231023:IM don't read secrets when the project has already
|
|
20
|
+
// migrated from Vault to Doppler – Doppler will instead sync secrets to
|
|
21
|
+
// Parameter Store for the Serverless config to reference
|
|
22
|
+
if (!vaultCi.MIGRATED_TO_DOPPLER) {
|
|
23
|
+
const dopplerEnvVars = new doppler_1.DopplerEnvVars(this.logger, 'prod');
|
|
24
|
+
vaultEnv = await dopplerEnvVars.fallbackToVault();
|
|
25
|
+
}
|
|
19
26
|
}
|
|
20
27
|
for (const region of regions) {
|
|
21
28
|
this.logger.verbose('starting the child serverless process...');
|
|
@@ -26,7 +33,7 @@ class ServerlessDeploy extends types_1.Task {
|
|
|
26
33
|
const child = (0, child_process_1.spawn)('serverless', args, {
|
|
27
34
|
env: {
|
|
28
35
|
...process.env,
|
|
29
|
-
...
|
|
36
|
+
...vaultEnv
|
|
30
37
|
}
|
|
31
38
|
});
|
|
32
39
|
(0, logger_1.hookFork)(this.logger, 'serverless', child);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provision.d.ts","sourceRoot":"","sources":["../../src/tasks/provision.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAA;AAI/E,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,IAAI,CAAC,OAAO,gBAAgB,CAAC;IAC5E,MAAM,CAAC,WAAW,SAA4B;IAExC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"provision.d.ts","sourceRoot":"","sources":["../../src/tasks/provision.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAA;AAI/E,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,IAAI,CAAC,OAAO,gBAAgB,CAAC;IAC5E,MAAM,CAAC,WAAW,SAA4B;IAExC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAiD3B"}
|
package/lib/tasks/provision.js
CHANGED
|
@@ -12,10 +12,17 @@ class ServerlessProvision extends types_1.Task {
|
|
|
12
12
|
if (buildNum === undefined) {
|
|
13
13
|
throw new error_1.ToolKitError(`the ${logger_1.styles.task('ServerlessProvision')} task requires the ${logger_1.styles.code(`$${buildNumVariable}`)} environment variable to be defined`);
|
|
14
14
|
}
|
|
15
|
-
let
|
|
15
|
+
let vaultEnv = {};
|
|
16
16
|
if (useVault) {
|
|
17
|
-
const
|
|
18
|
-
|
|
17
|
+
const dopplerCi = new doppler_1.DopplerEnvVars(this.logger, 'ci');
|
|
18
|
+
const vaultCi = await dopplerCi.fallbackToVault();
|
|
19
|
+
// HACK:20231023:IM don't read secrets when the project has already
|
|
20
|
+
// migrated from Vault to Doppler – Doppler will instead sync secrets to
|
|
21
|
+
// Parameter Store for the Serverless config to reference
|
|
22
|
+
if (!vaultCi.MIGRATED_TO_DOPPLER) {
|
|
23
|
+
const dopplerEnvVars = new doppler_1.DopplerEnvVars(this.logger, 'dev');
|
|
24
|
+
vaultEnv = await dopplerEnvVars.fallbackToVault();
|
|
25
|
+
}
|
|
19
26
|
}
|
|
20
27
|
this.logger.verbose('starting the child serverless process...');
|
|
21
28
|
const args = [
|
|
@@ -33,7 +40,7 @@ class ServerlessProvision extends types_1.Task {
|
|
|
33
40
|
const child = (0, child_process_1.spawn)('serverless', args, {
|
|
34
41
|
env: {
|
|
35
42
|
...process.env,
|
|
36
|
-
...
|
|
43
|
+
...vaultEnv
|
|
37
44
|
}
|
|
38
45
|
});
|
|
39
46
|
(0, logger_1.hookFork)(this.logger, 'serverless', child);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotcom-tool-kit/serverless",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.10",
|
|
4
4
|
"description": "a plugin to manage and deploy apps using AWS Serverless",
|
|
5
5
|
"main": "lib",
|
|
6
6
|
"scripts": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@dotcom-tool-kit/error": "^3.1.0",
|
|
29
29
|
"@dotcom-tool-kit/state": "^3.1.1",
|
|
30
30
|
"@dotcom-tool-kit/types": "^3.4.1",
|
|
31
|
-
"@dotcom-tool-kit/doppler": "^1.0.
|
|
31
|
+
"@dotcom-tool-kit/doppler": "^1.0.7",
|
|
32
32
|
"get-port": "^5.1.1",
|
|
33
33
|
"tslib": "^2.3.1",
|
|
34
34
|
"wait-port": "^0.2.9"
|