@go-to-k/cdkd 0.115.3 → 0.115.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.
|
@@ -2897,6 +2897,60 @@ async function spawnStreaming(cmd, args, options = {}) {
|
|
|
2897
2897
|
});
|
|
2898
2898
|
}
|
|
2899
2899
|
/**
|
|
2900
|
+
* Spawn a docker-compatible CLI binary (resolved via `getDockerCmd`) attached
|
|
2901
|
+
* to the parent process's stdio so the user sees live output (`docker pull`
|
|
2902
|
+
* layer progress, `docker login` interactive prompts that should never fire
|
|
2903
|
+
* with `--password-stdin` but still safe to inherit, etc.). Resolves on exit
|
|
2904
|
+
* code 0; rejects with a plain `Error` carrying the exit code on any non-zero
|
|
2905
|
+
* exit, so the caller can wrap with its own error class.
|
|
2906
|
+
*
|
|
2907
|
+
* Differs from {@link runDockerStreaming} in two ways:
|
|
2908
|
+
* 1. `stdio: 'inherit'` — output is NOT captured, so terminal control codes
|
|
2909
|
+
* (color, progress bar overwrites) flow through unchanged. This is the
|
|
2910
|
+
* load-bearing reason for the split: `docker pull`'s progress bars only
|
|
2911
|
+
* animate properly when stdout is a real TTY connected to the parent.
|
|
2912
|
+
* 2. No `input` / `streamLive` options — inherit-mode has nothing to
|
|
2913
|
+
* capture and nothing to mirror.
|
|
2914
|
+
*
|
|
2915
|
+
* Used by the `--verbose`-mode `docker pull` plumbing in `docker-runner.ts`
|
|
2916
|
+
* and `ecr-puller.ts` (visible layer progress). Non-verbose pulls go through
|
|
2917
|
+
* {@link runDockerStreaming} so stderr can be folded into the error message.
|
|
2918
|
+
*/
|
|
2919
|
+
async function runDockerForeground(args, options = {}) {
|
|
2920
|
+
return spawnForeground(getDockerCmd(), args, options);
|
|
2921
|
+
}
|
|
2922
|
+
/**
|
|
2923
|
+
* Foreground (stdio-inherit) spawn — the inherit-mode counterpart to
|
|
2924
|
+
* {@link spawnStreaming}. Used by {@link runDockerForeground} for docker-CLI
|
|
2925
|
+
* subprocesses.
|
|
2926
|
+
*
|
|
2927
|
+
* The ENOENT branch crafts a docker-specific install hint ("Install Docker
|
|
2928
|
+
* (or set CDK_DOCKER ...)"), so non-docker callers reusing this helper
|
|
2929
|
+
* would see a misleading error on missing-binary failures. Keep the binary
|
|
2930
|
+
* docker-shaped, or update the ENOENT message before adding a non-docker
|
|
2931
|
+
* call site.
|
|
2932
|
+
*/
|
|
2933
|
+
async function spawnForeground(cmd, args, options = {}) {
|
|
2934
|
+
const env = options.env ? mergeEnv(options.env) : void 0;
|
|
2935
|
+
return new Promise((resolve, reject) => {
|
|
2936
|
+
const child = spawn(cmd, args, {
|
|
2937
|
+
cwd: options.cwd,
|
|
2938
|
+
env,
|
|
2939
|
+
stdio: "inherit"
|
|
2940
|
+
});
|
|
2941
|
+
child.once("error", (err) => {
|
|
2942
|
+
if (err.code === "ENOENT") {
|
|
2943
|
+
const usingOverride = process.env["CDK_DOCKER"] === cmd && cmd !== "docker";
|
|
2944
|
+
reject(/* @__PURE__ */ new Error(usingOverride ? `Failed to find and execute '${cmd}' (resolved via CDK_DOCKER). Install '${cmd}' or unset CDK_DOCKER to fall back to 'docker'.` : `Failed to find and execute '${cmd}'. Install Docker (or set the 'CDK_DOCKER' environment variable to a compatible binary such as podman / finch).`));
|
|
2945
|
+
} else reject(/* @__PURE__ */ new Error(`${cmd} failed: ${err.message}`));
|
|
2946
|
+
});
|
|
2947
|
+
child.once("close", (code) => {
|
|
2948
|
+
if (code === 0) resolve();
|
|
2949
|
+
else reject(/* @__PURE__ */ new Error(`${cmd} exited with code ${code}`));
|
|
2950
|
+
});
|
|
2951
|
+
});
|
|
2952
|
+
}
|
|
2953
|
+
/**
|
|
2900
2954
|
* Format the stderr from a failed `docker login` so the surfaced cdkd
|
|
2901
2955
|
* error gives the user an actionable workaround when the underlying
|
|
2902
2956
|
* failure is a credential-helper persistence bug (which has nothing to
|
|
@@ -2992,7 +3046,7 @@ async function buildDockerImage(asset, cdkOutDir, options) {
|
|
|
2992
3046
|
function buildDockerBuildCommand(source, tag, platformOverride) {
|
|
2993
3047
|
const args = [
|
|
2994
3048
|
"build",
|
|
2995
|
-
"
|
|
3049
|
+
"--tag",
|
|
2996
3050
|
tag
|
|
2997
3051
|
];
|
|
2998
3052
|
if (source.dockerBuildArgs) for (const [k, v] of Object.entries(source.dockerBuildArgs)) args.push("--build-arg", `${k}=${v}`);
|
|
@@ -3000,7 +3054,7 @@ function buildDockerBuildCommand(source, tag, platformOverride) {
|
|
|
3000
3054
|
if (source.dockerBuildSecrets) for (const [k, v] of Object.entries(source.dockerBuildSecrets)) args.push("--secret", `id=${k},${v}`);
|
|
3001
3055
|
if (source.dockerBuildSsh) args.push("--ssh", source.dockerBuildSsh);
|
|
3002
3056
|
if (source.dockerBuildTarget) args.push("--target", source.dockerBuildTarget);
|
|
3003
|
-
if (source.dockerFile) args.push("
|
|
3057
|
+
if (source.dockerFile) args.push("--file", source.dockerFile);
|
|
3004
3058
|
if (source.networkMode) args.push("--network", source.networkMode);
|
|
3005
3059
|
const platform = platformOverride ?? source.platform;
|
|
3006
3060
|
if (platform) args.push("--platform", platform);
|
|
@@ -9767,5 +9821,5 @@ var DeployEngine = class {
|
|
|
9767
9821
|
};
|
|
9768
9822
|
|
|
9769
9823
|
//#endregion
|
|
9770
|
-
export {
|
|
9771
|
-
//# sourceMappingURL=deploy-engine-
|
|
9824
|
+
export { RouteDiscoveryError as $, runDockerStreaming as A, AssemblyReader as B, AssetPublisher as C, formatDockerLoginError as D, buildDockerImage as E, resolveCaptureObservedState as F, ConfigError as G, resolveBucketRegion as H, resolveSkipPrefix as I, LockError as J, DependencyError as K, resolveStateBucketWithDefault as L, getDefaultStateBucketName as M, getLegacyStateBucketName as N, getDockerCmd as O, resolveApp as P, ResourceUpdateNotSupportedError as Q, resolveStateBucketWithDefaultAndSource as R, shouldRetainResource as S, WorkGraph as T, AssetError as U, clearBucketRegionCache as V, CdkdError as W, ProvisioningError as X, PartialFailureError as Y, ResourceTimeoutError as Z, DiffCalculator as _, withSkipPrefix as _t, withRetry as a, isCdkdError as at, LockManager as b, collectInlinePolicyNamesManagedBySiblings as c, ConsoleLogger as ct, normalizeAwsTagsToCfn as d, runStackBuffered as dt, StackHasActiveImportsError as et, resolveExplicitPhysicalId as f, getLiveRenderer as ft, IntrinsicFunctionResolver as g, generateResourceNameWithFallback as gt, assertRegionMatch as h, generateResourceName as ht, withResourceDeadline as i, formatError as it, Synthesizer as j, runDockerForeground as k, CDK_PATH_TAG as l, getLogger as lt, CloudControlProvider as m, PATTERN_B_RESOURCE_TYPES as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, StateError as nt, IMPLICIT_DELETE_DEPENDENCIES as o, normalizeAwsError as ot, ProviderRegistry as p, PATTERN_B_NAME_PROPERTIES as pt, LocalInvokeBuildError as q, DeployEngine as r, SynthesisError as rt, IAMRoleProvider as s, withErrorHandling as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, StackTerminationProtectionError as tt, matchesCdkPath as u, setLogger as ut, DagBuilder as v, withStackName as vt, stringifyValue as w, S3StateBackend as x, TemplateParser as y, warnDeprecatedNoPrefixCliFlag as z };
|
|
9825
|
+
//# sourceMappingURL=deploy-engine-Chzg_hDE.js.map
|