@geekmidas/cli 10.0.0-alpha.175 → 10.0.0-alpha.177

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 (179) hide show
  1. package/dist/{GoDaddyProvider-BtnO8_pk.mjs → GoDaddyProvider-B5Vp3PFa.mjs} +2 -2
  2. package/dist/{GoDaddyProvider-BtnO8_pk.mjs.map → GoDaddyProvider-B5Vp3PFa.mjs.map} +1 -1
  3. package/dist/{GoDaddyProvider-BHNFin4Y.cjs → GoDaddyProvider-Bos-4m3b.cjs} +2 -2
  4. package/dist/{GoDaddyProvider-BHNFin4Y.cjs.map → GoDaddyProvider-Bos-4m3b.cjs.map} +1 -1
  5. package/dist/{HostingerProvider-Cq7QeLKO.mjs → HostingerProvider-DCg0rGXq.mjs} +2 -2
  6. package/dist/{HostingerProvider-Cq7QeLKO.mjs.map → HostingerProvider-DCg0rGXq.mjs.map} +1 -1
  7. package/dist/{HostingerProvider-Bbb1_aKS.cjs → HostingerProvider-jar5l8ck.cjs} +2 -2
  8. package/dist/{HostingerProvider-Bbb1_aKS.cjs.map → HostingerProvider-jar5l8ck.cjs.map} +1 -1
  9. package/dist/{LegacyStateStore-r8xgq8Vv.mjs → LegacyStateStore-mUqUP71P.mjs} +2 -2
  10. package/dist/{LegacyStateStore-r8xgq8Vv.mjs.map → LegacyStateStore-mUqUP71P.mjs.map} +1 -1
  11. package/dist/{LegacyStateStore-CbuqTCMX.cjs → LegacyStateStore-qUlI9q4J.cjs} +2 -2
  12. package/dist/{LegacyStateStore-CbuqTCMX.cjs.map → LegacyStateStore-qUlI9q4J.cjs.map} +1 -1
  13. package/dist/{LocalStateStore-BMnidUp_.mjs → LocalStateStore-B3BGSP9X.mjs} +2 -2
  14. package/dist/{LocalStateStore-BMnidUp_.mjs.map → LocalStateStore-B3BGSP9X.mjs.map} +1 -1
  15. package/dist/{LocalStateStore-B6_1oDJ_.cjs → LocalStateStore-C8KQoWQ4.cjs} +2 -2
  16. package/dist/{LocalStateStore-B6_1oDJ_.cjs.map → LocalStateStore-C8KQoWQ4.cjs.map} +1 -1
  17. package/dist/{S3StateStore-Dq12263A.cjs → S3StateStore-Bb_pR9qR.cjs} +4 -4
  18. package/dist/{S3StateStore-Dq12263A.cjs.map → S3StateStore-Bb_pR9qR.cjs.map} +1 -1
  19. package/dist/{S3StateStore-CHXicp6D.mjs → S3StateStore-BrXQgGqq.mjs} +4 -4
  20. package/dist/{S3StateStore-CHXicp6D.mjs.map → S3StateStore-BrXQgGqq.mjs.map} +1 -1
  21. package/dist/{SSMStateStore-BAMceTz-.mjs → SSMStateStore-B8Opl_On.mjs} +2 -2
  22. package/dist/{SSMStateStore-BAMceTz-.mjs.map → SSMStateStore-B8Opl_On.mjs.map} +1 -1
  23. package/dist/{SSMStateStore-D8HJ3FU9.cjs → SSMStateStore-BY_I0tyB.cjs} +2 -2
  24. package/dist/{SSMStateStore-D8HJ3FU9.cjs.map → SSMStateStore-BY_I0tyB.cjs.map} +1 -1
  25. package/dist/{add-QkB0jIec.cjs → add-DGmk0dXQ.cjs} +4 -4
  26. package/dist/{add-QkB0jIec.cjs.map → add-DGmk0dXQ.cjs.map} +1 -1
  27. package/dist/{add-BK_Mb6D_.mjs → add-DLOigaYm.mjs} +4 -4
  28. package/dist/{add-BK_Mb6D_.mjs.map → add-DLOigaYm.mjs.map} +1 -1
  29. package/dist/{apps-D83caHjP.cjs → apps-CyfjJh6v.cjs} +9 -3
  30. package/dist/apps-CyfjJh6v.cjs.map +1 -0
  31. package/dist/{apps-DpyJvU00.mjs → apps-G1Q2j-fs.mjs} +4 -4
  32. package/dist/apps-G1Q2j-fs.mjs.map +1 -0
  33. package/dist/{bundler-CgCVGuji.mjs → bundler-8pVRVXVZ.mjs} +6 -6
  34. package/dist/{bundler-CgCVGuji.mjs.map → bundler-8pVRVXVZ.mjs.map} +1 -1
  35. package/dist/{bundler-DTHUOAAV.cjs → bundler-y6p6zWLI.cjs} +6 -6
  36. package/dist/{bundler-DTHUOAAV.cjs.map → bundler-y6p6zWLI.cjs.map} +1 -1
  37. package/dist/{cli-B2XyVbUz.mjs → cli-SNWyT6q5.mjs} +4 -4
  38. package/dist/{cli-B2XyVbUz.mjs.map → cli-SNWyT6q5.mjs.map} +1 -1
  39. package/dist/{cli-Cx1tIFan.cjs → cli-_yRVgYDB.cjs} +4 -4
  40. package/dist/{cli-Cx1tIFan.cjs.map → cli-_yRVgYDB.cjs.map} +1 -1
  41. package/dist/{compose-DVr47TbA.cjs → compose-CNDZELiP.cjs} +4 -4
  42. package/dist/{compose-DVr47TbA.cjs.map → compose-CNDZELiP.cjs.map} +1 -1
  43. package/dist/{compose-B9uSqCxY.cjs → compose-CNEv5lGg.cjs} +221 -16
  44. package/dist/compose-CNEv5lGg.cjs.map +1 -0
  45. package/dist/{compose-j0SE-0EG.mjs → compose-D_shZ1mI.mjs} +4 -4
  46. package/dist/{compose-j0SE-0EG.mjs.map → compose-D_shZ1mI.mjs.map} +1 -1
  47. package/dist/{compose-CbXGx1_z.mjs → compose-X-ZypRKX.mjs} +207 -14
  48. package/dist/compose-X-ZypRKX.mjs.map +1 -0
  49. package/dist/dbTunnel-B3TEZuFY.mjs +154 -0
  50. package/dist/dbTunnel-B3TEZuFY.mjs.map +1 -0
  51. package/dist/dbTunnel-Cw8zODrt.cjs +154 -0
  52. package/dist/dbTunnel-Cw8zODrt.cjs.map +1 -0
  53. package/dist/deploy/public.cjs +10 -10
  54. package/dist/deploy/public.d.cts.map +1 -1
  55. package/dist/deploy/public.d.mts.map +1 -1
  56. package/dist/deploy/public.mjs +10 -10
  57. package/dist/{deploy-DDWnWXnA.mjs → deploy-DFul9UAF.mjs} +16 -15
  58. package/dist/{deploy-DDWnWXnA.mjs.map → deploy-DFul9UAF.mjs.map} +1 -1
  59. package/dist/{deploy-qdWn2-m9.cjs → deploy-OPNZJCUm.cjs} +16 -15
  60. package/dist/{deploy-qdWn2-m9.cjs.map → deploy-OPNZJCUm.cjs.map} +1 -1
  61. package/dist/{destroy-DvJEbs9P.mjs → destroy-C9c6S9oI.mjs} +7 -7
  62. package/dist/{destroy-DvJEbs9P.mjs.map → destroy-C9c6S9oI.mjs.map} +1 -1
  63. package/dist/{destroy-B28Zwbzr.cjs → destroy-DbOw1hTz.cjs} +7 -7
  64. package/dist/{destroy-B28Zwbzr.cjs.map → destroy-DbOw1hTz.cjs.map} +1 -1
  65. package/dist/{dns-BxgfpQWO.mjs → dns-BM2DE6jt.mjs} +21 -7
  66. package/dist/dns-BM2DE6jt.mjs.map +1 -0
  67. package/dist/{dns-CiUCbOXH.cjs → dns-_WH7kO9x.cjs} +26 -6
  68. package/dist/dns-_WH7kO9x.cjs.map +1 -0
  69. package/dist/{docker-Dcsqf_NA.mjs → docker-DCtw3rjP.mjs} +4 -4
  70. package/dist/{docker-Dcsqf_NA.mjs.map → docker-DCtw3rjP.mjs.map} +1 -1
  71. package/dist/{docker-Coy1O-IN.cjs → docker-wE0zDnhu.cjs} +4 -4
  72. package/dist/{docker-Coy1O-IN.cjs.map → docker-wE0zDnhu.cjs.map} +1 -1
  73. package/dist/{dokploy-Df4oDdAu.cjs → dokploy-CCDXCzTa.cjs} +2 -2
  74. package/dist/{dokploy-Df4oDdAu.cjs.map → dokploy-CCDXCzTa.cjs.map} +1 -1
  75. package/dist/{dokploy-Dohi7fuh.mjs → dokploy-DeXtesSz.mjs} +2 -2
  76. package/dist/{dokploy-Dohi7fuh.mjs.map → dokploy-DeXtesSz.mjs.map} +1 -1
  77. package/dist/{eas-B8t0Ipgt.cjs → eas-Ct9AE935.cjs} +2 -2
  78. package/dist/{eas-B8t0Ipgt.cjs.map → eas-Ct9AE935.cjs.map} +1 -1
  79. package/dist/{eas-FLjCtoiB.mjs → eas-DfJbfJOE.mjs} +2 -2
  80. package/dist/{eas-FLjCtoiB.mjs.map → eas-DfJbfJOE.mjs.map} +1 -1
  81. package/dist/{encryption-DlID0xqU.mjs → encryption-BgLW4Tb2.mjs} +2 -2
  82. package/dist/{encryption-DlID0xqU.mjs.map → encryption-BgLW4Tb2.mjs.map} +1 -1
  83. package/dist/{encryption-CEiJrhOd.cjs → encryption-DDkv3EFD.cjs} +2 -2
  84. package/dist/{encryption-CEiJrhOd.cjs.map → encryption-DDkv3EFD.cjs.map} +1 -1
  85. package/dist/{engine-Ci62MZrE.cjs → engine-CINx5LA_.cjs} +10 -9
  86. package/dist/engine-CINx5LA_.cjs.map +1 -0
  87. package/dist/{engine-zE2sQUNS.mjs → engine-CKkCaRAd.mjs} +10 -9
  88. package/dist/engine-CKkCaRAd.mjs.map +1 -0
  89. package/dist/{github-Di-u6VhX.mjs → github-BORbm5Kn.mjs} +19 -10
  90. package/dist/github-BORbm5Kn.mjs.map +1 -0
  91. package/dist/{github-DXBTTGl3.cjs → github-DsmDwi7a.cjs} +19 -10
  92. package/dist/github-DsmDwi7a.cjs.map +1 -0
  93. package/dist/{googlePlay-Crx8XG3Z.mjs → googlePlay-Dk53obw3.mjs} +4 -4
  94. package/dist/{googlePlay-Crx8XG3Z.mjs.map → googlePlay-Dk53obw3.mjs.map} +1 -1
  95. package/dist/{googlePlay-C3ubCMrO.cjs → googlePlay-bh7gEiz4.cjs} +4 -4
  96. package/dist/{googlePlay-C3ubCMrO.cjs.map → googlePlay-bh7gEiz4.cjs.map} +1 -1
  97. package/dist/index.cjs +184 -83
  98. package/dist/index.cjs.map +1 -1
  99. package/dist/index.mjs +185 -84
  100. package/dist/index.mjs.map +1 -1
  101. package/dist/{local-DyOeF-qR.cjs → local-BObpR_rL.cjs} +2 -2
  102. package/dist/{local-DyOeF-qR.cjs.map → local-BObpR_rL.cjs.map} +1 -1
  103. package/dist/{local-pYpQVNII.mjs → local-CpSldDSi.mjs} +2 -2
  104. package/dist/{local-pYpQVNII.mjs.map → local-CpSldDSi.mjs.map} +1 -1
  105. package/dist/{migrate-DXW9w2DK.cjs → migrate-B-O5VhwA.cjs} +4 -4
  106. package/dist/{migrate-DXW9w2DK.cjs.map → migrate-B-O5VhwA.cjs.map} +1 -1
  107. package/dist/{migrate-vXdW9TR3.cjs → migrate-BClTCUdZ.cjs} +2 -2
  108. package/dist/{migrate-vXdW9TR3.cjs.map → migrate-BClTCUdZ.cjs.map} +1 -1
  109. package/dist/{migrate-BHvFlwDQ.mjs → migrate-ChURsPXl.mjs} +2 -2
  110. package/dist/{migrate-BHvFlwDQ.mjs.map → migrate-ChURsPXl.mjs.map} +1 -1
  111. package/dist/{migrate-CnH3PLzA.mjs → migrate-FatDUatE.mjs} +4 -4
  112. package/dist/{migrate-CnH3PLzA.mjs.map → migrate-FatDUatE.mjs.map} +1 -1
  113. package/dist/{notes-DuPsUdr4.mjs → notes-BwBGVMYR.mjs} +2 -2
  114. package/dist/{notes-DuPsUdr4.mjs.map → notes-BwBGVMYR.mjs.map} +1 -1
  115. package/dist/{notes-BOQGsAVb.cjs → notes-jaDD8Vda.cjs} +2 -2
  116. package/dist/{notes-BOQGsAVb.cjs.map → notes-jaDD8Vda.cjs.map} +1 -1
  117. package/dist/{projectBucket-CP6rkXdo.cjs → projectBucket-CEDRY3N2.cjs} +2 -2
  118. package/dist/{projectBucket-CP6rkXdo.cjs.map → projectBucket-CEDRY3N2.cjs.map} +1 -1
  119. package/dist/{projectBucket-o-_7Hgxt.mjs → projectBucket-CgGk1Nd_.mjs} +2 -2
  120. package/dist/{projectBucket-o-_7Hgxt.mjs.map → projectBucket-CgGk1Nd_.mjs.map} +1 -1
  121. package/dist/{publish-C9_gTOGU.mjs → publish-CG9ooEnS.mjs} +2 -2
  122. package/dist/{publish-C9_gTOGU.mjs.map → publish-CG9ooEnS.mjs.map} +1 -1
  123. package/dist/{publish-DbJ7hMQ_.cjs → publish-oCdqimOZ.cjs} +2 -2
  124. package/dist/{publish-DbJ7hMQ_.cjs.map → publish-oCdqimOZ.cjs.map} +1 -1
  125. package/dist/{resolve-nTuLxira.mjs → resolve-DGSN4f-J.mjs} +4 -4
  126. package/dist/{resolve-nTuLxira.mjs.map → resolve-DGSN4f-J.mjs.map} +1 -1
  127. package/dist/{resolve-4ME0CRVM.cjs → resolve-XaHTbLJ0.cjs} +4 -4
  128. package/dist/{resolve-4ME0CRVM.cjs.map → resolve-XaHTbLJ0.cjs.map} +1 -1
  129. package/dist/{rollback-CAfhleLK.cjs → rollback-DQl_hh1s.cjs} +5 -5
  130. package/dist/{rollback-CAfhleLK.cjs.map → rollback-DQl_hh1s.cjs.map} +1 -1
  131. package/dist/{rollback-CXy-4gxa.mjs → rollback-xiYg-iz_.mjs} +5 -5
  132. package/dist/{rollback-CXy-4gxa.mjs.map → rollback-xiYg-iz_.mjs.map} +1 -1
  133. package/dist/{s3-C90gsHUn.cjs → s3-CB4ekfza.cjs} +2 -2
  134. package/dist/{s3-C90gsHUn.cjs.map → s3-CB4ekfza.cjs.map} +1 -1
  135. package/dist/{s3-DcIf5bPO.mjs → s3-CQqDhnF-.mjs} +2 -2
  136. package/dist/{s3-DcIf5bPO.mjs.map → s3-CQqDhnF-.mjs.map} +1 -1
  137. package/dist/{serverSetup-4oc_a1T5.cjs → serverSetup-B0ZqkKcY.cjs} +5 -5
  138. package/dist/{serverSetup-4oc_a1T5.cjs.map → serverSetup-B0ZqkKcY.cjs.map} +1 -1
  139. package/dist/{serverSetup-BmmkcyBv.mjs → serverSetup-DWUQ_sQR.mjs} +5 -5
  140. package/dist/{serverSetup-BmmkcyBv.mjs.map → serverSetup-DWUQ_sQR.mjs.map} +1 -1
  141. package/dist/{sniffer-FdJ9urOA.cjs → sniffer-BVmzTN9C.cjs} +6 -6
  142. package/dist/{sniffer-FdJ9urOA.cjs.map → sniffer-BVmzTN9C.cjs.map} +1 -1
  143. package/dist/{sniffer-Cawd1GeY.mjs → sniffer-CkSC8MZ9.mjs} +6 -6
  144. package/dist/{sniffer-Cawd1GeY.mjs.map → sniffer-CkSC8MZ9.mjs.map} +1 -1
  145. package/dist/{snsSubscriptions-Cm-pdWyW.mjs → snsSubscriptions-CdbBWvzg.mjs} +3 -3
  146. package/dist/{snsSubscriptions-Cm-pdWyW.mjs.map → snsSubscriptions-CdbBWvzg.mjs.map} +1 -1
  147. package/dist/{snsSubscriptions-DclU57O7.cjs → snsSubscriptions-DOUaur2w.cjs} +3 -3
  148. package/dist/{snsSubscriptions-DclU57O7.cjs.map → snsSubscriptions-DOUaur2w.cjs.map} +1 -1
  149. package/dist/{sst-D6Kt9gDS.cjs → sst-3iKqe9vk.cjs} +4 -4
  150. package/dist/{sst-D6Kt9gDS.cjs.map → sst-3iKqe9vk.cjs.map} +1 -1
  151. package/dist/{sst-BiOWTOUg.mjs → sst-r4pOOAkf.mjs} +4 -4
  152. package/dist/{sst-BiOWTOUg.mjs.map → sst-r4pOOAkf.mjs.map} +1 -1
  153. package/dist/{stack-BmjNDZiJ.cjs → stack-DUADq62v.cjs} +20 -190
  154. package/dist/stack-DUADq62v.cjs.map +1 -0
  155. package/dist/{stack-DZn7Yr8z.mjs → stack-LelP4jv7.mjs} +21 -161
  156. package/dist/stack-LelP4jv7.mjs.map +1 -0
  157. package/dist/{stage-tdH9m6Wf.cjs → stage-BwY2DLIb.cjs} +24 -5
  158. package/dist/{stage-tdH9m6Wf.cjs.map → stage-BwY2DLIb.cjs.map} +1 -1
  159. package/dist/{stage-CoUrlN-W.mjs → stage-DQuJRU3S.mjs} +7 -6
  160. package/dist/{stage-CoUrlN-W.mjs.map → stage-DQuJRU3S.mjs.map} +1 -1
  161. package/dist/target/public.cjs +1 -1
  162. package/dist/target/public.mjs +1 -1
  163. package/dist/{terminal-BI7b8BdH.mjs → terminal-BTX6f2XO.mjs} +2 -2
  164. package/dist/{terminal-BI7b8BdH.mjs.map → terminal-BTX6f2XO.mjs.map} +1 -1
  165. package/dist/{terminal-iL0e-c9K.cjs → terminal-EeBAmc7P.cjs} +2 -2
  166. package/dist/{terminal-iL0e-c9K.cjs.map → terminal-EeBAmc7P.cjs.map} +1 -1
  167. package/package.json +15 -15
  168. package/dist/apps-D83caHjP.cjs.map +0 -1
  169. package/dist/apps-DpyJvU00.mjs.map +0 -1
  170. package/dist/compose-B9uSqCxY.cjs.map +0 -1
  171. package/dist/compose-CbXGx1_z.mjs.map +0 -1
  172. package/dist/dns-BxgfpQWO.mjs.map +0 -1
  173. package/dist/dns-CiUCbOXH.cjs.map +0 -1
  174. package/dist/engine-Ci62MZrE.cjs.map +0 -1
  175. package/dist/engine-zE2sQUNS.mjs.map +0 -1
  176. package/dist/github-DXBTTGl3.cjs.map +0 -1
  177. package/dist/github-Di-u6VhX.mjs.map +0 -1
  178. package/dist/stack-BmjNDZiJ.cjs.map +0 -1
  179. package/dist/stack-DZn7Yr8z.mjs.map +0 -1
@@ -1,15 +1,15 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
2
2
  const require_errors = require("./errors-DMC4Umsb.cjs");
3
- const require_dns = require("./dns-CiUCbOXH.cjs");
3
+ const require_dns = require("./dns-_WH7kO9x.cjs");
4
4
  const require_workspace = require("./workspace-DirP2-ed.cjs");
5
- const require_apps = require("./apps-D83caHjP.cjs");
5
+ const require_apps = require("./apps-CyfjJh6v.cjs");
6
6
  const require_define = require("./define-crmMcXFS.cjs");
7
- const require_compose = require("./compose-DVr47TbA.cjs");
7
+ const require_compose = require("./compose-CNDZELiP.cjs");
8
8
  const require_drivers = require("./drivers-DP7__dJX.cjs");
9
9
  const require_discover = require("./discover-39VKSE2i.cjs");
10
- const require_stack = require("./stack-BmjNDZiJ.cjs");
11
- const require_docker = require("./docker-Coy1O-IN.cjs");
12
- const require_snsSubscriptions = require("./snsSubscriptions-DclU57O7.cjs");
10
+ const require_stack = require("./stack-DUADq62v.cjs");
11
+ const require_docker = require("./docker-wE0zDnhu.cjs");
12
+ const require_snsSubscriptions = require("./snsSubscriptions-DOUaur2w.cjs");
13
13
  const require_seeds = require("./seeds-Bc3niNVb.cjs");
14
14
  const require_databases = require("./databases-BOuB-zg4.cjs");
15
15
  let node_path = require("node:path");
@@ -466,15 +466,31 @@ function dockerExit(args, options = {}) {
466
466
  env: options.env ?? process.env,
467
467
  shell: false
468
468
  });
469
+ let stdinFailed;
469
470
  if (options.stdin && child.stdin) {
470
- options.stdin.on("error", (error) => child.stdin?.destroy(error));
471
+ options.stdin.on("error", (error) => {
472
+ stdinFailed = error;
473
+ child.stdin?.destroy(error);
474
+ });
471
475
  child.stdin.on("error", () => {});
472
476
  options.stdin.pipe(child.stdin);
473
477
  }
474
478
  child.on("error", reject);
475
- child.on("close", (code) => resolve(code ?? 1));
479
+ child.on("close", (code) => {
480
+ if (stdinFailed) reject(new StdinNotDelivered(stdinFailed));
481
+ else resolve(code ?? 1);
482
+ });
476
483
  });
477
484
  }
485
+ /** What a command run with {@link dockerExit} read from stdin failed partway. */
486
+ var StdinNotDelivered = class extends require_errors.GkmError {
487
+ reason;
488
+ constructor(reason) {
489
+ super(`The input to docker stopped before its end (${reason.message}), so the command only read part of it. Run it again.`);
490
+ this.reason = reason;
491
+ this.name = "StdinNotDelivered";
492
+ }
493
+ };
478
494
  /** `docker stop` failed for some of a project's containers. */
479
495
  var ContainersNotStopped = class extends require_errors.GkmError {
480
496
  project;
@@ -1114,6 +1130,183 @@ async function hostedZoneId(route53, zone) {
1114
1130
  return HostedZones.find((z) => z.Name === name)?.Id?.replace("/hostedzone/", "");
1115
1131
  }
1116
1132
  //#endregion
1133
+ //#region src/compose/images.ts
1134
+ /**
1135
+ * Which image each app runs — and, for a tag, whether every one exists.
1136
+ *
1137
+ * A tag is a release's identity: `--tag=v1.4.0` means the images CI pushed as
1138
+ * v1.4.0, and nothing else. So a stack is never half rolled out: every app's
1139
+ * image is asked of the registry before anything is pulled or the running
1140
+ * stack is touched, and one missing image stops the whole run naming every
1141
+ * one that is missing. Nor is a missing image quietly built instead — a build
1142
+ * of whatever is checked out here is not the release the tag names.
1143
+ */
1144
+ /** Images a tag names that the registry does not have. */
1145
+ var ImageTagNotFound = class extends require_errors.GkmError {
1146
+ tag;
1147
+ refs;
1148
+ constructor(tag, refs) {
1149
+ super(`The registry has no image for ${refs.length === 1 ? "this app" : `${refs.length} apps`} at '${tag}':\n` + refs.map((ref) => ` - ${ref}`).join("\n") + `\nNothing was pulled or started. Push '${tag}' for every app from CI, pick a tag that exists, or run without --tag to build from this checkout.`);
1150
+ this.tag = tag;
1151
+ this.refs = refs;
1152
+ this.name = "ImageTagNotFound";
1153
+ }
1154
+ };
1155
+ /** The registry did not answer, or did not let this machine in. */
1156
+ var RegistryUnreachable = class extends require_errors.GkmError {
1157
+ ref;
1158
+ detail;
1159
+ constructor(ref, detail) {
1160
+ super(`Could not ask the registry about ${ref}: ${detail || "no answer"}\nNothing was pulled or started. Check the registry is reachable and that this machine is logged in to it (\`docker login <registry>\`).`);
1161
+ this.ref = ref;
1162
+ this.detail = detail;
1163
+ this.name = "RegistryUnreachable";
1164
+ }
1165
+ };
1166
+ /**
1167
+ * A pinned image whose digest the registry would not give, while its tag it
1168
+ * would: the tag now names another image than the one the release pinned.
1169
+ *
1170
+ * Not a login problem — the registry answered for the tag. The tag was pushed
1171
+ * again (by another build of it), and the pinned image is gone, or cannot be
1172
+ * read, by its digest.
1173
+ */
1174
+ var PinnedImageMoved = class extends require_errors.GkmError {
1175
+ ref;
1176
+ detail;
1177
+ constructor(ref, detail) {
1178
+ const [tagged, digest] = ref.split("@");
1179
+ super(`${tagged} is in the registry, but it resolves to a different image than the pinned ${digest}, and the registry would not give that digest${detail ? `: ${detail}` : ""}\nNothing was pulled or started. The tag was pushed again after this release's push; deploy with the digests file of a push whose images are still in the registry, or push this release again.`);
1180
+ this.ref = ref;
1181
+ this.detail = detail;
1182
+ this.name = "PinnedImageMoved";
1183
+ }
1184
+ };
1185
+ /**
1186
+ * The ref an image is asked of the registry by: a pinned one by its digest
1187
+ * alone (`<image>@sha256:…`), so a tag moved since the push cannot change the
1188
+ * answer; any other by its tag.
1189
+ */
1190
+ function lookupRef(ref) {
1191
+ const [tagged, digest] = ref.split("@");
1192
+ if (!digest) return ref;
1193
+ return `${tagged.replace(/:[\w][\w.-]*$/, "")}@${digest}`;
1194
+ }
1195
+ /**
1196
+ * Assert every image exists, before anything else happens.
1197
+ *
1198
+ * Asked all at once and reported all at once: a release missing two images is
1199
+ * one problem with two names, and finding the second only after fixing the
1200
+ * first is a slower way to learn the same thing.
1201
+ *
1202
+ * A pinned image is asked for by its digest. When the registry will not give
1203
+ * it, its tag is asked too: a tag that answers means the registry is reachable
1204
+ * and the tag names another image, and that is what is reported.
1205
+ *
1206
+ * @throws {PinnedImageMoved} when a pinned digest fails and its tag answers
1207
+ * @throws {RegistryUnreachable} when the registry cannot say
1208
+ * @throws {ImageTagNotFound} listing every missing image
1209
+ */
1210
+ async function assertImagesExist(docker, tag, images) {
1211
+ const lookups = await Promise.all(images.map(async (image) => ({
1212
+ image,
1213
+ lookup: await docker.lookup(lookupRef(image.ref))
1214
+ })));
1215
+ for (const { image, lookup } of lookups) {
1216
+ if (lookup.status === "found" || !image.ref.includes("@")) continue;
1217
+ if ((await docker.lookup(image.ref.split("@")[0])).status === "found") throw new PinnedImageMoved(image.ref, lookup.status === "unreachable" ? lookup.detail : "");
1218
+ }
1219
+ for (const { lookup } of lookups) if (lookup.status === "unreachable") throw new RegistryUnreachable(lookup.ref, lookup.detail);
1220
+ const missing = lookups.filter(({ lookup }) => lookup.status === "missing").map(({ image }) => image.ref);
1221
+ if (missing.length > 0) throw new ImageTagNotFound(tag, missing);
1222
+ }
1223
+ /**
1224
+ * A push or a pull with no `deploy.registry` to push to or pull from.
1225
+ *
1226
+ * Without one an image is named `<namespace>/<project>-<app>:<tag>`, which
1227
+ * Docker resolves to Docker Hub — so a release would be pushed to, or pulled
1228
+ * from, somebody else's account. It is never a fallback.
1229
+ */
1230
+ var RegistryRequired = class extends require_errors.GkmError {
1231
+ operation;
1232
+ ref;
1233
+ constructor(operation, ref) {
1234
+ super(`${operation === "push" ? "Pushing" : "Pulling"} images needs a registry, and gkm.config.ts sets no deploy.registry: '${ref}' would be ${operation === "push" ? "pushed to" : "pulled from"} Docker Hub. Set deploy.registry (e.g. registry: 'ghcr.io/acme') in gkm.config.ts.` + (operation === "pull" ? " To run images built here instead, pass --build." : ""));
1235
+ this.operation = operation;
1236
+ this.ref = ref;
1237
+ this.name = "RegistryRequired";
1238
+ }
1239
+ };
1240
+ /** An image pinned to its digest: `<ref>@sha256:…`. */
1241
+ function pinnedRef(ref, digest) {
1242
+ return `${ref.split("@")[0]}@${digest}`;
1243
+ }
1244
+ /** A digests file with no entry for an app the stack runs. */
1245
+ var ImageDigestMissing = class extends require_errors.GkmError {
1246
+ file;
1247
+ apps;
1248
+ constructor(file, apps) {
1249
+ super(`${file} pins no digest for ${apps.join(", ")}. Use the file the same release's \`gkm compose --build --push --digests-file\` wrote, or run without --digests-file to pull by tag.`);
1250
+ this.file = file;
1251
+ this.apps = apps;
1252
+ this.name = "ImageDigestMissing";
1253
+ }
1254
+ };
1255
+ /** A digests file entry that is not this app's image. */
1256
+ var ImageDigestMismatch = class extends require_errors.GkmError {
1257
+ app;
1258
+ expected;
1259
+ found;
1260
+ constructor(app, expected, found) {
1261
+ super(`The digests file pins '${app}' to ${found}, but this release runs ${expected}. It was written for another registry, project, stage or tag; use the file this stage's push of this tag wrote.`);
1262
+ this.app = app;
1263
+ this.expected = expected;
1264
+ this.found = found;
1265
+ this.name = "ImageDigestMismatch";
1266
+ }
1267
+ };
1268
+ /** A digests file that is not a JSON object of app to pinned ref. */
1269
+ var ImageDigestsInvalid = class extends require_errors.GkmError {
1270
+ file;
1271
+ detail;
1272
+ constructor(file, detail) {
1273
+ super(`${file} is not a digests file (${detail}). It should be the JSON object \`gkm compose --build --push --digests-file\` writes: { "api": "<registry>/<image>:<tag>@sha256:…" }.`);
1274
+ this.file = file;
1275
+ this.detail = detail;
1276
+ this.name = "ImageDigestsInvalid";
1277
+ }
1278
+ };
1279
+ /** Parse a digests file's content, checking its shape. */
1280
+ function parseDigests(file, content) {
1281
+ let parsed;
1282
+ try {
1283
+ parsed = JSON.parse(content);
1284
+ } catch (error) {
1285
+ throw new ImageDigestsInvalid(file, error instanceof Error ? error.message : String(error));
1286
+ }
1287
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) throw new ImageDigestsInvalid(file, "not a JSON object");
1288
+ for (const [app, value] of Object.entries(parsed)) if (typeof value !== "string" || !/@sha256:[0-9a-f]{64}$/.test(value)) throw new ImageDigestsInvalid(file, `'${app}' is not an <image>:<tag>@sha256:… ref`);
1289
+ return parsed;
1290
+ }
1291
+ /**
1292
+ * Each image pinned to the digest the file names for it.
1293
+ *
1294
+ * @throws {ImageDigestMissing} naming every app the file has no entry for
1295
+ * @throws {ImageDigestMismatch} when an entry is another image or tag
1296
+ */
1297
+ function pinImages(file, digests, images) {
1298
+ const missing = images.filter((image) => !digests[image.app]).map((image) => image.app);
1299
+ if (missing.length > 0) throw new ImageDigestMissing(file, missing);
1300
+ return images.map((image) => {
1301
+ const pinned = digests[image.app];
1302
+ if (pinned.split("@")[0] !== image.ref) throw new ImageDigestMismatch(image.app, image.ref, pinned);
1303
+ return {
1304
+ ...image,
1305
+ ref: pinned
1306
+ };
1307
+ });
1308
+ }
1309
+ //#endregion
1117
1310
  //#region src/compose/secrets.ts
1118
1311
  function deployedStackSecrets(workspace, stage, stored, manifest) {
1119
1312
  const withSeed = require_compose.withGeneratedSecrets(stored ?? require_dns.initStageSecrets(stage), manifest);
@@ -1725,7 +1918,7 @@ async function validateCompose(ctx, deps, options = {}) {
1725
1918
  if (push && mode !== "build") throw new ComposePushNeedsBuild();
1726
1919
  if (options.pin && mode !== "pull") throw new ComposePinNeedsPull();
1727
1920
  const registry = workspace.deploy?.registry;
1728
- if (!registry && (push || mode === "pull")) throw new require_stack.RegistryRequired(push ? "push" : "pull", require_dns.imageRef(identity, ctx.apps[0] ?? workspace.name, void 0, tag));
1921
+ if (!registry && (push || mode === "pull")) throw new RegistryRequired(push ? "push" : "pull", require_dns.imageRef(identity, ctx.apps[0] ?? workspace.name, void 0, require_dns.stageTag(tag, stage)));
1729
1922
  const background = {};
1730
1923
  const subscribers = {};
1731
1924
  const manifest = await require_discover.discover({
@@ -1775,7 +1968,7 @@ async function validateCompose(ctx, deps, options = {}) {
1775
1968
  const pinned = (unpinned) => options.pin ? withPinnedImages(unpinned, options.pin.file, options.pin.digests) : unpinned;
1776
1969
  const stack = pinned(composed);
1777
1970
  for (const warning of stack.warnings) ctx.logger.warn(`⚠ ${warning}`);
1778
- if (mode === "pull" && !ctx.dryRun) await require_stack.assertImagesExist(deps.docker, tag, [
1971
+ if (mode === "pull" && !ctx.dryRun) await assertImagesExist(deps.docker, require_dns.stageTag(tag, stage), [
1779
1972
  ...stack.apps,
1780
1973
  ...stack.workers,
1781
1974
  ...stack.processors
@@ -2073,9 +2266,9 @@ async function stageSecrets(ctx, manifest) {
2073
2266
  * compose service runs.
2074
2267
  */
2075
2268
  function withPinnedImages(stack, file, digests) {
2076
- const apps = require_stack.pinImages(file, digests, stack.apps);
2077
- const workers = require_stack.pinImages(file, digests, stack.workers);
2078
- const processors = require_stack.pinImages(file, digests, stack.processors);
2269
+ const apps = pinImages(file, digests, stack.apps);
2270
+ const workers = pinImages(file, digests, stack.workers);
2271
+ const processors = pinImages(file, digests, stack.processors);
2079
2272
  const services = { ...stack.compose.services };
2080
2273
  for (const image of [
2081
2274
  ...apps,
@@ -2453,7 +2646,7 @@ async function buildCompose(ctx, run, deps) {
2453
2646
  ctx.logger.info("\n🐳 Building images…");
2454
2647
  await deps.docker.build(ref, now.map((image) => image.app));
2455
2648
  } else {
2456
- ctx.logger.info(`\n🐳 Pulling ${ctx.tag}…`);
2649
+ ctx.logger.info(`\n🐳 Pulling ${require_dns.stageTag(ctx.tag, ctx.stage)}…`);
2457
2650
  await deps.docker.pull(ref, apps);
2458
2651
  }
2459
2652
  if (run.push) ctx.logger.info("\n📤 Pushing images…");
@@ -2973,7 +3166,7 @@ function composeResult(ctx, run) {
2973
3166
  failedCount: 0,
2974
3167
  stage: ctx.stage,
2975
3168
  identity: ctx.identity.key,
2976
- tag: ctx.tag,
3169
+ tag: require_dns.stageTag(ctx.tag, ctx.stage),
2977
3170
  dryRun: ctx.dryRun,
2978
3171
  environmentId: "",
2979
3172
  skipped: [...ctx.skipped],
@@ -3259,6 +3452,18 @@ Object.defineProperty(exports, "edgeRef", {
3259
3452
  return edgeRef;
3260
3453
  }
3261
3454
  });
3455
+ Object.defineProperty(exports, "parseDigests", {
3456
+ enumerable: true,
3457
+ get: function() {
3458
+ return parseDigests;
3459
+ }
3460
+ });
3461
+ Object.defineProperty(exports, "pinnedRef", {
3462
+ enumerable: true,
3463
+ get: function() {
3464
+ return pinnedRef;
3465
+ }
3466
+ });
3262
3467
  Object.defineProperty(exports, "projectNetwork", {
3263
3468
  enumerable: true,
3264
3469
  get: function() {
@@ -3290,4 +3495,4 @@ Object.defineProperty(exports, "stackOverrideFile", {
3290
3495
  }
3291
3496
  });
3292
3497
 
3293
- //# sourceMappingURL=compose-B9uSqCxY.cjs.map
3498
+ //# sourceMappingURL=compose-CNEv5lGg.cjs.map