@geekmidas/cli 10.0.0-alpha.73 → 10.0.0-alpha.75

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.
Files changed (138) hide show
  1. package/dist/{LegacyStateStore-D_78eaHM.cjs → LegacyStateStore-BFnXUFlx.cjs} +2 -2
  2. package/dist/{LegacyStateStore-D_78eaHM.cjs.map → LegacyStateStore-BFnXUFlx.cjs.map} +1 -1
  3. package/dist/{LegacyStateStore-DTo7z924.mjs → LegacyStateStore-cpt3K1vx.mjs} +2 -2
  4. package/dist/{LegacyStateStore-DTo7z924.mjs.map → LegacyStateStore-cpt3K1vx.mjs.map} +1 -1
  5. package/dist/{LocalStateStore-CNjgkRk4.mjs → LocalStateStore-RH9F2ZEy.mjs} +2 -2
  6. package/dist/{LocalStateStore-CNjgkRk4.mjs.map → LocalStateStore-RH9F2ZEy.mjs.map} +1 -1
  7. package/dist/{LocalStateStore-BhrlQIXD.cjs → LocalStateStore-zQGZ9b4J.cjs} +2 -2
  8. package/dist/{LocalStateStore-BhrlQIXD.cjs.map → LocalStateStore-zQGZ9b4J.cjs.map} +1 -1
  9. package/dist/{S3StateStore-oCxRs6HM.cjs → S3StateStore-CT-ZMlQY.cjs} +2 -2
  10. package/dist/{S3StateStore-oCxRs6HM.cjs.map → S3StateStore-CT-ZMlQY.cjs.map} +1 -1
  11. package/dist/{S3StateStore-g2P7T_Mo.mjs → S3StateStore-DBeBc0c0.mjs} +2 -2
  12. package/dist/{S3StateStore-g2P7T_Mo.mjs.map → S3StateStore-DBeBc0c0.mjs.map} +1 -1
  13. package/dist/{SSMStateStore-DXp0m7XI.cjs → SSMStateStore-HmsH3c4v.cjs} +2 -2
  14. package/dist/{SSMStateStore-DXp0m7XI.cjs.map → SSMStateStore-HmsH3c4v.cjs.map} +1 -1
  15. package/dist/{SSMStateStore-CYenunmK.mjs → SSMStateStore-rnzNfOaV.mjs} +2 -2
  16. package/dist/{SSMStateStore-CYenunmK.mjs.map → SSMStateStore-rnzNfOaV.mjs.map} +1 -1
  17. package/dist/{SubscriberGenerator-DZk_pKDh.mjs → SubscriberGenerator-5looQ3gB.mjs} +18 -2
  18. package/dist/SubscriberGenerator-5looQ3gB.mjs.map +1 -0
  19. package/dist/{SubscriberGenerator-Bixm28fN.cjs → SubscriberGenerator-CajwOa5W.cjs} +29 -1
  20. package/dist/SubscriberGenerator-CajwOa5W.cjs.map +1 -0
  21. package/dist/{add-C1ojB2Yy.cjs → add-CHBin8TF.cjs} +2 -2
  22. package/dist/{add-C1ojB2Yy.cjs.map → add-CHBin8TF.cjs.map} +1 -1
  23. package/dist/{add-BiPlBUq3.mjs → add-Cvzdw8cf.mjs} +2 -2
  24. package/dist/{add-BiPlBUq3.mjs.map → add-Cvzdw8cf.mjs.map} +1 -1
  25. package/dist/{bundler-C35h0WKt.cjs → bundler-_8AEZhrs.cjs} +5 -5
  26. package/dist/{bundler-C35h0WKt.cjs.map → bundler-_8AEZhrs.cjs.map} +1 -1
  27. package/dist/{bundler-C2LZoLdP.mjs → bundler-xjp5RwRS.mjs} +5 -5
  28. package/dist/{bundler-C2LZoLdP.mjs.map → bundler-xjp5RwRS.mjs.map} +1 -1
  29. package/dist/{cli-DJVL2sL9.cjs → cli-B4ktxAsM.cjs} +3 -3
  30. package/dist/{cli-DJVL2sL9.cjs.map → cli-B4ktxAsM.cjs.map} +1 -1
  31. package/dist/{cli-BfdfyTF6.mjs → cli-BTGfA0B7.mjs} +3 -3
  32. package/dist/{cli-BfdfyTF6.mjs.map → cli-BTGfA0B7.mjs.map} +1 -1
  33. package/dist/{compose-9II-0IsK.mjs → compose-DdH2JQJD.mjs} +418 -159
  34. package/dist/compose-DdH2JQJD.mjs.map +1 -0
  35. package/dist/{compose-CNnw8meq.cjs → compose-UKyv_1yU.cjs} +440 -157
  36. package/dist/compose-UKyv_1yU.cjs.map +1 -0
  37. package/dist/{config-RLuR2o9A.d.cts → config-B38YWicj.d.cts} +3 -3
  38. package/dist/{config-B8OR_TrO.d.mts.map → config-B38YWicj.d.cts.map} +1 -1
  39. package/dist/{config-B8OR_TrO.d.mts → config-DA0kRTQe.d.mts} +3 -3
  40. package/dist/{config-RLuR2o9A.d.cts.map → config-DA0kRTQe.d.mts.map} +1 -1
  41. package/dist/config.d.cts +3 -3
  42. package/dist/config.d.mts +3 -3
  43. package/dist/deploy/public.cjs +7 -6
  44. package/dist/deploy/public.d.cts +14 -3
  45. package/dist/deploy/public.d.cts.map +1 -1
  46. package/dist/deploy/public.d.mts +14 -3
  47. package/dist/deploy/public.d.mts.map +1 -1
  48. package/dist/deploy/public.mjs +7 -7
  49. package/dist/{deploy-nmov4j0B.mjs → deploy-CuSsiFIc.mjs} +21 -5
  50. package/dist/deploy-CuSsiFIc.mjs.map +1 -0
  51. package/dist/{deploy-BitZLdnY.cjs → deploy-XUZoA1us.cjs} +26 -4
  52. package/dist/deploy-XUZoA1us.cjs.map +1 -0
  53. package/dist/{dokploy-Ce_VTytN.cjs → dokploy-Cvgg_pID.cjs} +2 -2
  54. package/dist/{dokploy-Ce_VTytN.cjs.map → dokploy-Cvgg_pID.cjs.map} +1 -1
  55. package/dist/{dokploy-CZ1vZt21.mjs → dokploy-DZXTQX10.mjs} +2 -2
  56. package/dist/{dokploy-CZ1vZt21.mjs.map → dokploy-DZXTQX10.mjs.map} +1 -1
  57. package/dist/drivers-BdvtCKc7.cjs +200 -0
  58. package/dist/drivers-BdvtCKc7.cjs.map +1 -0
  59. package/dist/drivers-Ch1rJitn.mjs +177 -0
  60. package/dist/drivers-Ch1rJitn.mjs.map +1 -0
  61. package/dist/{encryption-CmfPICSN.mjs → encryption-JkeMPugf.mjs} +2 -2
  62. package/dist/{encryption-CmfPICSN.mjs.map → encryption-JkeMPugf.mjs.map} +1 -1
  63. package/dist/{encryption-CDGRdcMr.cjs → encryption-w-Ehh9DW.cjs} +2 -2
  64. package/dist/{encryption-CDGRdcMr.cjs.map → encryption-w-Ehh9DW.cjs.map} +1 -1
  65. package/dist/{engine-B37qBO5W.mjs → engine-CmozkHxq.mjs} +192 -4
  66. package/dist/engine-CmozkHxq.mjs.map +1 -0
  67. package/dist/{engine-DL2-PW6m.cjs → engine-zpWBMsQq.cjs} +195 -7
  68. package/dist/engine-zpWBMsQq.cjs.map +1 -0
  69. package/dist/{github-C6qF8kHg.cjs → github-BGdJ-Lnm.cjs} +2 -2
  70. package/dist/{github-C6qF8kHg.cjs.map → github-BGdJ-Lnm.cjs.map} +1 -1
  71. package/dist/{github-hjHHm7jM.mjs → github-BNngHoId.mjs} +2 -2
  72. package/dist/{github-hjHHm7jM.mjs.map → github-BNngHoId.mjs.map} +1 -1
  73. package/dist/{index-DHyTqGG3.d.mts → index-B-1lLGzy.d.mts} +2 -2
  74. package/dist/{index-DHyTqGG3.d.mts.map → index-B-1lLGzy.d.mts.map} +1 -1
  75. package/dist/{index-Dg-UZ4Hm.d.cts → index-vMidfqhU.d.cts} +2 -2
  76. package/dist/{index-Dg-UZ4Hm.d.cts.map → index-vMidfqhU.d.cts.map} +1 -1
  77. package/dist/index.cjs +89 -52
  78. package/dist/index.cjs.map +1 -1
  79. package/dist/index.mjs +86 -49
  80. package/dist/index.mjs.map +1 -1
  81. package/dist/{migrate-CFFC3esE.mjs → migrate-BLL1RTAj.mjs} +2 -2
  82. package/dist/{migrate-CFFC3esE.mjs.map → migrate-BLL1RTAj.mjs.map} +1 -1
  83. package/dist/{migrate-kA_j1TPK.cjs → migrate-CgjlYeun.cjs} +2 -2
  84. package/dist/{migrate-kA_j1TPK.cjs.map → migrate-CgjlYeun.cjs.map} +1 -1
  85. package/dist/openapi.d.cts +1 -1
  86. package/dist/openapi.d.mts +1 -1
  87. package/dist/{ready-BIuMw6wH.cjs → ready-BB9xS4S9.cjs} +6 -188
  88. package/dist/ready-BB9xS4S9.cjs.map +1 -0
  89. package/dist/{ready-C0U0NYfB.mjs → ready-ZZoNskrr.mjs} +5 -169
  90. package/dist/ready-ZZoNskrr.mjs.map +1 -0
  91. package/dist/reconcile/public.d.cts +1 -1
  92. package/dist/reconcile/public.d.mts +1 -1
  93. package/dist/{resolve-CV4eQkDa.mjs → resolve-DZNx7rLy.mjs} +3 -3
  94. package/dist/{resolve-CV4eQkDa.mjs.map → resolve-DZNx7rLy.mjs.map} +1 -1
  95. package/dist/{resolve-E5RfY0bm.cjs → resolve-fevXn-wZ.cjs} +3 -3
  96. package/dist/{resolve-E5RfY0bm.cjs.map → resolve-fevXn-wZ.cjs.map} +1 -1
  97. package/dist/{rollback-C-V-Rf4a.mjs → rollback-CLi5Pln_.mjs} +4 -4
  98. package/dist/{rollback-C-V-Rf4a.mjs.map → rollback-CLi5Pln_.mjs.map} +1 -1
  99. package/dist/{rollback-QGwomD64.cjs → rollback-Dw-FW3X2.cjs} +4 -4
  100. package/dist/{rollback-QGwomD64.cjs.map → rollback-Dw-FW3X2.cjs.map} +1 -1
  101. package/dist/{runtime-CWYLIeCU.d.mts → runtime-BzZD5HHi.d.cts} +2 -2
  102. package/dist/{runtime-CWYLIeCU.d.mts.map → runtime-BzZD5HHi.d.cts.map} +1 -1
  103. package/dist/{runtime-CmuQOT6A.d.cts → runtime-Cm6J6L7n.d.mts} +2 -2
  104. package/dist/{runtime-CmuQOT6A.d.cts.map → runtime-Cm6J6L7n.d.mts.map} +1 -1
  105. package/dist/{sniffer-BFmdZpZ2.mjs → sniffer-BmCvVyhq.mjs} +59 -7
  106. package/dist/sniffer-BmCvVyhq.mjs.map +1 -0
  107. package/dist/{sniffer-C-T7dSMN.cjs → sniffer-bMzrX4cO.cjs} +75 -5
  108. package/dist/{sniffer-C-T7dSMN.cjs.map → sniffer-bMzrX4cO.cjs.map} +1 -1
  109. package/dist/{state-DtS2HEfi.mjs → state-BrWIOce_.mjs} +60 -293
  110. package/dist/state-BrWIOce_.mjs.map +1 -0
  111. package/dist/{state-DMjFPOhf.cjs → state-kA4Fkufx.cjs} +70 -321
  112. package/dist/state-kA4Fkufx.cjs.map +1 -0
  113. package/dist/target/public.cjs +1 -1
  114. package/dist/target/public.d.cts +2 -2
  115. package/dist/target/public.d.mts +2 -2
  116. package/dist/target/public.mjs +1 -1
  117. package/dist/{types-BLdCL4fB.d.mts → types-Dp9lgx_S.d.mts} +6 -2
  118. package/dist/{types-BLdCL4fB.d.mts.map → types-Dp9lgx_S.d.mts.map} +1 -1
  119. package/dist/{types-DwCQCkC-.d.cts → types-TzCChNrA.d.cts} +6 -2
  120. package/dist/{types-DwCQCkC-.d.cts.map → types-TzCChNrA.d.cts.map} +1 -1
  121. package/dist/vitest.cjs +1 -1
  122. package/dist/vitest.mjs +1 -1
  123. package/dist/workspace/index.d.cts +2 -2
  124. package/dist/workspace/index.d.mts +2 -2
  125. package/package.json +17 -17
  126. package/dist/SubscriberGenerator-Bixm28fN.cjs.map +0 -1
  127. package/dist/SubscriberGenerator-DZk_pKDh.mjs.map +0 -1
  128. package/dist/compose-9II-0IsK.mjs.map +0 -1
  129. package/dist/compose-CNnw8meq.cjs.map +0 -1
  130. package/dist/deploy-BitZLdnY.cjs.map +0 -1
  131. package/dist/deploy-nmov4j0B.mjs.map +0 -1
  132. package/dist/engine-B37qBO5W.mjs.map +0 -1
  133. package/dist/engine-DL2-PW6m.cjs.map +0 -1
  134. package/dist/ready-BIuMw6wH.cjs.map +0 -1
  135. package/dist/ready-C0U0NYfB.mjs.map +0 -1
  136. package/dist/sniffer-BFmdZpZ2.mjs.map +0 -1
  137. package/dist/state-DMjFPOhf.cjs.map +0 -1
  138. package/dist/state-DtS2HEfi.mjs.map +0 -1
@@ -1,20 +1,208 @@
1
+ import { a as runOutput, i as run } from "./run-BJLIerMM.mjs";
1
2
  import { i as LocalSandbox, t as MissingCredential } from "./credentials-pAtB70k3.mjs";
2
3
  import { a as discriminatedUnion, c as looseObject, f as string, n as array, s as literal, u as object } from "./schemas-D-xeKJDD.mjs";
3
4
  import { c as runWorker, d as output, r as discover } from "./discover-BPelzeGW.mjs";
4
5
  import { i as activeSandbox } from "./sandbox-Dm247NGx.mjs";
5
6
  import { t as appKey } from "./derive-B4vDpzgP.mjs";
6
7
  import { g as stripPublicPrefix, h as getPublicEnvPrefix, s as getAppBuildOrder } from "./workspace-C7NqCsQF.mjs";
7
- import { $ as constructGlobs, $t as applicationName, At as eventsBackendFor, E as resolveHost, Et as WORKER_PORT, F as devServicesUsed, H as workerUnits, I as externalServices, L as manifestServiceDeclarations, M as STORAGE_KEY_PAIR, Mt as storageBackendFor, O as otelEnv, P as assertExternalServices, S as workerDockerfileOf, T as isMainFrontendApp, U as encryptSecrets, _ as deployDocker, _t as workerEnvKeys, a as recordRelease, an as ownershipMarker, c as setBackupState, d as setGeneratedSecret, f as setPostgresBackupId, i as isDnsVerified, in as markerOf, j as ExternalServicesNotConfigured, jt as providerOf, kt as cacheBackendFor, l as setDnsRecord, m as withGeneratedSecrets, n as getBackupState, nn as imageRef, o as recordRollback, on as projectName, p as DeployJournal, r as getGeneratedSecret, rn as isOwnedBy, s as setApplicationId, sn as initStageSecrets, st as applyPostgres, t as createEmptyState, tn as imageName, u as setDnsVerification, un as toEmbeddableSecrets, xt as resourceName, z as reportDevServices } from "./state-DtS2HEfi.mjs";
8
- import { f as StateStoreBusy, m as StateVersionConflict, o as DokployApi, s as DokployApiError, t as sniffAllApps, v as eventError } from "./sniffer-BFmdZpZ2.mjs";
8
+ import { $t as imageRef, A as ExternalServicesNotConfigured, Ct as WORKER_PORT, D as otelEnv, Dt as eventsBackendFor, Et as cacheBackendFor, F as externalServices, I as manifestServiceDeclarations, N as assertExternalServices, Ot as providerOf, P as devServicesUsed, Qt as imageName, R as reportDevServices, S as validateImageRef, T as resolveHost, V as workerUnits, Xt as applicationName, Y as constructGlobs, a as recordRelease, c as setBackupState, d as setGeneratedSecret, en as isOwnedBy, f as setPostgresBackupId, ft as dockerfileOf, g as DockerPushFailed, h as DockerBuildFailed, i as isDnsVerified, in as initStageSecrets, j as STORAGE_KEY_PAIR, kt as storageBackendFor, l as setDnsRecord, m as withGeneratedSecrets, mt as workerEnvKeys, n as getBackupState, nn as ownershipMarker, o as recordRollback, p as DeployJournal, r as getGeneratedSecret, rn as projectName, rt as applyPostgres, s as setApplicationId, sn as toEmbeddableSecrets, t as createEmptyState, tn as markerOf, u as setDnsVerification, v as dockerCommand, vt as resourceName, w as isMainFrontendApp, x as workerDockerfileOf } from "./state-BrWIOce_.mjs";
9
+ import { f as StateStoreBusy, m as StateVersionConflict, o as DokployApi, s as DokployApiError, t as sniffAllApps, v as eventError, x as keyFingerprint, y as encryptSecrets } from "./sniffer-BmCvVyhq.mjs";
9
10
  import { o as migrationFiles } from "./provider-D7rQzzzf.mjs";
10
11
  import { n as assertStageCredentials } from "./credentialSchemas-BJqRJNK4.mjs";
11
- import { join } from "node:path";
12
+ import { join, relative } from "node:path";
13
+ import { chmod, mkdtemp, rm, writeFile } from "node:fs/promises";
14
+ import { tmpdir } from "node:os";
12
15
  import { cacheTable, cloudName, cookieDomain, dependentsOf, externalApiUrl, migrationTargets, mobileOrigins, provideKey, provisionOrder, schemeBase } from "@geekmidas/manifest";
13
16
  import { createHash, randomBytes } from "node:crypto";
14
17
  import { ownerRole, readerRole, roleStatements } from "@geekmidas/db/pg/roles";
15
18
  import { Client } from "pg";
16
19
  import { cacheTableStatements } from "@geekmidas/cache/postgres";
17
20
  import { lookup } from "node:dns/promises";
21
+ //#region src/deploy/docker.ts
22
+ const logger$3 = output;
23
+ /**
24
+ * The id the Dockerfile templates mount the encrypted credentials under:
25
+ * `RUN --mount=type=secret,id=gkm_credentials`.
26
+ */
27
+ const CREDENTIALS_SECRET_ID = "gkm_credentials";
28
+ /**
29
+ * Get the full image reference
30
+ */
31
+ function getImageRef(registry, imageName, tag) {
32
+ if (registry) return `${registry}/${imageName}:${tag}`;
33
+ return `${imageName}:${tag}`;
34
+ }
35
+ /**
36
+ * The `docker build` argv for an image.
37
+ *
38
+ * One element per value, so nothing in a ref or a build arg is read by a
39
+ * shell, and `--opt=value` rather than `--opt value`, so a value that starts
40
+ * with `-` cannot be taken for one of docker's own flags.
41
+ *
42
+ * @internal Exported for testing
43
+ */
44
+ function dockerBuildArgs(options) {
45
+ const { dockerfilePath, imageRef, buildArgs = [], credentialsFile } = options;
46
+ return [
47
+ "build",
48
+ "--platform=linux/amd64",
49
+ `--file=${dockerfilePath}`,
50
+ `--tag=${imageRef}`,
51
+ ...buildArgs.map((arg) => `--build-arg=${arg}`),
52
+ ...credentialsFile ? [`--secret=id=${CREDENTIALS_SECRET_ID},src=${credentialsFile}`] : [],
53
+ "."
54
+ ];
55
+ }
56
+ /**
57
+ * The build arg that names which credentials an image embeds: a hash of the
58
+ * ciphertext, which is not a secret. A BuildKit secret is no part of the
59
+ * build cache's key, so without it a rebuild with credentials encrypted under
60
+ * a new key would reuse the layer that embedded the old ones.
61
+ */
62
+ function credentialsBuildArg(credentials) {
63
+ return `GKM_CIPHERTEXT_HASH=${createHash("sha256").update(`${credentials.encrypted}\n${credentials.iv}`).digest("hex").slice(0, 16)}`;
64
+ }
65
+ /** The secret file's content: ciphertext, then IV, one per line. */
66
+ function credentialsFileContent(credentials) {
67
+ return `${credentials.encrypted}\n${credentials.iv}\n`;
68
+ }
69
+ /**
70
+ * Write the encrypted credentials where `docker build --secret` reads them.
71
+ *
72
+ * Two lines — ciphertext, then IV — so a template can split them with `sed`
73
+ * in any base image. Owner-only, in a directory of its own, and the returned
74
+ * cleanup removes both whatever the build did.
75
+ *
76
+ * @internal Exported for testing
77
+ */
78
+ async function writeCredentialsFile(credentials) {
79
+ const dir = await mkdtemp(join(tmpdir(), "gkm-credentials-"));
80
+ const path = join(dir, CREDENTIALS_SECRET_ID);
81
+ await writeFile(path, credentialsFileContent(credentials), { mode: 384 });
82
+ await chmod(path, 384);
83
+ return {
84
+ path,
85
+ cleanup: () => rm(dir, {
86
+ recursive: true,
87
+ force: true
88
+ })
89
+ };
90
+ }
91
+ /**
92
+ * Build Docker image
93
+ * @param imageRef - Full image reference (registry/name:tag)
94
+ * @param buildArgs - Build arguments to pass to docker build
95
+ * @param credentials - Encrypted credentials, passed as a build secret
96
+ */
97
+ async function buildImage(imageRef, buildArgs, credentials, { cwd, dockerfile, signal, stdio }) {
98
+ logger$3.log(`\n🔨 Building Docker image: ${imageRef}`);
99
+ logger$3.log(" Generating Dockerfile...");
100
+ const { buildRoot } = await dockerCommand({ cwd });
101
+ const dockerfilePath = relative(buildRoot, dockerfile);
102
+ const secret = credentials ? await writeCredentialsFile(credentials) : void 0;
103
+ try {
104
+ await run("docker", dockerBuildArgs({
105
+ dockerfilePath,
106
+ imageRef,
107
+ buildArgs: [...buildArgs ?? [], ...credentials ? [credentialsBuildArg(credentials)] : []],
108
+ credentialsFile: secret?.path
109
+ }), {
110
+ cwd: buildRoot,
111
+ env: {
112
+ ...process.env,
113
+ DOCKER_BUILDKIT: "1"
114
+ },
115
+ ...signal ? { signal } : {},
116
+ ...stdio ? { stdio } : {}
117
+ });
118
+ logger$3.log(`✅ Image built: ${imageRef}`);
119
+ } catch (error) {
120
+ throw new DockerBuildFailed(imageRef, error);
121
+ } finally {
122
+ await secret?.cleanup();
123
+ }
124
+ }
125
+ /**
126
+ * Push Docker image to registry
127
+ */
128
+ async function pushImage(imageRef, { cwd, signal, stdio }) {
129
+ logger$3.log(`\n☁️ Pushing image: ${imageRef}`);
130
+ try {
131
+ await run("docker", ["push", imageRef], {
132
+ cwd,
133
+ ...signal ? { signal } : {},
134
+ ...stdio ? { stdio } : {}
135
+ });
136
+ logger$3.log(`✅ Image pushed: ${imageRef}`);
137
+ } catch (error) {
138
+ throw new DockerPushFailed(imageRef, error);
139
+ }
140
+ }
141
+ /**
142
+ * The digest the registry gave a pushed image, `sha256:…`.
143
+ *
144
+ * A tag can be pushed over — by the next deploy, or by anything else that
145
+ * shares the repository — and the digest is what says which image a stage
146
+ * actually ran. `RepoDigests` has one entry per repository the image was
147
+ * pushed to, so the one for this ref's repository is picked by name.
148
+ *
149
+ * @internal Exported for testing
150
+ */
151
+ async function pushedDigest(imageRef, { cwd, signal } = { cwd: process.cwd() }) {
152
+ const repository = imageRef.split("@")[0].replace(/:[\w][\w.-]*$/, "");
153
+ const output = await runOutput("docker", [
154
+ "image",
155
+ "inspect",
156
+ "--format={{json .RepoDigests}}",
157
+ imageRef
158
+ ], {
159
+ cwd,
160
+ ...signal ? { signal } : {}
161
+ });
162
+ let digests;
163
+ try {
164
+ digests = JSON.parse(output.trim() || "[]");
165
+ } catch {
166
+ return;
167
+ }
168
+ if (!Array.isArray(digests)) return void 0;
169
+ return digests.find((entry) => typeof entry === "string" && entry.startsWith(`${repository}@`))?.slice(repository.length + 1);
170
+ }
171
+ /**
172
+ * Deploy using Docker (build and optionally push image)
173
+ */
174
+ async function deployDocker(options) {
175
+ const { stage, tag, skipPush, masterKey, config, buildArgs, credentials } = options;
176
+ const imageName = config.imageName;
177
+ const imageRef = validateImageRef(getImageRef(config.registry, imageName, tag));
178
+ const cwd = options.cwd ?? process.cwd();
179
+ const docker = {
180
+ cwd,
181
+ dockerfile: join(cwd, options.dockerfile ?? dockerfileOf(config.appName ?? imageName, options.appPath ?? ".")),
182
+ ...options.signal ? { signal: options.signal } : {},
183
+ ...options.stdio ? { stdio: options.stdio } : {}
184
+ };
185
+ await buildImage(imageRef, buildArgs, credentials, docker);
186
+ let digest;
187
+ if (!skipPush) {
188
+ if (!config.registry) logger$3.warn("\n⚠️ No registry configured. Use --skip-push or configure docker.registry in gkm.config.ts");
189
+ else {
190
+ await pushImage(imageRef, docker);
191
+ digest = await pushedDigest(imageRef, docker);
192
+ }
193
+ }
194
+ logger$3.log("\n✅ Docker deployment ready!");
195
+ logger$3.log(`\n📋 Deployment details:`);
196
+ logger$3.log(` Image: ${imageRef}`);
197
+ logger$3.log(` Stage: ${stage}`);
198
+ if (masterKey) logger$3.log(`\n🔐 Run the container with GKM_MASTER_KEY set to the key with fingerprint ${keyFingerprint(masterKey)}.`);
199
+ return {
200
+ imageRef,
201
+ ...digest ? { digest } : {},
202
+ masterKey
203
+ };
204
+ }
205
+ //#endregion
18
206
  //#region src/deploy/ownership.ts
19
207
  /**
20
208
  * Which Dokploy project a deploy is allowed to deploy into.
@@ -3204,4 +3392,4 @@ const MOBILE_SKIP_REASON = "deploys via its framework toolchain";
3204
3392
  //#endregion
3205
3393
  export { RegistryNotConfigured as _, dokployResult as a, releaseDokploy as c, validateDokploy as d, verifyDokploy as f, RegistryAmbiguous as g, HealthCheckTimedOut as h, dokployApi as i, restoreImage as l, DeployMigrationsFailed as m, FrontendDeployFailed as n, planDokploy as o, verifySettings as p, MissingEnvVars as r, provisionDokploy as s, BackendDeployFailed as t, rollbackDokploy as u, RegistryNotFound as v, ProjectNotOwned as y };
3206
3394
 
3207
- //# sourceMappingURL=engine-B37qBO5W.mjs.map
3395
+ //# sourceMappingURL=engine-CmozkHxq.mjs.map