@geekmidas/cli 10.0.0-alpha.63 → 10.0.0-alpha.65
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 +1 -1
- package/dist/{HostingerProvider-mJ7YruxH.cjs → HostingerProvider-Dlmbfass.cjs} +3 -3
- package/dist/{HostingerProvider-mJ7YruxH.cjs.map → HostingerProvider-Dlmbfass.cjs.map} +1 -1
- package/dist/{HostingerProvider-DBBwpDjn.mjs → HostingerProvider-x9gQTAGZ.mjs} +2 -2
- package/dist/{HostingerProvider-DBBwpDjn.mjs.map → HostingerProvider-x9gQTAGZ.mjs.map} +1 -1
- package/dist/{LegacyStateStore-CP7SZwTP.cjs → LegacyStateStore-BGoo__sO.cjs} +2 -2
- package/dist/{LegacyStateStore-CP7SZwTP.cjs.map → LegacyStateStore-BGoo__sO.cjs.map} +1 -1
- package/dist/{LegacyStateStore-Q3GmKOdw.mjs → LegacyStateStore-BUu1nQ5u.mjs} +2 -2
- package/dist/{LegacyStateStore-Q3GmKOdw.mjs.map → LegacyStateStore-BUu1nQ5u.mjs.map} +1 -1
- package/dist/{LocalStateStore-sS8mvLeq.cjs → LocalStateStore-93urXyQe.cjs} +2 -2
- package/dist/{LocalStateStore-sS8mvLeq.cjs.map → LocalStateStore-93urXyQe.cjs.map} +1 -1
- package/dist/{LocalStateStore-BGIXcrvX.mjs → LocalStateStore-BRhMQRuy.mjs} +2 -2
- package/dist/{LocalStateStore-BGIXcrvX.mjs.map → LocalStateStore-BRhMQRuy.mjs.map} +1 -1
- package/dist/{OpenApiTsGenerator-CjHWFRDd.cjs → OpenApiTsGenerator-BWuDRHe9.cjs} +2 -2
- package/dist/{OpenApiTsGenerator-CjHWFRDd.cjs.map → OpenApiTsGenerator-BWuDRHe9.cjs.map} +1 -1
- package/dist/{OpenApiTsGenerator-CnAwhGxi.mjs → OpenApiTsGenerator-C6v-IeHt.mjs} +2 -2
- package/dist/{OpenApiTsGenerator-CnAwhGxi.mjs.map → OpenApiTsGenerator-C6v-IeHt.mjs.map} +1 -1
- package/dist/{S3StateStore-6jqITH2F.cjs → S3StateStore-F4dxw6kS.cjs} +2 -2
- package/dist/{S3StateStore-6jqITH2F.cjs.map → S3StateStore-F4dxw6kS.cjs.map} +1 -1
- package/dist/{S3StateStore-D7l_lWJ3.mjs → S3StateStore-pw1GhWwt.mjs} +2 -2
- package/dist/{S3StateStore-D7l_lWJ3.mjs.map → S3StateStore-pw1GhWwt.mjs.map} +1 -1
- package/dist/{SSMStateStore-B__F7IJa.cjs → SSMStateStore-Bt9acuAF.cjs} +2 -2
- package/dist/{SSMStateStore-B__F7IJa.cjs.map → SSMStateStore-Bt9acuAF.cjs.map} +1 -1
- package/dist/{SSMStateStore-CAQDVpoc.mjs → SSMStateStore-Dmj7zzFO.mjs} +2 -2
- package/dist/{SSMStateStore-CAQDVpoc.mjs.map → SSMStateStore-Dmj7zzFO.mjs.map} +1 -1
- package/dist/{bundler-DLfOn0ls.cjs → bundler-D6MlIfBT.cjs} +3 -3
- package/dist/{bundler-DLfOn0ls.cjs.map → bundler-D6MlIfBT.cjs.map} +1 -1
- package/dist/{bundler-DyWI41Iy.mjs → bundler-D_14JLZF.mjs} +3 -3
- package/dist/{bundler-DyWI41Iy.mjs.map → bundler-D_14JLZF.mjs.map} +1 -1
- package/dist/{cli-D-ZM-X2s.cjs → cli-BfH1deAT.cjs} +8 -7
- package/dist/{cli-D-ZM-X2s.cjs.map → cli-BfH1deAT.cjs.map} +1 -1
- package/dist/{cli-PkVF28LM.mjs → cli-P56vvrDQ.mjs} +5 -4
- package/dist/{cli-PkVF28LM.mjs.map → cli-P56vvrDQ.mjs.map} +1 -1
- package/dist/compose-391oEKj1.cjs +1982 -0
- package/dist/compose-391oEKj1.cjs.map +1 -0
- package/dist/compose-DprE3ASm.mjs +1862 -0
- package/dist/compose-DprE3ASm.mjs.map +1 -0
- package/dist/{config-C2BUosLm.d.mts → config-BonvTW8p.d.mts} +3 -3
- package/dist/{config-C2BUosLm.d.mts.map → config-BonvTW8p.d.mts.map} +1 -1
- package/dist/{config-CemHVcIr.d.cts → config-V_X_BMpm.d.cts} +3 -3
- package/dist/{config-CemHVcIr.d.cts.map → config-V_X_BMpm.d.cts.map} +1 -1
- package/dist/config.cjs +416 -17
- package/dist/config.cjs.map +1 -0
- package/dist/config.d.cts +3 -3
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +401 -2
- package/dist/config.mjs.map +1 -0
- package/dist/credentials-Bzbg23n8.cjs +298 -0
- package/dist/credentials-Bzbg23n8.cjs.map +1 -0
- package/dist/credentials-Dq1MnWQf.mjs +233 -0
- package/dist/credentials-Dq1MnWQf.mjs.map +1 -0
- package/dist/{define-CHBIEc5j.mjs → define-DR8xGYfL.mjs} +6 -3
- package/dist/define-DR8xGYfL.mjs.map +1 -0
- package/dist/{define-Cv_QvDrg.cjs → define-DzRz8FgH.cjs} +6 -3
- package/dist/define-DzRz8FgH.cjs.map +1 -0
- package/dist/deploy/public.cjs +39 -33
- package/dist/deploy/public.cjs.map +1 -1
- package/dist/deploy/public.d.cts +44 -5
- package/dist/deploy/public.d.cts.map +1 -1
- package/dist/deploy/public.d.mts +44 -5
- package/dist/deploy/public.d.mts.map +1 -1
- package/dist/deploy/public.mjs +15 -12
- package/dist/deploy/public.mjs.map +1 -1
- package/dist/{deploy-CGW-QY9D.mjs → deploy-9MBG_QLd.mjs} +11 -9
- package/dist/deploy-9MBG_QLd.mjs.map +1 -0
- package/dist/{deploy-BiMrP9i7.cjs → deploy-B80idPUZ.cjs} +17 -15
- package/dist/deploy-B80idPUZ.cjs.map +1 -0
- package/dist/{deploy-CG8bfFij.mjs → deploy-CZ5nlpsu.mjs} +16 -119
- package/dist/deploy-CZ5nlpsu.mjs.map +1 -0
- package/dist/{deploy-ABBI0lf1.cjs → deploy-Cy8igpQF.cjs} +48 -151
- package/dist/deploy-Cy8igpQF.cjs.map +1 -0
- package/dist/derive-B4vDpzgP.mjs +150 -0
- package/dist/derive-B4vDpzgP.mjs.map +1 -0
- package/dist/derive-DAbo49sm.cjs +161 -0
- package/dist/derive-DAbo49sm.cjs.map +1 -0
- package/dist/{discover-C_6COHEv.cjs → discover-DHdECueV.cjs} +6 -157
- package/dist/discover-DHdECueV.cjs.map +1 -0
- package/dist/{discover-BaT6bpnA.mjs → discover-LMrqsWSU.mjs} +8 -117
- package/dist/discover-LMrqsWSU.mjs.map +1 -0
- package/dist/{dokploy-CwdmlyQL.mjs → dokploy-BdtBePjp.mjs} +3 -3
- package/dist/{dokploy-CwdmlyQL.mjs.map → dokploy-BdtBePjp.mjs.map} +1 -1
- package/dist/{dokploy-QJxMhxdf.cjs → dokploy-iFY8MY-L.cjs} +3 -3
- package/dist/{dokploy-QJxMhxdf.cjs.map → dokploy-iFY8MY-L.cjs.map} +1 -1
- package/dist/{encryption-DXw3jj0c.cjs → encryption-B1wJwgae.cjs} +6 -6
- package/dist/{encryption-DXw3jj0c.cjs.map → encryption-B1wJwgae.cjs.map} +1 -1
- package/dist/{encryption-CbQG_ayW.mjs → encryption-DF_hgIpl.mjs} +5 -5
- package/dist/{encryption-CbQG_ayW.mjs.map → encryption-DF_hgIpl.mjs.map} +1 -1
- package/dist/{github-ciwbIwVa.mjs → github-B0YYE98x.mjs} +4 -4
- package/dist/{github-ciwbIwVa.mjs.map → github-B0YYE98x.mjs.map} +1 -1
- package/dist/{github-BH_mETav.cjs → github-CYcmTdFs.cjs} +4 -4
- package/dist/{github-BH_mETav.cjs.map → github-CYcmTdFs.cjs.map} +1 -1
- package/dist/{index-DrKzpHl-.d.mts → index-DPUAGJaK.d.cts} +16 -3
- package/dist/index-DPUAGJaK.d.cts.map +1 -0
- package/dist/{index-BtXDZQuF.d.cts → index-DwKD_8lt.d.mts} +16 -3
- package/dist/index-DwKD_8lt.d.mts.map +1 -0
- package/dist/index.cjs +280 -1849
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +221 -1774
- package/dist/index.mjs.map +1 -1
- package/dist/local-BdH4XN0E.cjs +409 -0
- package/dist/local-BdH4XN0E.cjs.map +1 -0
- package/dist/local-CWR4Y_kW.mjs +350 -0
- package/dist/local-CWR4Y_kW.mjs.map +1 -0
- package/dist/{migrate-ImBKTBcW.mjs → migrate-B2qL5wj4.mjs} +8 -7
- package/dist/{migrate-ImBKTBcW.mjs.map → migrate-B2qL5wj4.mjs.map} +1 -1
- package/dist/{migrate-6oa9y_f2.cjs → migrate-q4pPAXtO.cjs} +21 -20
- package/dist/{migrate-6oa9y_f2.cjs.map → migrate-q4pPAXtO.cjs.map} +1 -1
- package/dist/openapi.cjs +2 -2
- package/dist/openapi.d.cts +1 -1
- package/dist/openapi.d.mts +1 -1
- package/dist/openapi.mjs +2 -2
- package/dist/provider-C9_-45d5.cjs +56 -0
- package/dist/provider-C9_-45d5.cjs.map +1 -0
- package/dist/provider-q4lsYzYG.mjs +45 -0
- package/dist/provider-q4lsYzYG.mjs.map +1 -0
- package/dist/{ready-Bpdnn2ON.mjs → ready-bQfu9GES.mjs} +3 -3
- package/dist/{ready-Bpdnn2ON.mjs.map → ready-bQfu9GES.mjs.map} +1 -1
- package/dist/{ready-BiG0rt4h.cjs → ready-brEhh68f.cjs} +3 -3
- package/dist/{ready-BiG0rt4h.cjs.map → ready-brEhh68f.cjs.map} +1 -1
- package/dist/reconcile/public.cjs +1 -1
- package/dist/reconcile/public.d.cts +1 -1
- package/dist/reconcile/public.d.mts +1 -1
- package/dist/reconcile/public.mjs +1 -1
- package/dist/resolve-DLkIXTct.mjs +262 -0
- package/dist/resolve-DLkIXTct.mjs.map +1 -0
- package/dist/resolve-N_i4XNd-.cjs +315 -0
- package/dist/resolve-N_i4XNd-.cjs.map +1 -0
- package/dist/{runtime-Dn_n-29S.d.cts → runtime-BnD7Nn96.d.cts} +2 -2
- package/dist/{runtime-CXPlkZzs.d.mts.map → runtime-BnD7Nn96.d.cts.map} +1 -1
- package/dist/{runtime-CXPlkZzs.d.mts → runtime-j-tmFL65.d.mts} +2 -2
- package/dist/{runtime-Dn_n-29S.d.cts.map → runtime-j-tmFL65.d.mts.map} +1 -1
- package/dist/sandbox/discover-worker.cjs +1 -1
- package/dist/sandbox/discover-worker.mjs +1 -1
- package/dist/sandbox-CL--ZDui.cjs +164 -0
- package/dist/sandbox-CL--ZDui.cjs.map +1 -0
- package/dist/sandbox-Dm247NGx.mjs +117 -0
- package/dist/sandbox-Dm247NGx.mjs.map +1 -0
- package/dist/sniffer-BSwaL-dX.cjs +2236 -0
- package/dist/sniffer-BSwaL-dX.cjs.map +1 -0
- package/dist/sniffer-BZ-OJO4Y.mjs +2068 -0
- package/dist/sniffer-BZ-OJO4Y.mjs.map +1 -0
- package/dist/sst-B2HbrDR3.mjs +430 -0
- package/dist/sst-B2HbrDR3.mjs.map +1 -0
- package/dist/sst-DcfsVH6x.cjs +453 -0
- package/dist/sst-DcfsVH6x.cjs.map +1 -0
- package/dist/{sniffer-aO_-s5vq.mjs → state-B8YwmUZU.mjs} +1204 -3236
- package/dist/state-B8YwmUZU.mjs.map +1 -0
- package/dist/{sniffer-D_SYc_pO.cjs → state-DF26e_lo.cjs} +1251 -3494
- package/dist/state-DF26e_lo.cjs.map +1 -0
- package/dist/{store-KvNQwYaB.cjs → store-CJF1Tqkq.cjs} +4 -4
- package/dist/{store-KvNQwYaB.cjs.map → store-CJF1Tqkq.cjs.map} +1 -1
- package/dist/{store-BS8A7NcA.mjs → store-CLiHnqOY.mjs} +2 -2
- package/dist/{store-BS8A7NcA.mjs.map → store-CLiHnqOY.mjs.map} +1 -1
- package/dist/target/public.cjs +6 -6
- package/dist/target/public.d.cts +3 -3
- package/dist/target/public.d.mts +3 -3
- package/dist/target/public.mjs +3 -3
- package/dist/terminal-Bs5E1oxm.cjs +88 -0
- package/dist/terminal-Bs5E1oxm.cjs.map +1 -0
- package/dist/terminal-CfbiYUbZ.mjs +84 -0
- package/dist/terminal-CfbiYUbZ.mjs.map +1 -0
- package/dist/{types-DIA7Li-J.d.cts → types-BCzMWBb6.d.mts} +84 -17
- package/dist/types-BCzMWBb6.d.mts.map +1 -0
- package/dist/{types-CfLKGfC_.d.mts → types-ByMWkXKP.d.cts} +85 -16
- package/dist/types-ByMWkXKP.d.cts.map +1 -0
- package/dist/utils-D2Nk1Nv2.cjs +205 -0
- package/dist/utils-D2Nk1Nv2.cjs.map +1 -0
- package/dist/utils-D_fxUqvU.mjs +156 -0
- package/dist/utils-D_fxUqvU.mjs.map +1 -0
- package/dist/vitest.cjs +1 -1
- package/dist/vitest.mjs +1 -1
- package/dist/workspace/index.cjs +3 -1
- package/dist/workspace/index.d.cts +3 -3
- package/dist/workspace/index.d.mts +3 -3
- package/dist/workspace/index.mjs +2 -2
- package/dist/{workspace-Kl4NG9IH.cjs → workspace-BewAHZIo.cjs} +41 -6
- package/dist/workspace-BewAHZIo.cjs.map +1 -0
- package/dist/{workspace-Dh7rr7l4.mjs → workspace-C06_pW4g.mjs} +30 -7
- package/dist/workspace-C06_pW4g.mjs.map +1 -0
- package/package.json +13 -13
- package/dist/config-BEJYKd4s.cjs +0 -648
- package/dist/config-BEJYKd4s.cjs.map +0 -1
- package/dist/config-LKKCVCnC.mjs +0 -547
- package/dist/config-LKKCVCnC.mjs.map +0 -1
- package/dist/define-CHBIEc5j.mjs.map +0 -1
- package/dist/define-Cv_QvDrg.cjs.map +0 -1
- package/dist/deploy-ABBI0lf1.cjs.map +0 -1
- package/dist/deploy-BiMrP9i7.cjs.map +0 -1
- package/dist/deploy-CG8bfFij.mjs.map +0 -1
- package/dist/deploy-CGW-QY9D.mjs.map +0 -1
- package/dist/discover-BaT6bpnA.mjs.map +0 -1
- package/dist/discover-C_6COHEv.cjs.map +0 -1
- package/dist/home-DOzBaWaL.cjs +0 -33
- package/dist/home-DOzBaWaL.cjs.map +0 -1
- package/dist/home-GI7pJl1M.mjs +0 -22
- package/dist/home-GI7pJl1M.mjs.map +0 -1
- package/dist/index-BtXDZQuF.d.cts.map +0 -1
- package/dist/index-DrKzpHl-.d.mts.map +0 -1
- package/dist/resolve-B1T0hUaR.mjs +0 -170
- package/dist/resolve-B1T0hUaR.mjs.map +0 -1
- package/dist/resolve-xytBTtG4.cjs +0 -217
- package/dist/resolve-xytBTtG4.cjs.map +0 -1
- package/dist/runtime-CMwtq0AL.cjs +0 -163
- package/dist/runtime-CMwtq0AL.cjs.map +0 -1
- package/dist/runtime-DbakJS8u.mjs +0 -134
- package/dist/runtime-DbakJS8u.mjs.map +0 -1
- package/dist/sniffer-D_SYc_pO.cjs.map +0 -1
- package/dist/sniffer-aO_-s5vq.mjs.map +0 -1
- package/dist/terminal-D0f1u0LG.cjs +0 -576
- package/dist/terminal-D0f1u0LG.cjs.map +0 -1
- package/dist/terminal-gMxAo9Dj.mjs +0 -517
- package/dist/terminal-gMxAo9Dj.mjs.map +0 -1
- package/dist/types-CfLKGfC_.d.mts.map +0 -1
- package/dist/types-DIA7Li-J.d.cts.map +0 -1
- package/dist/workspace-Dh7rr7l4.mjs.map +0 -1
- package/dist/workspace-Kl4NG9IH.cjs.map +0 -1
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
const require_sniffer = require("./sniffer-
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
1
|
+
const require_sniffer = require("./sniffer-BSwaL-dX.cjs");
|
|
2
|
+
const require_local = require("./local-BdH4XN0E.cjs");
|
|
3
|
+
const require_credentials = require("./credentials-Bzbg23n8.cjs");
|
|
4
|
+
const require_discover = require("./discover-DHdECueV.cjs");
|
|
5
|
+
const require_derive = require("./derive-DAbo49sm.cjs");
|
|
6
|
+
const require_workspace = require("./workspace-BewAHZIo.cjs");
|
|
7
|
+
require("./config.cjs");
|
|
5
8
|
const require_storage = require("./storage-CSGoC3bK.cjs");
|
|
6
|
-
const require_store = require("./store-
|
|
7
|
-
const
|
|
9
|
+
const require_store = require("./store-CJF1Tqkq.cjs");
|
|
10
|
+
const require_state = require("./state-DF26e_lo.cjs");
|
|
11
|
+
require("./terminal-Bs5E1oxm.cjs");
|
|
8
12
|
let node_path = require("node:path");
|
|
9
13
|
let node_fs_promises = require("node:fs/promises");
|
|
10
14
|
let node_os = require("node:os");
|
|
@@ -83,7 +87,7 @@ const PROVISIONERS = {
|
|
|
83
87
|
*/
|
|
84
88
|
database: async (declaration, context) => {
|
|
85
89
|
if (declaration.kind !== "database") throw new WrongKind(declaration.kind);
|
|
86
|
-
const name =
|
|
90
|
+
const name = require_state.resourceName(declaration.id, declaration.kind, context.stage);
|
|
87
91
|
const { postgres } = await context.api.findOrCreatePostgres(serviceName({
|
|
88
92
|
stage: context.stage,
|
|
89
93
|
app: context.scope ?? context.project
|
|
@@ -120,7 +124,7 @@ const PROVISIONERS = {
|
|
|
120
124
|
if (declaration.kind !== "database-schema") throw new WrongKind(declaration.kind);
|
|
121
125
|
const parent = context.provisioned[declaration.of];
|
|
122
126
|
if (!parent) throw new UnresolvedParent(declaration.id, declaration.of);
|
|
123
|
-
const runtime =
|
|
127
|
+
const runtime = require_state.resourceName(declaration.id, declaration.kind, context.stage);
|
|
124
128
|
const owner = (0, _geekmidas_db_pg_roles.ownerRole)(runtime);
|
|
125
129
|
const reads = readsFrom(context.manifest, declaration.id);
|
|
126
130
|
const parentUrl = new URL(parent.provides[(0, _geekmidas_manifest.provideKey)(declaration.of, "url")] ?? "");
|
|
@@ -222,7 +226,7 @@ const PROVISIONERS = {
|
|
|
222
226
|
stage: context.stage,
|
|
223
227
|
app: context.scope ?? context.project
|
|
224
228
|
}, declaration.id);
|
|
225
|
-
const bucket =
|
|
229
|
+
const bucket = require_state.resourceName(declaration.id, declaration.kind, context.stage);
|
|
226
230
|
const user = `${bucket}-root`;
|
|
227
231
|
const password = derivedPassword(context, `objects:${declaration.id}`);
|
|
228
232
|
const { compose } = await context.api.findOrCreateCompose(service, context.projectId, context.environmentId, minioCompose({
|
|
@@ -669,7 +673,7 @@ async function provisionDeclared(options) {
|
|
|
669
673
|
clusters: {}
|
|
670
674
|
};
|
|
671
675
|
const manifest = options.manifest ?? await require_discover.discover({
|
|
672
|
-
patterns:
|
|
676
|
+
patterns: require_state.constructGlobs(workspace),
|
|
673
677
|
cwd: workspace.root
|
|
674
678
|
});
|
|
675
679
|
if (Object.keys(manifest).length === 0) return empty;
|
|
@@ -682,9 +686,9 @@ async function provisionDeclared(options) {
|
|
|
682
686
|
stage: options.stage,
|
|
683
687
|
project: workspace.name,
|
|
684
688
|
scope: options.scope ?? workspace.name,
|
|
685
|
-
cache:
|
|
686
|
-
events:
|
|
687
|
-
storage:
|
|
689
|
+
cache: require_state.cacheBackendFor(require_state.providerOf(workspace)),
|
|
690
|
+
events: require_state.eventsBackendFor(require_state.providerOf(workspace)),
|
|
691
|
+
storage: require_state.storageBackendFor(require_state.providerOf(workspace)),
|
|
688
692
|
addresses: surfaceAddresses(manifest, options.appUrls),
|
|
689
693
|
seed: options.seed,
|
|
690
694
|
...options.supplied ? { supplied: options.supplied } : {},
|
|
@@ -722,7 +726,7 @@ async function provisionDeclared(options) {
|
|
|
722
726
|
* run again.
|
|
723
727
|
*/
|
|
724
728
|
async function applyDeclared(client, statements) {
|
|
725
|
-
return (await
|
|
729
|
+
return (await require_state.applyPostgres(client, statements)).filter((entry) => entry.created).length;
|
|
726
730
|
}
|
|
727
731
|
/**
|
|
728
732
|
* The provisioning order, with queues and topics moved to the end.
|
|
@@ -758,7 +762,7 @@ function surfaceAddresses(manifest, appUrls) {
|
|
|
758
762
|
const addresses = {};
|
|
759
763
|
for (const [id, declaration] of Object.entries(manifest)) {
|
|
760
764
|
if (declaration.kind !== "rest-api") continue;
|
|
761
|
-
const url = appUrls[
|
|
765
|
+
const url = appUrls[require_derive.appKey(id)];
|
|
762
766
|
if (url) addresses[id] = url;
|
|
763
767
|
}
|
|
764
768
|
return addresses;
|
|
@@ -785,7 +789,7 @@ async function createDnsProvider(options) {
|
|
|
785
789
|
if (isDnsProvider(config.provider)) return config.provider;
|
|
786
790
|
const provider = config.provider;
|
|
787
791
|
if (provider === "hostinger") {
|
|
788
|
-
const { HostingerProvider } = await Promise.resolve().then(() => require("./HostingerProvider-
|
|
792
|
+
const { HostingerProvider } = await Promise.resolve().then(() => require("./HostingerProvider-Dlmbfass.cjs"));
|
|
789
793
|
return new HostingerProvider();
|
|
790
794
|
}
|
|
791
795
|
if (provider === "route53") {
|
|
@@ -1055,7 +1059,7 @@ async function orchestrateDns(appHostnames, dnsConfig, dokployEndpoint, state) {
|
|
|
1055
1059
|
hasFailures = true;
|
|
1056
1060
|
}
|
|
1057
1061
|
if (state) {
|
|
1058
|
-
for (const record of domainRecords) if (record.created || record.existed)
|
|
1062
|
+
for (const record of domainRecords) if (record.created || record.existed) require_state.setDnsRecord(state, {
|
|
1059
1063
|
domain: rootDomain,
|
|
1060
1064
|
name: record.subdomain,
|
|
1061
1065
|
type: record.type,
|
|
@@ -1090,7 +1094,7 @@ async function verifyDnsRecords(appHostnames, serverIp, state) {
|
|
|
1090
1094
|
const results = [];
|
|
1091
1095
|
logger$2.log("\n🔍 Verifying DNS records...");
|
|
1092
1096
|
for (const [appName, hostname] of appHostnames) {
|
|
1093
|
-
if (
|
|
1097
|
+
if (require_state.isDnsVerified(state, hostname, serverIp)) {
|
|
1094
1098
|
logger$2.log(` ✓ ${hostname} (previously verified)`);
|
|
1095
1099
|
results.push({
|
|
1096
1100
|
hostname,
|
|
@@ -1104,7 +1108,7 @@ async function verifyDnsRecords(appHostnames, serverIp, state) {
|
|
|
1104
1108
|
try {
|
|
1105
1109
|
const resolvedIp = await resolveHostnameToIp(hostname);
|
|
1106
1110
|
if (resolvedIp === serverIp) {
|
|
1107
|
-
|
|
1111
|
+
require_state.setDnsVerification(state, hostname, serverIp);
|
|
1108
1112
|
logger$2.log(` ✓ ${hostname} → ${resolvedIp}`);
|
|
1109
1113
|
results.push({
|
|
1110
1114
|
hostname,
|
|
@@ -1211,14 +1215,14 @@ async function writeCredentialsFile(credentials) {
|
|
|
1211
1215
|
async function buildImage(imageRef, buildArgs, credentials, { cwd, signal, stdio }) {
|
|
1212
1216
|
logger$1.log(`\n🔨 Building Docker image: ${imageRef}`);
|
|
1213
1217
|
logger$1.log(" Generating Dockerfile for the pre-built bundle...");
|
|
1214
|
-
await
|
|
1218
|
+
await require_state.dockerCommand({
|
|
1215
1219
|
slim: true,
|
|
1216
1220
|
cwd
|
|
1217
1221
|
});
|
|
1218
1222
|
const dockerfilePath = (0, node_path.join)(cwd, ".gkm", "docker", "Dockerfile");
|
|
1219
1223
|
const secret = credentials ? await writeCredentialsFile(credentials) : void 0;
|
|
1220
1224
|
try {
|
|
1221
|
-
await
|
|
1225
|
+
await require_local.run("docker", dockerBuildArgs({
|
|
1222
1226
|
dockerfilePath,
|
|
1223
1227
|
imageRef,
|
|
1224
1228
|
buildArgs,
|
|
@@ -1234,7 +1238,7 @@ async function buildImage(imageRef, buildArgs, credentials, { cwd, signal, stdio
|
|
|
1234
1238
|
});
|
|
1235
1239
|
logger$1.log(`✅ Image built: ${imageRef}`);
|
|
1236
1240
|
} catch (error) {
|
|
1237
|
-
throw new
|
|
1241
|
+
throw new require_state.DockerBuildFailed(imageRef, error);
|
|
1238
1242
|
} finally {
|
|
1239
1243
|
await secret?.cleanup();
|
|
1240
1244
|
}
|
|
@@ -1245,14 +1249,14 @@ async function buildImage(imageRef, buildArgs, credentials, { cwd, signal, stdio
|
|
|
1245
1249
|
async function pushImage(imageRef, { cwd, signal, stdio }) {
|
|
1246
1250
|
logger$1.log(`\n☁️ Pushing image: ${imageRef}`);
|
|
1247
1251
|
try {
|
|
1248
|
-
await
|
|
1252
|
+
await require_local.run("docker", ["push", imageRef], {
|
|
1249
1253
|
cwd,
|
|
1250
1254
|
...signal ? { signal } : {},
|
|
1251
1255
|
...stdio ? { stdio } : {}
|
|
1252
1256
|
});
|
|
1253
1257
|
logger$1.log(`✅ Image pushed: ${imageRef}`);
|
|
1254
1258
|
} catch (error) {
|
|
1255
|
-
throw new
|
|
1259
|
+
throw new require_state.DockerPushFailed(imageRef, error);
|
|
1256
1260
|
}
|
|
1257
1261
|
}
|
|
1258
1262
|
/**
|
|
@@ -1267,7 +1271,7 @@ async function pushImage(imageRef, { cwd, signal, stdio }) {
|
|
|
1267
1271
|
*/
|
|
1268
1272
|
async function pushedDigest(imageRef, { cwd, signal } = { cwd: process.cwd() }) {
|
|
1269
1273
|
const repository = imageRef.split("@")[0].replace(/:[\w][\w.-]*$/, "");
|
|
1270
|
-
const output = await
|
|
1274
|
+
const output = await require_local.runOutput("docker", [
|
|
1271
1275
|
"image",
|
|
1272
1276
|
"inspect",
|
|
1273
1277
|
"--format={{json .RepoDigests}}",
|
|
@@ -1291,7 +1295,7 @@ async function pushedDigest(imageRef, { cwd, signal } = { cwd: process.cwd() })
|
|
|
1291
1295
|
async function deployDocker(options) {
|
|
1292
1296
|
const { stage, tag, skipPush, masterKey, config, buildArgs, credentials } = options;
|
|
1293
1297
|
const imageName = config.imageName;
|
|
1294
|
-
const imageRef =
|
|
1298
|
+
const imageRef = require_state.validateImageRef(getImageRef(config.registry, imageName, tag));
|
|
1295
1299
|
const docker = {
|
|
1296
1300
|
cwd: options.cwd ?? process.cwd(),
|
|
1297
1301
|
...options.signal ? { signal: options.signal } : {},
|
|
@@ -1338,10 +1342,10 @@ function generateSecret() {
|
|
|
1338
1342
|
* Otherwise generates a new one and stores it.
|
|
1339
1343
|
*/
|
|
1340
1344
|
function getOrGenerateSecret(state, appName, secretName) {
|
|
1341
|
-
const existing =
|
|
1345
|
+
const existing = require_state.getGeneratedSecret(state, appName, secretName);
|
|
1342
1346
|
if (existing) return existing;
|
|
1343
1347
|
const generated = generateSecret();
|
|
1344
|
-
|
|
1348
|
+
require_state.setGeneratedSecret(state, appName, secretName, generated);
|
|
1345
1349
|
return generated;
|
|
1346
1350
|
}
|
|
1347
1351
|
/**
|
|
@@ -1404,113 +1408,6 @@ function validateEnvVars(requiredVars, context) {
|
|
|
1404
1408
|
};
|
|
1405
1409
|
}
|
|
1406
1410
|
//#endregion
|
|
1407
|
-
//#region src/deploy/journal.ts
|
|
1408
|
-
var DeployJournal = class DeployJournal {
|
|
1409
|
-
store;
|
|
1410
|
-
stage;
|
|
1411
|
-
state;
|
|
1412
|
-
resources;
|
|
1413
|
-
version;
|
|
1414
|
-
existed;
|
|
1415
|
-
constructor(store, stage, state, resources, version, existed) {
|
|
1416
|
-
this.store = store;
|
|
1417
|
-
this.stage = stage;
|
|
1418
|
-
this.state = state;
|
|
1419
|
-
this.resources = resources;
|
|
1420
|
-
this.version = version;
|
|
1421
|
-
this.existed = existed;
|
|
1422
|
-
}
|
|
1423
|
-
/**
|
|
1424
|
-
* The stage's journal — its stored state, or `initial` written as the
|
|
1425
|
-
* stage's first state, so there is somewhere to record the very first
|
|
1426
|
-
* resource before it is created.
|
|
1427
|
-
*/
|
|
1428
|
-
static async open(store, stage, initial) {
|
|
1429
|
-
const stored = await store.read(stage);
|
|
1430
|
-
if (stored) return new DeployJournal(store, stage, stored.state, stored.resources, stored.version, true);
|
|
1431
|
-
const state = initial();
|
|
1432
|
-
const version = await store.write(stage, state, { expectedVersion: null });
|
|
1433
|
-
return new DeployJournal(store, stage, state, {}, version, false);
|
|
1434
|
-
}
|
|
1435
|
-
record(key) {
|
|
1436
|
-
return this.resources[key];
|
|
1437
|
-
}
|
|
1438
|
-
/** The keys a previous run marked `pending` and never saw created. */
|
|
1439
|
-
unfinished() {
|
|
1440
|
-
return Object.values(this.resources).filter((record) => record.status === "pending").map((record) => record.key);
|
|
1441
|
-
}
|
|
1442
|
-
/** Records that `entry` is about to be created. */
|
|
1443
|
-
async pending(entry) {
|
|
1444
|
-
await this.put({
|
|
1445
|
-
...entry,
|
|
1446
|
-
status: "pending"
|
|
1447
|
-
});
|
|
1448
|
-
}
|
|
1449
|
-
/** Records `entry` as existing with `id`; a no-op if it already is. */
|
|
1450
|
-
async ready(entry, id) {
|
|
1451
|
-
const current = this.resources[entry.key];
|
|
1452
|
-
if (current?.status === "ready" && current.id === id) return;
|
|
1453
|
-
await this.put({
|
|
1454
|
-
...entry,
|
|
1455
|
-
status: "ready",
|
|
1456
|
-
id
|
|
1457
|
-
});
|
|
1458
|
-
}
|
|
1459
|
-
/**
|
|
1460
|
-
* The resource `entry` names: by its recorded id, else by looking it up,
|
|
1461
|
-
* else created — with `pending` written before the create and `ready`
|
|
1462
|
-
* after, so a run that dies in between leaves a record the next run
|
|
1463
|
-
* resolves by looking the resource up rather than creating another.
|
|
1464
|
-
*/
|
|
1465
|
-
async ensure(entry, steps) {
|
|
1466
|
-
const record = this.resources[entry.key];
|
|
1467
|
-
let staleId;
|
|
1468
|
-
if (record?.status === "ready" && record.id && steps.get) {
|
|
1469
|
-
const known = await steps.get(record.id);
|
|
1470
|
-
if (known) {
|
|
1471
|
-
await this.ready(entry, steps.id(known));
|
|
1472
|
-
return {
|
|
1473
|
-
resource: known,
|
|
1474
|
-
via: "recorded"
|
|
1475
|
-
};
|
|
1476
|
-
}
|
|
1477
|
-
staleId = record.id;
|
|
1478
|
-
}
|
|
1479
|
-
const existing = await steps.find();
|
|
1480
|
-
if (existing) {
|
|
1481
|
-
await this.ready(entry, steps.id(existing));
|
|
1482
|
-
return {
|
|
1483
|
-
resource: existing,
|
|
1484
|
-
via: record?.status === "pending" ? "resumed" : "found",
|
|
1485
|
-
...staleId ? { staleId } : {}
|
|
1486
|
-
};
|
|
1487
|
-
}
|
|
1488
|
-
await this.pending(entry);
|
|
1489
|
-
const created = await steps.create();
|
|
1490
|
-
await this.ready(entry, steps.id(created));
|
|
1491
|
-
return {
|
|
1492
|
-
resource: created,
|
|
1493
|
-
via: "created",
|
|
1494
|
-
...staleId ? { staleId } : {}
|
|
1495
|
-
};
|
|
1496
|
-
}
|
|
1497
|
-
/** Writes the stage's state, keeping its resource records. */
|
|
1498
|
-
async save() {
|
|
1499
|
-
this.state.lastDeployedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
1500
|
-
this.version = await this.store.write(this.stage, this.state, { expectedVersion: this.version });
|
|
1501
|
-
}
|
|
1502
|
-
async put(record) {
|
|
1503
|
-
this.version = await this.store.putResource(this.stage, record, { expectedVersion: this.version });
|
|
1504
|
-
this.resources = {
|
|
1505
|
-
...this.resources,
|
|
1506
|
-
[record.key]: {
|
|
1507
|
-
...record,
|
|
1508
|
-
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1509
|
-
}
|
|
1510
|
-
};
|
|
1511
|
-
}
|
|
1512
|
-
};
|
|
1513
|
-
//#endregion
|
|
1514
1411
|
//#region src/deploy/ownership.ts
|
|
1515
1412
|
/**
|
|
1516
1413
|
* Which Dokploy project a deploy is allowed to deploy into.
|
|
@@ -1648,7 +1545,7 @@ async function resolveProject(api, identity, stateProjectId, log = () => {}, hoo
|
|
|
1648
1545
|
var RegistryNotConfigured = class extends Error {
|
|
1649
1546
|
stage;
|
|
1650
1547
|
constructor(stage) {
|
|
1651
|
-
super(`Deploying '${stage}' needs a container registry: Dokploy pulls each app's image from one. Set deploy.
|
|
1548
|
+
super(`Deploying '${stage}' needs a container registry: Dokploy pulls each app's image from one. Set deploy.registry in gkm.config.ts (e.g. 'ghcr.io/acme'), and deploy.dokploy.registryId if Dokploy already holds that registry's credentials.`);
|
|
1652
1549
|
this.stage = stage;
|
|
1653
1550
|
this.name = "RegistryNotConfigured";
|
|
1654
1551
|
}
|
|
@@ -2136,7 +2033,7 @@ async function preflight({ workspace, manifest, stage, secrets: secretsStore, ct
|
|
|
2136
2033
|
logger.log("\n🔐 Loading secrets and analyzing environment requirements...");
|
|
2137
2034
|
const stored = await secretsStore.read();
|
|
2138
2035
|
if (!stored) logger.log(` ⚠️ No secrets found for stage "${stage}"; starting them`);
|
|
2139
|
-
const { secrets: stageSecrets, generated } =
|
|
2036
|
+
const { secrets: stageSecrets, generated } = require_state.withGeneratedSecrets(stored ?? require_storage.initStageSecrets(stage), manifest);
|
|
2140
2037
|
if (generated.length > 0) {
|
|
2141
2038
|
if (ctx.dryRun) logger.log(` 🔑 Would generate for "${stage}" (${secretsStore.store}): ${generated.join(", ")}`);
|
|
2142
2039
|
else {
|
|
@@ -2176,7 +2073,7 @@ async function provisionDokploy(run) {
|
|
|
2176
2073
|
};
|
|
2177
2074
|
const { api, endpoint } = await dokployApi(workspace, ctx);
|
|
2178
2075
|
logger.log("\n📋 Loading deploy state...");
|
|
2179
|
-
const journal = await DeployJournal.open(store, stage, () =>
|
|
2076
|
+
const journal = await require_state.DeployJournal.open(store, stage, () => require_state.createEmptyState(stage, "", ""));
|
|
2180
2077
|
const state = journal.state;
|
|
2181
2078
|
if (journal.existed) logger.log(` Found existing state for stage "${stage}"`);
|
|
2182
2079
|
else logger.log(` Creating new state for stage "${stage}"`);
|
|
@@ -2232,7 +2129,7 @@ async function provisionDokploy(run) {
|
|
|
2232
2129
|
state.environmentId = environmentId;
|
|
2233
2130
|
state.identity = identity.key;
|
|
2234
2131
|
logger.log("\n🐳 Checking registry...");
|
|
2235
|
-
const registry = workspace.deploy.
|
|
2132
|
+
const registry = workspace.deploy.registry;
|
|
2236
2133
|
let registryCreated = false;
|
|
2237
2134
|
const dokployRegistry = await resolveRegistry(api, {
|
|
2238
2135
|
stage,
|
|
@@ -2245,7 +2142,7 @@ async function provisionDokploy(run) {
|
|
|
2245
2142
|
kind: "registry",
|
|
2246
2143
|
url
|
|
2247
2144
|
}, { signal: ctx.signal });
|
|
2248
|
-
if (!login) throw new
|
|
2145
|
+
if (!login) throw new require_credentials.MissingCredential("registry", url);
|
|
2249
2146
|
const created = await api.createRegistry("Default Registry", url, login.username, login.password);
|
|
2250
2147
|
registryCreated = true;
|
|
2251
2148
|
logger.log(` ✓ Registry created: ${created.registryId}`);
|
|
@@ -2308,10 +2205,10 @@ async function provisionDokploy(run) {
|
|
|
2308
2205
|
projectName: identity.scope,
|
|
2309
2206
|
stage,
|
|
2310
2207
|
config: workspace.deploy.backups,
|
|
2311
|
-
existingState:
|
|
2208
|
+
existingState: require_state.getBackupState(state),
|
|
2312
2209
|
logger
|
|
2313
2210
|
});
|
|
2314
|
-
|
|
2211
|
+
require_state.setBackupState(state, backupState);
|
|
2315
2212
|
if (!backupState.postgresBackupId) {
|
|
2316
2213
|
const backupSchedule = workspace.deploy.backups.schedule ?? "0 2 * * *";
|
|
2317
2214
|
const backupRetention = workspace.deploy.backups.retention ?? 30;
|
|
@@ -2325,7 +2222,7 @@ async function provisionDokploy(run) {
|
|
|
2325
2222
|
enabled: true,
|
|
2326
2223
|
keepLatestCount: backupRetention
|
|
2327
2224
|
});
|
|
2328
|
-
|
|
2225
|
+
require_state.setPostgresBackupId(state, backup.backupId);
|
|
2329
2226
|
logger.log(` ✓ Postgres backup schedule created (${backupSchedule})`);
|
|
2330
2227
|
} else logger.log(" ✓ Using existing postgres backup schedule");
|
|
2331
2228
|
}
|
|
@@ -2392,12 +2289,12 @@ async function releaseDokploy(run) {
|
|
|
2392
2289
|
ctx.emit({
|
|
2393
2290
|
type: "app.failed",
|
|
2394
2291
|
app: appName,
|
|
2395
|
-
error:
|
|
2292
|
+
error: require_sniffer.eventError(error)
|
|
2396
2293
|
});
|
|
2397
2294
|
};
|
|
2398
2295
|
/** An image is pushed: worth keeping even if what follows fails. */
|
|
2399
2296
|
const built = async (appName, image, ref) => {
|
|
2400
|
-
|
|
2297
|
+
require_state.setDeployedImage(state, appName, {
|
|
2401
2298
|
ref: image.imageRef ?? ref,
|
|
2402
2299
|
...image.digest ? { digest: image.digest } : {}
|
|
2403
2300
|
});
|
|
@@ -2677,7 +2574,7 @@ async function ensureApplication(api, journal, appName, dokployAppName, projectI
|
|
|
2677
2574
|
action: via === "created" ? "create" : "reuse",
|
|
2678
2575
|
id: resource.applicationId
|
|
2679
2576
|
}, via);
|
|
2680
|
-
|
|
2577
|
+
require_state.setApplicationId(journal.state, appName, resource.applicationId);
|
|
2681
2578
|
return resource;
|
|
2682
2579
|
}
|
|
2683
2580
|
/**
|
|
@@ -2742,7 +2639,7 @@ async function dokployApi(workspace, ctx) {
|
|
|
2742
2639
|
kind: "dokploy",
|
|
2743
2640
|
...configured ? { endpoint: configured } : {}
|
|
2744
2641
|
}, { signal: ctx.signal });
|
|
2745
|
-
if (!creds) throw new
|
|
2642
|
+
if (!creds) throw new require_credentials.MissingCredential("dokploy", configured);
|
|
2746
2643
|
return {
|
|
2747
2644
|
api: new require_sniffer.DokployApi({
|
|
2748
2645
|
baseUrl: creds.endpoint,
|
|
@@ -2755,7 +2652,7 @@ async function dokployApi(workspace, ctx) {
|
|
|
2755
2652
|
/** Each app's public host, the same way the deploy resolves it. */
|
|
2756
2653
|
function hostOf(workspace, appName, stage) {
|
|
2757
2654
|
const app = workspace.apps[appName];
|
|
2758
|
-
return
|
|
2655
|
+
return require_state.resolveHost(appName, app, stage, workspace.deploy?.domains, app.type === "web" && require_state.isMainFrontendApp(appName, app, workspace.apps));
|
|
2759
2656
|
}
|
|
2760
2657
|
/**
|
|
2761
2658
|
* What a deploy would do, from the same lookups it starts with — and nothing
|
|
@@ -2804,7 +2701,7 @@ async function planDokploy(run) {
|
|
|
2804
2701
|
let registryPlanned;
|
|
2805
2702
|
const registry = await resolveRegistry(api, {
|
|
2806
2703
|
stage,
|
|
2807
|
-
registry: workspace.deploy.
|
|
2704
|
+
registry: workspace.deploy.registry,
|
|
2808
2705
|
configuredId: workspace.deploy.dokploy?.registryId,
|
|
2809
2706
|
stateId: state?.registryId,
|
|
2810
2707
|
log: (message) => logger.log(message),
|
|
@@ -2849,7 +2746,7 @@ async function planDokploy(run) {
|
|
|
2849
2746
|
resourceType: "application",
|
|
2850
2747
|
action: "create"
|
|
2851
2748
|
}, dokployAppName);
|
|
2852
|
-
const ref = require_store.imageRef(identity, appName, workspace.deploy.
|
|
2749
|
+
const ref = require_store.imageRef(identity, appName, workspace.deploy.registry, imageTag);
|
|
2853
2750
|
plan({
|
|
2854
2751
|
key: `image:${appName}`,
|
|
2855
2752
|
resourceType: "image",
|
|
@@ -2970,4 +2867,4 @@ Object.defineProperty(exports, "verifyDokploy", {
|
|
|
2970
2867
|
}
|
|
2971
2868
|
});
|
|
2972
2869
|
|
|
2973
|
-
//# sourceMappingURL=deploy-
|
|
2870
|
+
//# sourceMappingURL=deploy-Cy8igpQF.cjs.map
|