@vendure/cloud 0.3.2 → 0.4.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/README.md +6 -1
- package/dist/cli/commands/deployment/build-logs.js +2 -9
- package/dist/cli/commands/deployment/build-logs.js.map +1 -1
- package/dist/cli/commands/deployment/deploy.d.ts.map +1 -1
- package/dist/cli/commands/deployment/deploy.js +34 -64
- package/dist/cli/commands/deployment/deploy.js.map +1 -1
- package/dist/cli/commands/deployment/index.d.ts.map +1 -1
- package/dist/cli/commands/deployment/index.js +52 -27
- package/dist/cli/commands/deployment/index.js.map +1 -1
- package/dist/cli/commands/deployment/log-export.d.ts +13 -0
- package/dist/cli/commands/deployment/log-export.d.ts.map +1 -0
- package/dist/cli/commands/deployment/log-export.js +133 -0
- package/dist/cli/commands/deployment/log-export.js.map +1 -0
- package/dist/cli/commands/deployment/log-query-output.d.ts +13 -0
- package/dist/cli/commands/deployment/log-query-output.d.ts.map +1 -0
- package/dist/cli/commands/deployment/log-query-output.js +106 -0
- package/dist/cli/commands/deployment/log-query-output.js.map +1 -0
- package/dist/cli/commands/deployment/logs.d.ts +1 -0
- package/dist/cli/commands/deployment/logs.d.ts.map +1 -1
- package/dist/cli/commands/deployment/logs.js +347 -69
- package/dist/cli/commands/deployment/logs.js.map +1 -1
- package/dist/cli/commands/deployment/options.d.ts +2 -6
- package/dist/cli/commands/deployment/options.d.ts.map +1 -1
- package/dist/cli/commands/deployment/options.js +21 -9
- package/dist/cli/commands/deployment/options.js.map +1 -1
- package/dist/cli/commands/deployment/plan.d.ts +1 -1
- package/dist/cli/commands/deployment/plan.d.ts.map +1 -1
- package/dist/cli/commands/deployment/plan.js +4 -6
- package/dist/cli/commands/deployment/plan.js.map +1 -1
- package/dist/cli/commands/deployment/recovery.d.ts +9 -0
- package/dist/cli/commands/deployment/recovery.d.ts.map +1 -0
- package/dist/cli/commands/deployment/recovery.js +86 -0
- package/dist/cli/commands/deployment/recovery.js.map +1 -0
- package/dist/cli/commands/deployment/rollback.d.ts.map +1 -1
- package/dist/cli/commands/deployment/rollback.js +8 -3
- package/dist/cli/commands/deployment/rollback.js.map +1 -1
- package/dist/cli/commands/deployment/show.d.ts.map +1 -1
- package/dist/cli/commands/deployment/show.js +16 -5
- package/dist/cli/commands/deployment/show.js.map +1 -1
- package/dist/cli/commands/deployment/source.d.ts +1 -12
- package/dist/cli/commands/deployment/source.d.ts.map +1 -1
- package/dist/cli/commands/deployment/source.js +5 -13
- package/dist/cli/commands/deployment/source.js.map +1 -1
- package/dist/cli/commands/deployment/status.d.ts.map +1 -1
- package/dist/cli/commands/deployment/status.js +22 -20
- package/dist/cli/commands/deployment/status.js.map +1 -1
- package/dist/cli/commands/deployment/teardown.d.ts.map +1 -1
- package/dist/cli/commands/deployment/teardown.js +12 -1
- package/dist/cli/commands/deployment/teardown.js.map +1 -1
- package/dist/cli/commands/identity-context/keys.d.ts.map +1 -1
- package/dist/cli/commands/identity-context/keys.js +6 -5
- package/dist/cli/commands/identity-context/keys.js.map +1 -1
- package/dist/cli/commands/identity-context/login.d.ts.map +1 -1
- package/dist/cli/commands/identity-context/login.js +2 -2
- package/dist/cli/commands/identity-context/login.js.map +1 -1
- package/dist/cli/commands/identity-context/logout.d.ts.map +1 -1
- package/dist/cli/commands/identity-context/logout.js +3 -4
- package/dist/cli/commands/identity-context/logout.js.map +1 -1
- package/dist/cli/commands/identity-context/org-switch.d.ts.map +1 -1
- package/dist/cli/commands/identity-context/org-switch.js +19 -7
- package/dist/cli/commands/identity-context/org-switch.js.map +1 -1
- package/dist/cli/commands/identity-context/use.d.ts.map +1 -1
- package/dist/cli/commands/identity-context/use.js +2 -3
- package/dist/cli/commands/identity-context/use.js.map +1 -1
- package/dist/cli/commands/identity-context/whoami.d.ts.map +1 -1
- package/dist/cli/commands/identity-context/whoami.js +33 -12
- package/dist/cli/commands/identity-context/whoami.js.map +1 -1
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +0 -1
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/project-config/config/desired-state.d.ts +1 -1
- package/dist/cli/commands/project-config/config/desired-state.d.ts.map +1 -1
- package/dist/cli/commands/project-config/config/desired-state.js +4 -3
- package/dist/cli/commands/project-config/config/desired-state.js.map +1 -1
- package/dist/cli/commands/project-config/config/email/domain.d.ts +5 -0
- package/dist/cli/commands/project-config/config/email/domain.d.ts.map +1 -0
- package/dist/cli/commands/project-config/config/email/domain.js +80 -0
- package/dist/cli/commands/project-config/config/email/domain.js.map +1 -0
- package/dist/cli/commands/project-config/config/email/events.d.ts +4 -0
- package/dist/cli/commands/project-config/config/email/events.d.ts.map +1 -0
- package/dist/cli/commands/project-config/config/email/events.js +55 -0
- package/dist/cli/commands/project-config/config/email/events.js.map +1 -0
- package/dist/cli/commands/project-config/config/email/index.d.ts +2 -0
- package/dist/cli/commands/project-config/config/email/index.d.ts.map +1 -0
- package/dist/cli/commands/project-config/config/email/index.js +108 -0
- package/dist/cli/commands/project-config/config/email/index.js.map +1 -0
- package/dist/cli/commands/project-config/config/email/test-sending.d.ts +4 -0
- package/dist/cli/commands/project-config/config/email/test-sending.d.ts.map +1 -0
- package/dist/cli/commands/project-config/config/email/test-sending.js +68 -0
- package/dist/cli/commands/project-config/config/email/test-sending.js.map +1 -0
- package/dist/cli/commands/project-config/config/index.d.ts.map +1 -1
- package/dist/cli/commands/project-config/config/index.js +12 -7
- package/dist/cli/commands/project-config/config/index.js.map +1 -1
- package/dist/cli/commands/project-config/config/runtime.d.ts +2 -1
- package/dist/cli/commands/project-config/config/runtime.d.ts.map +1 -1
- package/dist/cli/commands/project-config/config/runtime.js +43 -29
- package/dist/cli/commands/project-config/config/runtime.js.map +1 -1
- package/dist/cli/commands/project-config/env/index.d.ts.map +1 -1
- package/dist/cli/commands/project-config/env/index.js +8 -2
- package/dist/cli/commands/project-config/env/index.js.map +1 -1
- package/dist/cli/commands/project-config/environment/index.d.ts.map +1 -1
- package/dist/cli/commands/project-config/environment/index.js +15 -1
- package/dist/cli/commands/project-config/environment/index.js.map +1 -1
- package/dist/cli/commands/project-config/environment/regions.d.ts +6 -0
- package/dist/cli/commands/project-config/environment/regions.d.ts.map +1 -0
- package/dist/cli/commands/project-config/environment/regions.js +22 -0
- package/dist/cli/commands/project-config/environment/regions.js.map +1 -0
- package/dist/cli/commands/project-config/init/init.d.ts.map +1 -1
- package/dist/cli/commands/project-config/init/init.js +28 -5
- package/dist/cli/commands/project-config/init/init.js.map +1 -1
- package/dist/cli/commands/project-config/project/list.d.ts.map +1 -1
- package/dist/cli/commands/project-config/project/list.js +8 -1
- package/dist/cli/commands/project-config/project/list.js.map +1 -1
- package/dist/cli/commands/project-config/project/show.d.ts.map +1 -1
- package/dist/cli/commands/project-config/project/show.js +12 -0
- package/dist/cli/commands/project-config/project/show.js.map +1 -1
- package/dist/cli/commands/project-config/project/subscription-state.d.ts +5 -0
- package/dist/cli/commands/project-config/project/subscription-state.d.ts.map +1 -0
- package/dist/cli/commands/project-config/project/subscription-state.js +57 -0
- package/dist/cli/commands/project-config/project/subscription-state.js.map +1 -0
- package/dist/cli/commands/project-config/source/connect.d.ts.map +1 -1
- package/dist/cli/commands/project-config/source/connect.js +5 -5
- package/dist/cli/commands/project-config/source/connect.js.map +1 -1
- package/dist/cli/commands/project-config/source/map.d.ts.map +1 -1
- package/dist/cli/commands/project-config/source/map.js +4 -4
- package/dist/cli/commands/project-config/source/map.js.map +1 -1
- package/dist/cli/commands/project-config/source/status.d.ts.map +1 -1
- package/dist/cli/commands/project-config/source/status.js +71 -17
- package/dist/cli/commands/project-config/source/status.js.map +1 -1
- package/dist/cli/commands/runtime-data/backup.d.ts +1 -0
- package/dist/cli/commands/runtime-data/backup.d.ts.map +1 -1
- package/dist/cli/commands/runtime-data/backup.js +36 -0
- package/dist/cli/commands/runtime-data/backup.js.map +1 -1
- package/dist/cli/commands/runtime-data/index.d.ts +1 -0
- package/dist/cli/commands/runtime-data/index.d.ts.map +1 -1
- package/dist/cli/commands/runtime-data/index.js +26 -4
- package/dist/cli/commands/runtime-data/index.js.map +1 -1
- package/dist/cli/commands/runtime-data/restore.d.ts.map +1 -1
- package/dist/cli/commands/runtime-data/restore.js +33 -5
- package/dist/cli/commands/runtime-data/restore.js.map +1 -1
- package/dist/cli/index.d.ts +13 -3
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +12 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/lib/auth.d.ts +21 -2
- package/dist/cli/lib/auth.d.ts.map +1 -1
- package/dist/cli/lib/auth.js +22 -2
- package/dist/cli/lib/auth.js.map +1 -1
- package/dist/cli/lib/commit.d.ts +4 -0
- package/dist/cli/lib/commit.d.ts.map +1 -0
- package/dist/cli/lib/commit.js +22 -0
- package/dist/cli/lib/commit.js.map +1 -0
- package/dist/cli/lib/console-credential.d.ts +55 -0
- package/dist/cli/lib/console-credential.d.ts.map +1 -0
- package/dist/cli/lib/console-credential.js +164 -0
- package/dist/cli/lib/console-credential.js.map +1 -0
- package/dist/cli/lib/console-origins.d.ts +30 -0
- package/dist/cli/lib/console-origins.d.ts.map +1 -0
- package/dist/cli/lib/console-origins.js +87 -0
- package/dist/cli/lib/console-origins.js.map +1 -0
- package/dist/cli/lib/console-pairing.d.ts +15 -0
- package/dist/cli/lib/console-pairing.d.ts.map +1 -0
- package/dist/cli/lib/console-pairing.js +70 -0
- package/dist/cli/lib/console-pairing.js.map +1 -0
- package/dist/cli/lib/console-session-lock.d.ts +39 -0
- package/dist/cli/lib/console-session-lock.d.ts.map +1 -0
- package/dist/cli/lib/console-session-lock.js +235 -0
- package/dist/cli/lib/console-session-lock.js.map +1 -0
- package/dist/cli/lib/console-session.d.ts +47 -0
- package/dist/cli/lib/console-session.d.ts.map +1 -0
- package/dist/cli/lib/console-session.js +235 -0
- package/dist/cli/lib/console-session.js.map +1 -0
- package/dist/cli/lib/contract/backup-schedule-reasons.d.ts +4 -0
- package/dist/cli/lib/contract/backup-schedule-reasons.d.ts.map +1 -0
- package/dist/cli/lib/contract/backup-schedule-reasons.js +17 -0
- package/dist/cli/lib/contract/backup-schedule-reasons.js.map +1 -0
- package/dist/cli/lib/contract/build-settings.d.ts +1 -1
- package/dist/cli/lib/contract/database.d.ts +19 -0
- package/dist/cli/lib/contract/database.d.ts.map +1 -1
- package/dist/cli/lib/contract/database.js.map +1 -1
- package/dist/cli/lib/contract/deployments.d.ts +13 -0
- package/dist/cli/lib/contract/deployments.d.ts.map +1 -1
- package/dist/cli/lib/contract/deployments.js +38 -0
- package/dist/cli/lib/contract/deployments.js.map +1 -1
- package/dist/cli/lib/contract/desired-state.d.ts +3 -5
- package/dist/cli/lib/contract/desired-state.d.ts.map +1 -1
- package/dist/cli/lib/contract/desired-state.js +42 -28
- package/dist/cli/lib/contract/desired-state.js.map +1 -1
- package/dist/cli/lib/contract/foreign-credentials.d.ts +6 -4
- package/dist/cli/lib/contract/foreign-credentials.d.ts.map +1 -1
- package/dist/cli/lib/contract/foreign-credentials.js +7 -5
- package/dist/cli/lib/contract/foreign-credentials.js.map +1 -1
- package/dist/cli/lib/contract/logs.d.ts +120 -0
- package/dist/cli/lib/contract/logs.d.ts.map +1 -1
- package/dist/cli/lib/contract/logs.js +106 -1
- package/dist/cli/lib/contract/logs.js.map +1 -1
- package/dist/cli/lib/contract/managed-email.d.ts +57 -0
- package/dist/cli/lib/contract/managed-email.d.ts.map +1 -0
- package/dist/cli/lib/contract/managed-email.js +21 -0
- package/dist/cli/lib/contract/managed-email.js.map +1 -0
- package/dist/cli/lib/contract/projects.d.ts +6 -0
- package/dist/cli/lib/contract/projects.d.ts.map +1 -1
- package/dist/cli/lib/contract/regions.d.ts +11 -0
- package/dist/cli/lib/contract/regions.d.ts.map +1 -0
- package/dist/cli/lib/contract/regions.js +7 -0
- package/dist/cli/lib/contract/regions.js.map +1 -0
- package/dist/cli/lib/contract/runtime-operations.d.ts +0 -1
- package/dist/cli/lib/contract/runtime-operations.d.ts.map +1 -1
- package/dist/cli/lib/contract/source-disconnect-reasons.d.ts +4 -0
- package/dist/cli/lib/contract/source-disconnect-reasons.d.ts.map +1 -0
- package/dist/cli/lib/contract/source-disconnect-reasons.js +31 -0
- package/dist/cli/lib/contract/source-disconnect-reasons.js.map +1 -0
- package/dist/cli/lib/contract/source-repository.d.ts +1 -1
- package/dist/cli/lib/contract/source-repository.d.ts.map +1 -1
- package/dist/cli/lib/contract/source-repository.js +1 -0
- package/dist/cli/lib/contract/source-repository.js.map +1 -1
- package/dist/cli/lib/errors.d.ts +30 -0
- package/dist/cli/lib/errors.d.ts.map +1 -1
- package/dist/cli/lib/errors.js +46 -0
- package/dist/cli/lib/errors.js.map +1 -1
- package/dist/cli/lib/platform-address.d.ts +3 -0
- package/dist/cli/lib/platform-address.d.ts.map +1 -0
- package/dist/cli/lib/platform-address.js +7 -0
- package/dist/cli/lib/platform-address.js.map +1 -0
- package/dist/cli/lib/resolve.d.ts +1 -0
- package/dist/cli/lib/resolve.d.ts.map +1 -1
- package/dist/cli/lib/resolve.js +26 -3
- package/dist/cli/lib/resolve.js.map +1 -1
- package/dist/cli/lib/terminal-output.d.ts +8 -0
- package/dist/cli/lib/terminal-output.d.ts.map +1 -0
- package/dist/cli/lib/terminal-output.js +52 -0
- package/dist/cli/lib/terminal-output.js.map +1 -0
- package/dist/dev/dashboard-vite-config.d.ts +1 -0
- package/dist/dev/dashboard-vite-config.d.ts.map +1 -1
- package/dist/dev/dashboard-vite-config.js +26 -3
- package/dist/dev/dashboard-vite-config.js.map +1 -1
- package/dist/dev/dev-command.d.ts.map +1 -1
- package/dist/dev/dev-command.js +21 -1
- package/dist/dev/dev-command.js.map +1 -1
- package/dist/dev/dev-migrate.js +2 -0
- package/dist/dev/dev-migrate.js.map +1 -1
- package/dist/dev/dev-server.js +3 -0
- package/dist/dev/dev-server.js.map +1 -1
- package/dist/dev/dev-worker.js +2 -1
- package/dist/dev/dev-worker.js.map +1 -1
- package/dist/local-core.d.ts +2 -0
- package/dist/local-core.d.ts.map +1 -0
- package/dist/local-core.js +15 -0
- package/dist/local-core.js.map +1 -0
- package/dist/local-durable-execution-plugin.d.ts +3 -0
- package/dist/local-durable-execution-plugin.d.ts.map +1 -0
- package/dist/local-durable-execution-plugin.js +33 -0
- package/dist/local-durable-execution-plugin.js.map +1 -0
- package/dist/local-runtime.d.ts.map +1 -1
- package/dist/local-runtime.js +7 -0
- package/dist/local-runtime.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
export interface DeploymentImageOptions {
|
|
2
|
-
serverImage?: string;
|
|
3
|
-
workerImage?: string;
|
|
4
|
-
migrationImage?: string;
|
|
5
|
-
}
|
|
6
1
|
export declare function readStringOption(value: unknown, flag: string): string | undefined;
|
|
7
2
|
export declare function readBooleanOption(value: unknown): boolean;
|
|
8
3
|
export declare function readNegatableOption(value: unknown): boolean;
|
|
9
4
|
export declare function readIntegerOption(value: unknown, flag: string): number;
|
|
10
|
-
export declare function
|
|
5
|
+
export declare function readLineCount(value: unknown, flag: string, max: number): number;
|
|
6
|
+
export declare const MAX_REPLAY_LINES = 1000;
|
|
11
7
|
//# sourceMappingURL=options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/options.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/options.ts"],"names":[],"mappings":"AASA,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEjF;AAMD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEzD;AAGD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE3D;AAOD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMtE;AAOD,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAM/E;AAID,eAAO,MAAM,gBAAgB,OAAQ,CAAC"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { readSingleValue } from "../../arguments.js";
|
|
2
|
+
// Readers for this family's own command options.
|
|
3
|
+
//
|
|
4
|
+
// The host hands a command its options as `Record<string, unknown>`, which is what Commander
|
|
5
|
+
// produced and nothing has narrowed. Each reader turns one entry into the type the call site needs
|
|
6
|
+
// and refuses a shape the command did not declare, so a declaration and its reader cannot drift
|
|
7
|
+
// apart into a value that reads as valid.
|
|
2
8
|
export function readStringOption(value, flag) {
|
|
3
9
|
return readSingleValue(value, flag);
|
|
4
10
|
}
|
|
@@ -17,9 +23,7 @@ export function readNegatableOption(value) {
|
|
|
17
23
|
// Commander does not coerce, so the value is the customer's text or the declared default.
|
|
18
24
|
//
|
|
19
25
|
// The parse is not range-checked, which is `vcloud`'s behaviour: text that is not a number reaches
|
|
20
|
-
// the control plane as `limit=NaN` and is refused there.
|
|
21
|
-
// `deployment logs --lines`, because it decides how much history a stream replays; `build-logs.ts`
|
|
22
|
-
// holds that check.
|
|
26
|
+
// the control plane as `limit=NaN` and is refused there.
|
|
23
27
|
export function readIntegerOption(value, flag) {
|
|
24
28
|
const text = readStringOption(value, flag);
|
|
25
29
|
if (text === undefined) {
|
|
@@ -27,11 +31,19 @@ export function readIntegerOption(value, flag) {
|
|
|
27
31
|
}
|
|
28
32
|
return Number.parseInt(text, 10);
|
|
29
33
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
// A line count the CLI holds to a range itself, rather than passing on for the control plane to
|
|
35
|
+
// refuse. Every `--lines` decides how much this process reads or holds — replayed history, or pages
|
|
36
|
+
// walked — so an unbounded one spends a budget the customer cannot see. The ceiling is the caller's
|
|
37
|
+
// because the commands bound different things, but the parse and the refusal are shared so the two
|
|
38
|
+
// cannot answer the same mistake in two different sentences.
|
|
39
|
+
export function readLineCount(value, flag, max) {
|
|
40
|
+
const lines = readIntegerOption(value, flag);
|
|
41
|
+
if (!Number.isInteger(lines) || lines < 1 || lines > max) {
|
|
42
|
+
throw new Error(`${flag} must be a whole number between 1 and ${max}.`);
|
|
43
|
+
}
|
|
44
|
+
return lines;
|
|
36
45
|
}
|
|
46
|
+
// How much past output a stream replays before it starts following. Shared by the two commands that
|
|
47
|
+
// tail one, so a customer meets one limit rather than a different one per command.
|
|
48
|
+
export const MAX_REPLAY_LINES = 1_000;
|
|
37
49
|
//# sourceMappingURL=options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,iDAAiD;AACjD,EAAE;AACF,6FAA6F;AAC7F,mGAAmG;AACnG,gGAAgG;AAChG,0CAA0C;AAE1C,MAAM,UAAU,gBAAgB,CAAC,KAAc,EAAE,IAAY;IAC3D,OAAO,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACtC,CAAC;AAED,iGAAiG;AACjG,+FAA+F;AAC/F,mGAAmG;AACnG,gCAAgC;AAChC,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,OAAO,KAAK,KAAK,IAAI,CAAC;AACxB,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,OAAO,KAAK,KAAK,KAAK,CAAC;AACzB,CAAC;AAED,6FAA6F;AAC7F,0FAA0F;AAC1F,EAAE;AACF,mGAAmG;AACnG,yDAAyD;AACzD,MAAM,UAAU,iBAAiB,CAAC,KAAc,EAAE,IAAY;IAC5D,MAAM,IAAI,GAAG,gBAAgB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC3C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,oBAAoB,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC;AAED,gGAAgG;AAChG,oGAAoG;AACpG,oGAAoG;AACpG,mGAAmG;AACnG,6DAA6D;AAC7D,MAAM,UAAU,aAAa,CAAC,KAAc,EAAE,IAAY,EAAE,GAAW;IACrE,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC7C,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,GAAG,GAAG,EAAE,CAAC;QACzD,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,yCAAyC,GAAG,GAAG,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,oGAAoG;AACpG,mFAAmF;AACnF,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/plan.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,iBAAiB,EAGvB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/plan.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,iBAAiB,EAGvB,MAAM,gBAAgB,CAAC;AAkBxB,wBAAsB,UAAU,CAAC,EAAE,OAAO,EAAE,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkD9E"}
|
|
@@ -2,15 +2,14 @@ import * as prompts from "@clack/prompts";
|
|
|
2
2
|
import { createAuthenticatedClient, resolveEnvironment, } from "../../index.js";
|
|
3
3
|
import { isPlanPreviewUnavailable, } from "../../lib/contract/deployments.js";
|
|
4
4
|
import { formatEnvPreflightSkipped, formatMissingEnvVarsWarning, runEnvVarPreflight, } from "../../lib/env-preflight.js";
|
|
5
|
-
import { readImageOptions } from "./options.js";
|
|
6
5
|
import { formatActionLine, formatKeptActionLine, isKeptAction, summarizeActions, } from "./plan-format.js";
|
|
7
|
-
import {
|
|
8
|
-
export async function deployPlan({
|
|
9
|
-
const imageOpts = readImageOptions(options);
|
|
6
|
+
import { requireBranchMapping } from "./source.js";
|
|
7
|
+
export async function deployPlan({ globals }) {
|
|
10
8
|
const { environment } = await resolveEnvironment(globals);
|
|
11
9
|
const json = globals.json === true;
|
|
12
10
|
const client = createAuthenticatedClient(globals);
|
|
13
|
-
|
|
11
|
+
// A plan for an environment with no branch mapping is a plan for a deploy that could not run.
|
|
12
|
+
await requireBranchMapping(client, environment);
|
|
14
13
|
if (!json) {
|
|
15
14
|
const preflight = await runEnvVarPreflight(client, environment.id);
|
|
16
15
|
if (preflight.status === "not-checked") {
|
|
@@ -24,7 +23,6 @@ export async function deployPlan({ options, globals }) {
|
|
|
24
23
|
spinner.start("Computing infrastructure plan...");
|
|
25
24
|
const result = await client.post("/deployments/plan", {
|
|
26
25
|
environmentId: environment.id,
|
|
27
|
-
...(source.kind === "prebuilt-images" ? source.images : {}),
|
|
28
26
|
});
|
|
29
27
|
const { plan } = result;
|
|
30
28
|
spinner.stop(`Plan: ${plan.projectName} / ${plan.environmentName}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.js","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAA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hE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7E,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,MAAM,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,YAAY,CAAC,CAAC;IAClD,IAAI,MAAM,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,YAAY,CAAC,CAAC;IAClD,IAAI,GAAG,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,GAAG,YAAY,CAAC,CAAC;IAC5C,IAAI,IAAI,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,sBAAsB,CAAC,CAAC;IAExD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC;AAC7E,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ApiClient, type Deployment } from "../../index.js";
|
|
2
|
+
import type { DeploymentRecovery } from "../../lib/contract/deployments.js";
|
|
3
|
+
export interface DeploymentRecoveryResult {
|
|
4
|
+
recovery: DeploymentRecovery | null;
|
|
5
|
+
unavailableReason: string | null;
|
|
6
|
+
}
|
|
7
|
+
export declare function fetchDeploymentRecovery(client: ApiClient, deployment: Pick<Deployment, "id" | "status">): Promise<DeploymentRecoveryResult>;
|
|
8
|
+
export declare function formatDeploymentRecovery(recovery: DeploymentRecovery, deploymentId: string): string;
|
|
9
|
+
//# sourceMappingURL=recovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recovery.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/recovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,UAAU,EAAmB,MAAM,gBAAgB,CAAC;AAClF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAe5E,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACpC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAuBD,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,SAAS,EACjB,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,QAAQ,CAAC,GAC5C,OAAO,CAAC,wBAAwB,CAAC,CAkBnC;AAwCD,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,kBAAkB,EAC5B,YAAY,EAAE,MAAM,GACnB,MAAM,CAQR"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { cloudInvocation } from "../../index.js";
|
|
2
|
+
import { LOG_SERVICES } from "../../lib/contract/logs.js";
|
|
3
|
+
import { logger } from "../../lib/logger.js";
|
|
4
|
+
import { BATCH_ONLY_SERVICE } from "./logs.js";
|
|
5
|
+
const NO_RECOVERY = { recovery: null, unavailableReason: null };
|
|
6
|
+
// A deployment that ended without failing still ends, and a customer does ask about one. Neither
|
|
7
|
+
// has a stage to report, so each says why rather than falling into the two-null shape this file
|
|
8
|
+
// exists to prevent. A successful or in-flight deployment needs no sentence: its own status says
|
|
9
|
+
// what it is.
|
|
10
|
+
const NO_RECOVERY_FOR_STATUS = {
|
|
11
|
+
CANCELLED: "This deployment was cancelled rather than failing, so there is no stage to recover from.",
|
|
12
|
+
DEGRADED: "This deployment is reported as degraded rather than failed, so there is no stage to recover from. Check what your environment is running.",
|
|
13
|
+
};
|
|
14
|
+
// Asks only for a deployment that failed, which is the only kind that has an answer and the only
|
|
15
|
+
// kind whose answer can cost the control plane a read of its durable-operation history.
|
|
16
|
+
//
|
|
17
|
+
// Nothing here throws. This block is guidance added to a failure the customer has already been
|
|
18
|
+
// shown, so a control plane that cannot answer it must not replace the failure they asked about
|
|
19
|
+
// with a second one — the same call `DeploymentRecoveryService` makes when it cannot read a
|
|
20
|
+
// deployment's stages. A control plane older than the endpoint answers 404, which is what the CLI
|
|
21
|
+
// meets during a rollout of the control plane itself.
|
|
22
|
+
export async function fetchDeploymentRecovery(client, deployment) {
|
|
23
|
+
if (deployment.status !== "FAILED") {
|
|
24
|
+
const reason = NO_RECOVERY_FOR_STATUS[deployment.status];
|
|
25
|
+
return reason ? { recovery: null, unavailableReason: reason } : NO_RECOVERY;
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
const recovery = await client.get(`/deployments/${encodeURIComponent(deployment.id)}/recovery`);
|
|
29
|
+
return { recovery, unavailableReason: null };
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
33
|
+
logger.warn({ deploymentId: deployment.id, error: reason }, "Could not read the recovery");
|
|
34
|
+
return {
|
|
35
|
+
recovery: null,
|
|
36
|
+
unavailableReason: "This deployment's recovery could not be read from the control plane.",
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
// The commands that answer each action, keyed so an action added to the contract without a command
|
|
41
|
+
// here is a compile error rather than a silently blank line.
|
|
42
|
+
const ACTION_COMMANDS = {
|
|
43
|
+
DEPLOY_AGAIN: () => [`${cloudInvocation()} deploy`],
|
|
44
|
+
FIX_SOURCE_AND_DEPLOY: (deploymentId) => [
|
|
45
|
+
`${cloudInvocation()} deployment logs ${deploymentId}`,
|
|
46
|
+
`${cloudInvocation()} deploy`,
|
|
47
|
+
],
|
|
48
|
+
FIX_MIGRATION_AND_DEPLOY: () => [
|
|
49
|
+
`${cloudInvocation()} logs --service ${BATCH_ONLY_SERVICE}`,
|
|
50
|
+
`${cloudInvocation()} deploy`,
|
|
51
|
+
],
|
|
52
|
+
// `status` first, then the logs. A rollout that stopped part-way can leave either release running
|
|
53
|
+
// and nothing here names which: `status` reports service health and the latest deployment, which
|
|
54
|
+
// at this point is the failed one. The logs are what identify the running release, so they follow
|
|
55
|
+
// it and precede the rollback rather than the other way round.
|
|
56
|
+
ROLLBACK: () => [
|
|
57
|
+
`${cloudInvocation()} status`,
|
|
58
|
+
...LOG_SERVICES.map((service) => `${cloudInvocation()} logs --service ${service}`),
|
|
59
|
+
`${cloudInvocation()} deployment list`,
|
|
60
|
+
`${cloudInvocation()} rollback <deployment-id>`,
|
|
61
|
+
],
|
|
62
|
+
// No command. The block is printed by the one that would be listed here, and what support needs
|
|
63
|
+
// is the deployment's ID, which `formatDeploymentRecovery` prints instead.
|
|
64
|
+
CONTACT_SUPPORT: () => [],
|
|
65
|
+
INSPECT_ENVIRONMENT: () => [`${cloudInvocation()} status`],
|
|
66
|
+
};
|
|
67
|
+
// One label per line, with the prose beneath it rather than beside it.
|
|
68
|
+
//
|
|
69
|
+
// `output.warn` wraps through `wrapLine`, which takes a continuation line's indent from the
|
|
70
|
+
// *leading* whitespace of the line it is wrapping. A `Label: prose` line has none, so a long
|
|
71
|
+
// sentence written beside its label wraps back to column zero and the alignment a reader sees on a
|
|
72
|
+
// wide terminal disappears on a narrow one. Indenting the prose instead means the wrap is
|
|
73
|
+
// consistent at every width.
|
|
74
|
+
export function formatDeploymentRecovery(recovery, deploymentId) {
|
|
75
|
+
const lines = [`Failed stage: ${recovery.stageLabel ?? "not known"}`];
|
|
76
|
+
if (recovery.stageUnavailableReason)
|
|
77
|
+
lines.push(` ${recovery.stageUnavailableReason}`);
|
|
78
|
+
lines.push("", ` ${recovery.summary}`, "", "Next step:", ` ${recovery.nextActionMessage}`, "");
|
|
79
|
+
const commands = ACTION_COMMANDS[recovery.nextAction](deploymentId);
|
|
80
|
+
if (commands.length === 0)
|
|
81
|
+
lines.push(` Deployment ID: ${deploymentId}`);
|
|
82
|
+
for (const command of commands)
|
|
83
|
+
lines.push(` ${command}`);
|
|
84
|
+
return lines.join("\n");
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=recovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recovery.js","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/recovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAElF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAiB/C,MAAM,WAAW,GAA6B,EAAE,QAAQ,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC;AAE1F,iGAAiG;AACjG,gGAAgG;AAChG,iGAAiG;AACjG,cAAc;AACd,MAAM,sBAAsB,GAA2B;IACrD,SAAS,EACP,0FAA0F;IAC5F,QAAQ,EACN,2IAA2I;CAC9I,CAAC;AAEF,iGAAiG;AACjG,wFAAwF;AACxF,EAAE;AACF,+FAA+F;AAC/F,gGAAgG;AAChG,4FAA4F;AAC5F,kGAAkG;AAClG,sDAAsD;AACtD,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,MAAiB,EACjB,UAA6C;IAE7C,IAAI,UAAU,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QACnC,MAAM,MAAM,GAAG,sBAAsB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzD,OAAO,MAAM,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;IAC9E,CAAC;IACD,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAC/B,gBAAgB,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAAC,WAAW,CAC7D,CAAC;QACF,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC;IAC/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C;AAEF,uEAAuE;AACvE,EAAE;AACF,4FAA4F;AAC5F,6FAA6F;AAC7F,mGAAmG;AACnG,0FAA0F;AAC1F,6BAA6B;AAC7B,MAAM,UAAU,wBAAwB,CACtC,QAA4B,EAC5B,YAAoB;IAEpB,MAAM,KAAK,GAAG,CAAC,iBAAiB,QAAQ,CAAC,UAAU,IAAI,WAAW,EAAE,CAAC,CAAC;IACtE,IAAI,QAAQ,CAAC,sBAAsB;QAAE,KAAK,CAAC,IAAI,CAAC,KAAK,QAAQ,CAAC,sBAAsB,EAAE,CAAC,CAAC;IACxF,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,QAAQ,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,KAAK,QAAQ,CAAC,iBAAiB,EAAE,EAAE,EAAE,CAAC,CAAC;IACjG,MAAM,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,CAAC;IACpE,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,oBAAoB,YAAY,EAAE,CAAC,CAAC;IAC1E,KAAK,MAAM,OAAO,IAAI,QAAQ;QAAE,KAAK,CAAC,IAAI,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC;IAC3D,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollback.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/rollback.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,iBAAiB,EAYvB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"rollback.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/rollback.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,iBAAiB,EAYvB,MAAM,gBAAgB,CAAC;AAWxB,wBAAsB,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CA4DhG"}
|
|
@@ -4,7 +4,11 @@ import { FAILED_STATUSES, SUCCESS_STATUSES, TERMINAL_STATUSES, cloudInvocation,
|
|
|
4
4
|
import { optionalArgument } from "./arguments.js";
|
|
5
5
|
import { resolveDeploymentIdInEnvironment } from "./shared.js";
|
|
6
6
|
const POLL_INTERVAL_MS = 3_000;
|
|
7
|
-
|
|
7
|
+
// Compatibility fallback for an older control plane that does not expose its own budget, the same
|
|
8
|
+
// one `deploy.ts` carries. A rollback submits the same apply operation a deploy does — two Pulumi
|
|
9
|
+
// applies with the database task and the migration task between them — so it has to wait out the
|
|
10
|
+
// same deadlines, and a number hardcoded here goes stale the moment one of those moves.
|
|
11
|
+
const LEGACY_TIMEOUT_MS = 60 * 60 * 1000;
|
|
8
12
|
export async function rollback({ args, globals }) {
|
|
9
13
|
const deploymentId = optionalArgument(args, 0, "deploymentId");
|
|
10
14
|
const { project, environment } = await resolveEnvironment(globals);
|
|
@@ -22,10 +26,11 @@ export async function rollback({ args, globals }) {
|
|
|
22
26
|
spinner.start("Rollback in progress...");
|
|
23
27
|
let current = deployment;
|
|
24
28
|
const startedAt = Date.now();
|
|
29
|
+
const timeoutMs = (deployment.pollingTimeoutSeconds ?? LEGACY_TIMEOUT_MS / 1000) * 1000;
|
|
25
30
|
while (!TERMINAL_STATUSES.has(current.status)) {
|
|
26
|
-
if (Date.now() - startedAt >
|
|
31
|
+
if (Date.now() - startedAt > timeoutMs) {
|
|
27
32
|
spinner.stop("Rollback timed out");
|
|
28
|
-
prompts.log.warn(`Rollback did not complete within
|
|
33
|
+
prompts.log.warn(`Rollback did not complete within ${timeoutMs / 60_000} minutes. It may still finish — run \`${cloudInvocation()} deployment list\` to check.`);
|
|
29
34
|
return 1;
|
|
30
35
|
}
|
|
31
36
|
await sleep(POLL_INTERVAL_MS);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollback.js","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/rollback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAIL,eAAe,EAEf,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,yBAAyB,EACzB,cAAc,EACd,4BAA4B,EAC5B,kBAAkB,EAClB,KAAK,GACN,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC;AAE/D,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAC/B,MAAM,
|
|
1
|
+
{"version":3,"file":"rollback.js","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/rollback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAIL,eAAe,EAEf,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,yBAAyB,EACzB,cAAc,EACd,4BAA4B,EAC5B,kBAAkB,EAClB,KAAK,GACN,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC;AAE/D,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAC/B,kGAAkG;AAClG,kGAAkG;AAClG,iGAAiG;AACjG,wFAAwF;AACxF,MAAM,iBAAiB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEzC,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAqB;IACjE,MAAM,YAAY,GAAG,gBAAgB,CAAC,IAAI,EAAE,CAAC,EAAE,cAAc,CA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,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC/B,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACrC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,YAAY,CAAC,MAAsB;IAC1C,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,aAAa,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACrF,MAAM,OAAO,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACzE,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,MAAM,GAAG,OAAO,EAAE,CAAC;AAClE,CAAC;AAED,SAAS,cAAc,CAAC,MAAc;IACpC,IAAI,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC;QAAE,OAAO,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACvD,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,WAAW;YACd,OAAO,sBAAsB,CAAC;QAChC,KAAK,SAAS,CAAC;QACf,KAAK,QAAQ;YACX,OAAO,qBAAqB,CAAC;QAC/B;YACE,OAAO,MAAM,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"show.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/show.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"show.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/show.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,iBAAiB,EAYvB,MAAM,gBAAgB,CAAC;AAMxB,wBAAsB,cAAc,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CA2BxF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as prompts from "@clack/prompts";
|
|
2
|
-
import { cloudInvocation, createAuthenticatedClient, formatDateTime, formatUserFacingErrorDetails, resolveEnvironment, writeJson, } from "../../index.js";
|
|
2
|
+
import { cloudInvocation, createAuthenticatedClient, formatDateTime, formatUserFacingErrorDetails, output, resolveEnvironment, writeJson, } from "../../index.js";
|
|
3
3
|
import { optionalArgument } from "./arguments.js";
|
|
4
|
+
import { fetchDeploymentRecovery, formatDeploymentRecovery } from "./recovery.js";
|
|
4
5
|
import { resolveDeploymentId } from "./shared.js";
|
|
5
6
|
export async function showDeployment({ args, globals }) {
|
|
6
7
|
const deploymentId = optionalArgument(args, 0, "deployment-id");
|
|
@@ -9,14 +10,24 @@ export async function showDeployment({ args, globals }) {
|
|
|
9
10
|
? await resolveDeploymentId(client, globals, deploymentId)
|
|
10
11
|
: await findLatestDeploymentId(client, globals);
|
|
11
12
|
const deployment = await client.get(`/deployments/${encodeURIComponent(resolvedDeploymentId)}`);
|
|
13
|
+
// Independent of each other and both only for a failed deployment, so they are asked together.
|
|
14
|
+
const [{ recovery, unavailableReason }, errorContext] = await Promise.all([
|
|
15
|
+
fetchDeploymentRecovery(client, deployment),
|
|
16
|
+
deployment.errorDetails ? getDeploymentErrorContext(client, deployment) : undefined,
|
|
17
|
+
]);
|
|
12
18
|
if (globals.json) {
|
|
13
|
-
|
|
19
|
+
// Composed here rather than mirrored from the API: the control plane serves the deployment and
|
|
20
|
+
// the recovery as two documents, and this is the CLI joining them for a script that asked for
|
|
21
|
+
// one deployment. `recoveryUnavailableReason` is what keeps a null recovery honest — null for a
|
|
22
|
+
// deployment that did not fail, a sentence for one whose recovery could not be read.
|
|
23
|
+
writeJson({ ...deployment, recovery, recoveryUnavailableReason: unavailableReason });
|
|
14
24
|
return;
|
|
15
25
|
}
|
|
16
|
-
const errorContext = deployment.errorDetails
|
|
17
|
-
? await getDeploymentErrorContext(client, deployment)
|
|
18
|
-
: undefined;
|
|
19
26
|
prompts.note(formatDeployment(deployment, errorContext), "VC Deployment");
|
|
27
|
+
if (recovery)
|
|
28
|
+
output.warn(formatDeploymentRecovery(recovery, resolvedDeploymentId));
|
|
29
|
+
else if (unavailableReason)
|
|
30
|
+
output.warn(unavailableReason);
|
|
20
31
|
}
|
|
21
32
|
async function findLatestDeploymentId(client, options) {
|
|
22
33
|
const { environment } = await resolveEnvironment(options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"show.js","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/show.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAOL,eAAe,EACf,yBAAyB,EACzB,cAAc,EACd,4BAA4B,EAC5B,kBAAkB,EAClB,SAAS,GACV,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,EAAE,IAAI,EAAE,OAAO,EAAqB;IACvE,MAAM,YAAY,GAAG,gBAAgB,CAAC,IAAI,EAAE,CAAC,EAAE,eAAe,CAAC,CAAC;IAChE,MAAM,MAAM,GAAG,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAClD,MAAM,oBAAoB,GAAG,YAAY;QACvC,CAAC,CAAC,MAAM,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,CAAC;QAC1D,CAAC,CAAC,MAAM,sBAAsB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClD,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,GAAG,CACjC,gBAAgB,kBAAkB,CAAC,oBAAoB,CAAC,EAAE,CAC3D,CAAC;IAEF,
|
|
1
|
+
{"version":3,"file":"show.js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AC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,YAAY,CAAC,UAAsB;IAC1C,IAAI,CAAC,UAAU,CAAC,UAAU;QAAE,OAAO,GAAG,CAAC;IACvC,OAAO,UAAU,CAAC,aAAa;QAC7B,CAAC,CAAC,GAAG,UAAU,CAAC,UAAU,MAAM,UAAU,CAAC,aAAa,EAAE;QAC1D,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;AAC5B,CAAC"}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
1
|
import { type ApiClient, type Environment, type SourceBranchMappingDetails } from "../../index.js";
|
|
2
|
-
|
|
3
|
-
export type DeploymentSource = {
|
|
4
|
-
kind: "managed-build";
|
|
5
|
-
mapping: SourceBranchMappingDetails;
|
|
6
|
-
} | {
|
|
7
|
-
kind: "prebuilt-images";
|
|
8
|
-
images: DeploymentImageOptions & {
|
|
9
|
-
serverImage: string;
|
|
10
|
-
workerImage: string;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export declare function resolveDeploymentSource(client: ApiClient, environment: Environment, images: DeploymentImageOptions): Promise<DeploymentSource>;
|
|
2
|
+
export declare function requireBranchMapping(client: ApiClient, environment: Environment): Promise<SourceBranchMappingDetails>;
|
|
14
3
|
//# sourceMappingURL=source.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/source.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,0BAA0B,EAGhC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/source.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,0BAA0B,EAGhC,MAAM,gBAAgB,CAAC;AAIxB,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,SAAS,EACjB,WAAW,EAAE,WAAW,GACvB,OAAO,CAAC,0BAA0B,CAAC,CAQrC"}
|
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import { cloudInvocation, getBranchMappingOrNull, } from "../../index.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!images.serverImage || !images.workerImage) {
|
|
6
|
-
throw new Error(`Image deployment requires both \`--server-image\` and \`--worker-image\`. Provide both flags, or omit all image flags and configure a source repository with \`${cloudInvocation()} source connect\` and \`${cloudInvocation()} source map\`.`);
|
|
7
|
-
}
|
|
8
|
-
return {
|
|
9
|
-
kind: "prebuilt-images",
|
|
10
|
-
images: { ...images, serverImage: images.serverImage, workerImage: images.workerImage },
|
|
11
|
-
};
|
|
12
|
-
}
|
|
2
|
+
// The branch mapping a deploy builds from. An environment with no mapping has nothing to build, so
|
|
3
|
+
// this refuses and names `source connect` and `source map`.
|
|
4
|
+
export async function requireBranchMapping(client, environment) {
|
|
13
5
|
const mapping = await getBranchMappingOrNull(client, environment.id);
|
|
14
6
|
if (!mapping) {
|
|
15
|
-
throw new Error(`No source repository is configured for VC Environment "${environment.slug}". Configure one with \`${cloudInvocation()} source connect\` and \`${cloudInvocation()} source map
|
|
7
|
+
throw new Error(`No source repository is configured for VC Environment "${environment.slug}". Configure one with \`${cloudInvocation()} source connect\` and \`${cloudInvocation()} source map\`.`);
|
|
16
8
|
}
|
|
17
|
-
return
|
|
9
|
+
return mapping;
|
|
18
10
|
}
|
|
19
11
|
//# sourceMappingURL=source.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/source.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,eAAe,EACf,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/source.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,eAAe,EACf,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AAExB,mGAAmG;AACnG,4DAA4D;AAC5D,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,MAAiB,EACjB,WAAwB;IAExB,MAAM,OAAO,GAAG,MAAM,sBAAsB,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC;IACrE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,0DAA0D,WAAW,CAAC,IAAI,2BAA2B,eAAe,EAAE,2BAA2B,eAAe,EAAE,gBAAgB,CACnL,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/status.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/status.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,iBAAiB,EAUvB,MAAM,gBAAgB,CAAC;AAIxB,wBAAsB,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsE1E"}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import * as prompts from "@clack/prompts";
|
|
2
|
-
import { FAILED_STATUSES, SUCCESS_STATUSES, cloudInvocation, createAuthenticatedClient, formatDateTime, formatUserFacingErrorDetails, resolveEnvironment, } from "../../index.js";
|
|
2
|
+
import { FAILED_STATUSES, SUCCESS_STATUSES, cloudInvocation, createAuthenticatedClient, formatDateTime, formatUserFacingErrorDetails, output, platformAddress, resolveEnvironment, } from "../../index.js";
|
|
3
3
|
import { DEPLOYMENT_ID_PREFIX_MIN_LENGTH } from "../../lib/contract/wire-values.js";
|
|
4
4
|
export async function status({ globals }) {
|
|
5
|
-
const { environment } = await resolveEnvironment(globals);
|
|
5
|
+
const { environment: selectedEnvironment } = await resolveEnvironment(globals);
|
|
6
6
|
const client = createAuthenticatedClient(globals);
|
|
7
|
-
const current = await client.get(`/environments/${
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
const current = await client.get(`/environments/${selectedEnvironment.id}/status`);
|
|
8
|
+
const statusEnvironment = current.environment;
|
|
9
|
+
output.info(`Project: ${statusEnvironment.projectName}`);
|
|
10
|
+
output.info(`Environment: ${statusEnvironment.name} (${statusEnvironment.type})`);
|
|
11
|
+
output.info(`Runtime: ${statusEnvironment.runtimeState}`);
|
|
12
|
+
// TODO: CLO-822 puts the hostname on the status response; read it from `statusEnvironment` then.
|
|
13
|
+
output.info(`URL: ${platformAddress(selectedEnvironment) ?? "not assigned"}`);
|
|
14
|
+
if (statusEnvironment.branch) {
|
|
15
|
+
output.info(`Branch: ${statusEnvironment.branch}`);
|
|
14
16
|
}
|
|
15
17
|
const dep = current.latestDeployment;
|
|
16
18
|
if (!dep) {
|
|
17
19
|
prompts.log.message("");
|
|
18
|
-
|
|
20
|
+
output.warn(`No deployments yet. Run \`${cloudInvocation()} deploy\` to get started.`);
|
|
19
21
|
return;
|
|
20
22
|
}
|
|
21
23
|
prompts.log.message("");
|
|
@@ -23,26 +25,26 @@ export async function status({ globals }) {
|
|
|
23
25
|
const logStatus = FAILED_STATUSES.has(dep.status)
|
|
24
26
|
? prompts.log.error
|
|
25
27
|
: SUCCESS_STATUSES.has(dep.status)
|
|
26
|
-
?
|
|
27
|
-
:
|
|
28
|
-
|
|
28
|
+
? output.success
|
|
29
|
+
: output.warn;
|
|
30
|
+
output.info(`ID: ${dep.id.slice(0, DEPLOYMENT_ID_PREFIX_MIN_LENGTH)}`);
|
|
29
31
|
logStatus(`Status: ${dep.status}`);
|
|
30
|
-
|
|
32
|
+
output.info(`Trigger: ${dep.trigger}`);
|
|
31
33
|
if (dep.commitHash) {
|
|
32
34
|
const short = dep.commitHash.slice(0, 7);
|
|
33
35
|
const msg = dep.commitMessage ? ` — ${dep.commitMessage}` : "";
|
|
34
|
-
|
|
36
|
+
output.info(`Commit: ${short}${msg}`);
|
|
35
37
|
}
|
|
36
38
|
if (dep.startedAt) {
|
|
37
|
-
|
|
39
|
+
output.info(`Started: ${formatDateTime(dep.startedAt)}`);
|
|
38
40
|
}
|
|
39
41
|
if (dep.completedAt) {
|
|
40
|
-
|
|
42
|
+
output.info(`Completed: ${formatDateTime(dep.completedAt)}`);
|
|
41
43
|
}
|
|
42
44
|
if (dep.errorDetails) {
|
|
43
45
|
prompts.log.error(`Error: ${formatUserFacingErrorDetails(dep.errorDetails, {
|
|
44
|
-
projectSlug:
|
|
45
|
-
environmentSlug:
|
|
46
|
+
projectSlug: statusEnvironment.projectSlug,
|
|
47
|
+
environmentSlug: statusEnvironment.slug,
|
|
46
48
|
})}`);
|
|
47
49
|
}
|
|
48
50
|
if (current.services.length > 0) {
|
|
@@ -52,7 +54,7 @@ export async function status({ globals }) {
|
|
|
52
54
|
const runtime = svc.runtimeState === null
|
|
53
55
|
? ""
|
|
54
56
|
: ` — ${svc.runtimeState}${svc.runtimeHealth ? ` / ${svc.runtimeHealth}` : ""}`;
|
|
55
|
-
|
|
57
|
+
output.info(`${svc.label}${runtime}`);
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAEL,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,yBAAyB,EACzB,cAAc,EACd,4BAA4B,EAC5B,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AAEpF,MAAM,CAAC,KAA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|
1
|
-
{"version":3,"file":"teardown.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/teardown.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"teardown.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/deployment/teardown.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,iBAAiB,EAOvB,MAAM,gBAAgB,CAAC;AAwBxB,wBAAsB,cAAc,CAAC,EACnC,OAAO,EACP,OAAO,GACR,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAOjD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as prompts from "@clack/prompts";
|
|
2
|
-
import { createAuthenticatedClient, formatUserFacingErrorDetails, resolveEnvironment, sleep, } from "../../index.js";
|
|
2
|
+
import { createAuthenticatedClient, formatUserFacingErrorDetails, output, resolveEnvironment, sleep, } from "../../index.js";
|
|
3
3
|
import { isPlanPreviewUnavailable, } from "../../lib/contract/deployments.js";
|
|
4
4
|
import { readBooleanOption, readNegatableOption } from "./options.js";
|
|
5
5
|
import { formatActionLine } from "./plan-format.js";
|
|
@@ -95,6 +95,7 @@ async function deployTeardownAction(opts, skipConfirm, wait) {
|
|
|
95
95
|
environmentSlug: current.environmentSlug,
|
|
96
96
|
}));
|
|
97
97
|
}
|
|
98
|
+
reportTeardownId(teardownResult.teardownId);
|
|
98
99
|
return 1;
|
|
99
100
|
}
|
|
100
101
|
spinner.stop("Teardown complete.");
|
|
@@ -142,11 +143,21 @@ async function deployForceTeardownAction(opts, skipConfirm, wait) {
|
|
|
142
143
|
environmentSlug: current.environmentSlug,
|
|
143
144
|
}));
|
|
144
145
|
}
|
|
146
|
+
reportTeardownId(result.teardownId);
|
|
145
147
|
return 1;
|
|
146
148
|
}
|
|
147
149
|
spinner.stop("Force teardown complete.");
|
|
148
150
|
prompts.outro(`Environment "${current.projectSlug}/${current.environmentSlug}" deleted.`);
|
|
149
151
|
}
|
|
152
|
+
// The id every failed teardown ends on, and the one thing the server's own message asks the
|
|
153
|
+
// customer to quote. It was missing from both failure paths while the message asked for it, so a
|
|
154
|
+
// teardown that could not be confirmed left the operator with nothing to give support (CLO-881).
|
|
155
|
+
//
|
|
156
|
+
// Printed after the server's sentence rather than instead of it: the sentence says what could not
|
|
157
|
+
// be confirmed and this says what to quote, the same order the deploy prints its recovery in.
|
|
158
|
+
function reportTeardownId(teardownId) {
|
|
159
|
+
output.warn(`Teardown ID: ${teardownId}`);
|
|
160
|
+
}
|
|
150
161
|
// Answers with the terminal status, or with the exit code a run that gave up waiting earns. The
|
|
151
162
|
// two are carried together rather than as one nullable value, because "still running" is a
|
|
152
163
|
// distinct outcome from a terminal status and it is the one that decides the exit code.
|