@geekmidas/cli 10.0.0-alpha.78 → 10.0.0-alpha.80
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/dist/{add-D2XKszYP.mjs → add-CIxT-Iq6.mjs} +2 -2
- package/dist/{add-D2XKszYP.mjs.map → add-CIxT-Iq6.mjs.map} +1 -1
- package/dist/{add-BvOICikp.cjs → add-DJ0VE-y-.cjs} +7 -7
- package/dist/{add-BvOICikp.cjs.map → add-DJ0VE-y-.cjs.map} +1 -1
- package/dist/{aws-Bja4zGSs.mjs → aws-B-6uEhgP.mjs} +8 -2
- package/dist/{aws-Bja4zGSs.mjs.map → aws-B-6uEhgP.mjs.map} +1 -1
- package/dist/{aws-CQAuluiu.cjs → aws-BTawF0F-.cjs} +19 -2
- package/dist/{aws-CQAuluiu.cjs.map → aws-BTawF0F-.cjs.map} +1 -1
- package/dist/{bundler-C6T-1OLT.cjs → bundler-BlbSLFLn.cjs} +3 -3
- package/dist/{bundler-C6T-1OLT.cjs.map → bundler-BlbSLFLn.cjs.map} +1 -1
- package/dist/{bundler-CtHzKqnZ.mjs → bundler-D4pl87A5.mjs} +3 -3
- package/dist/{bundler-CtHzKqnZ.mjs.map → bundler-D4pl87A5.mjs.map} +1 -1
- package/dist/{cli-BgPyhx1i.mjs → cli-7aLfgIGt.mjs} +3 -3
- package/dist/{cli-BgPyhx1i.mjs.map → cli-7aLfgIGt.mjs.map} +1 -1
- package/dist/{cli-K6Vj_pPW.cjs → cli-BkNZBe_-.cjs} +4 -4
- package/dist/{cli-K6Vj_pPW.cjs.map → cli-BkNZBe_-.cjs.map} +1 -1
- package/dist/{compose-B7MC19eC.cjs → compose-Bn4OJONR.cjs} +88 -60
- package/dist/{compose-B7MC19eC.cjs.map → compose-Bn4OJONR.cjs.map} +1 -1
- package/dist/{compose-DByK353T.mjs → compose-n7K8H5j8.mjs} +36 -8
- package/dist/{compose-DByK353T.mjs.map → compose-n7K8H5j8.mjs.map} +1 -1
- package/dist/{config-Bql0AmJt.d.mts → config-L_6NivCp.d.mts} +3 -3
- package/dist/{config-Bql0AmJt.d.mts.map → config-L_6NivCp.d.mts.map} +1 -1
- package/dist/{config-DlNpHK8p.d.cts → config-Mr4rcXFC.d.cts} +3 -3
- package/dist/{config-DlNpHK8p.d.cts.map → config-Mr4rcXFC.d.cts.map} +1 -1
- package/dist/config.d.cts +3 -3
- package/dist/config.d.mts +3 -3
- package/dist/{databases-C2p5LGAp.cjs → databases-BY-pEImp.cjs} +185 -7
- package/dist/databases-BY-pEImp.cjs.map +1 -0
- package/dist/{databases-hUHTuwhx.mjs → databases-CzszQV0N.mjs} +153 -5
- package/dist/databases-CzszQV0N.mjs.map +1 -0
- package/dist/deploy/public.cjs +12 -11
- package/dist/deploy/public.d.cts +19 -3
- package/dist/deploy/public.d.cts.map +1 -1
- package/dist/deploy/public.d.mts +19 -3
- package/dist/deploy/public.d.mts.map +1 -1
- package/dist/deploy/public.mjs +6 -6
- package/dist/{deploy-BerP7ppB.mjs → deploy-DK4Y6ev4.mjs} +3 -3
- package/dist/{deploy-BerP7ppB.mjs.map → deploy-DK4Y6ev4.mjs.map} +1 -1
- package/dist/{deploy-Dt42xiQA.cjs → deploy-Ppnh8MHS.cjs} +9 -9
- package/dist/{deploy-Dt42xiQA.cjs.map → deploy-Ppnh8MHS.cjs.map} +1 -1
- package/dist/{dokploy-ssZQRK2C.mjs → dokploy-Bjq05wkw.mjs} +2 -2
- package/dist/{dokploy-ssZQRK2C.mjs.map → dokploy-Bjq05wkw.mjs.map} +1 -1
- package/dist/{dokploy-NG9UrVrP.cjs → dokploy-CJvdoNc3.cjs} +2 -2
- package/dist/{dokploy-NG9UrVrP.cjs.map → dokploy-CJvdoNc3.cjs.map} +1 -1
- package/dist/{encryption-De6MN0O5.mjs → encryption-BrsOJFFz.mjs} +2 -2
- package/dist/{encryption-De6MN0O5.mjs.map → encryption-BrsOJFFz.mjs.map} +1 -1
- package/dist/{encryption-CbMI24fI.cjs → encryption-CAyR6D7B.cjs} +5 -5
- package/dist/{encryption-CbMI24fI.cjs.map → encryption-CAyR6D7B.cjs.map} +1 -1
- package/dist/{engine-CoCsNoW_.cjs → engine-DzBZR5D0.cjs} +118 -82
- package/dist/engine-DzBZR5D0.cjs.map +1 -0
- package/dist/{engine-DOjGIgl4.mjs → engine-ba9CvjTo.mjs} +53 -17
- package/dist/engine-ba9CvjTo.mjs.map +1 -0
- package/dist/github-BLjU59Ye.cjs +669 -0
- package/dist/github-BLjU59Ye.cjs.map +1 -0
- package/dist/github-CVdbVlT5.mjs +669 -0
- package/dist/github-CVdbVlT5.mjs.map +1 -0
- package/dist/{index-BXO0vlme.d.mts → index-C0UmP_lg.d.mts} +2 -2
- package/dist/{index-BXO0vlme.d.mts.map → index-C0UmP_lg.d.mts.map} +1 -1
- package/dist/{index-Rs0Fua-q.d.cts → index-DTEPwLml.d.cts} +2 -2
- package/dist/{index-Rs0Fua-q.d.cts.map → index-DTEPwLml.d.cts.map} +1 -1
- package/dist/index.cjs +114 -114
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +41 -41
- package/dist/index.mjs.map +1 -1
- package/dist/{migrate-Cgoy58Sh.cjs → migrate-DkB833Jj.cjs} +8 -9
- package/dist/{migrate-Cgoy58Sh.cjs.map → migrate-DkB833Jj.cjs.map} +1 -1
- package/dist/{migrate-CNKaQl3K.mjs → migrate-DlBgATa-.mjs} +3 -4
- package/dist/{migrate-CNKaQl3K.mjs.map → migrate-DlBgATa-.mjs.map} +1 -1
- package/dist/{migrate-B4GBvCNY.cjs → migrate-iEdyEx4S.cjs} +4 -4
- package/dist/{migrate-B4GBvCNY.cjs.map → migrate-iEdyEx4S.cjs.map} +1 -1
- package/dist/{migrate-BQ4wVKq_.mjs → migrate-pfu4aYzX.mjs} +2 -2
- package/dist/{migrate-BQ4wVKq_.mjs.map → migrate-pfu4aYzX.mjs.map} +1 -1
- package/dist/openapi.d.cts +1 -1
- package/dist/openapi.d.mts +1 -1
- package/dist/reconcile/public.d.cts +1 -1
- package/dist/reconcile/public.d.mts +1 -1
- package/dist/{resolve-CEaqRBzY.cjs → resolve-4_5N67Fk.cjs} +3 -3
- package/dist/{resolve-CEaqRBzY.cjs.map → resolve-4_5N67Fk.cjs.map} +1 -1
- package/dist/{resolve-mvaystiE.mjs → resolve-CQPn66jr.mjs} +3 -3
- package/dist/{resolve-mvaystiE.mjs.map → resolve-CQPn66jr.mjs.map} +1 -1
- package/dist/{rollback-S2C-Y9pB.mjs → rollback-C0cbdsM-.mjs} +3 -3
- package/dist/{rollback-S2C-Y9pB.mjs.map → rollback-C0cbdsM-.mjs.map} +1 -1
- package/dist/{rollback-F3P-rA-r.cjs → rollback-CgYUPLbq.cjs} +5 -5
- package/dist/{rollback-F3P-rA-r.cjs.map → rollback-CgYUPLbq.cjs.map} +1 -1
- package/dist/{runtime-D9AxGzrw.d.cts → runtime-D6A-C6zh.d.cts} +2 -2
- package/dist/{runtime-D9AxGzrw.d.cts.map → runtime-D6A-C6zh.d.cts.map} +1 -1
- package/dist/{runtime-Dflki3Vs.d.mts → runtime-ekxfPNM-.d.mts} +2 -2
- package/dist/{runtime-Dflki3Vs.d.mts.map → runtime-ekxfPNM-.d.mts.map} +1 -1
- package/dist/sandbox/migrate-worker.cjs +22 -8
- package/dist/sandbox/migrate-worker.cjs.map +1 -1
- package/dist/sandbox/migrate-worker.mjs +22 -8
- package/dist/sandbox/migrate-worker.mjs.map +1 -1
- package/dist/{secretsManager-Ti0oZwsS.mjs → secretsManager-Chs9VV2r.mjs} +8 -2
- package/dist/{secretsManager-Ti0oZwsS.mjs.map → secretsManager-Chs9VV2r.mjs.map} +1 -1
- package/dist/{secretsManager-DUXW3fQt.cjs → secretsManager-DcMlHnRC.cjs} +19 -2
- package/dist/{secretsManager-DUXW3fQt.cjs.map → secretsManager-DcMlHnRC.cjs.map} +1 -1
- package/dist/{stale-C5FqIVc8.mjs → seeds-BdkFpW0P.mjs} +64 -6
- package/dist/seeds-BdkFpW0P.mjs.map +1 -0
- package/dist/{stale-BsiPJI7Y.cjs → seeds-ZljwYV_p.cjs} +81 -5
- package/dist/seeds-ZljwYV_p.cjs.map +1 -0
- package/dist/sniffer-BjG-1mlD.cjs.map +1 -1
- package/dist/sniffer-ByWtH28i.mjs.map +1 -1
- package/dist/target/public.cjs +1 -1
- package/dist/target/public.d.cts +2 -2
- package/dist/target/public.d.mts +2 -2
- package/dist/target/public.mjs +1 -1
- package/dist/{types-DKxkXsKC.d.mts → types-BzCavjGt.d.mts} +29 -2
- package/dist/types-BzCavjGt.d.mts.map +1 -0
- package/dist/{types-ByY0zi3n.d.cts → types-DZtj9jeI.d.cts} +29 -2
- package/dist/types-DZtj9jeI.d.cts.map +1 -0
- package/dist/workspace/index.d.cts +2 -2
- package/dist/workspace/index.d.mts +2 -2
- package/package.json +15 -15
- package/dist/databases-C2p5LGAp.cjs.map +0 -1
- package/dist/databases-hUHTuwhx.mjs.map +0 -1
- package/dist/engine-CoCsNoW_.cjs.map +0 -1
- package/dist/engine-DOjGIgl4.mjs.map +0 -1
- package/dist/github-CwX9z89E.mjs +0 -213
- package/dist/github-CwX9z89E.mjs.map +0 -1
- package/dist/github-D9vGqdLk.cjs +0 -213
- package/dist/github-D9vGqdLk.cjs.map +0 -1
- package/dist/provider-B3Sv_a74.cjs +0 -173
- package/dist/provider-B3Sv_a74.cjs.map +0 -1
- package/dist/provider-D7rQzzzf.mjs +0 -138
- package/dist/provider-D7rQzzzf.mjs.map +0 -1
- package/dist/stale-BsiPJI7Y.cjs.map +0 -1
- package/dist/stale-C5FqIVc8.mjs.map +0 -1
- package/dist/types-ByY0zi3n.d.cts.map +0 -1
- package/dist/types-DKxkXsKC.d.mts.map +0 -1
|
@@ -5,9 +5,9 @@ import { c as runWorker, d as output, r as discover } from "./discover-BPelzeGW.
|
|
|
5
5
|
import { i as activeSandbox } from "./sandbox-Dm247NGx.mjs";
|
|
6
6
|
import { t as appKey } from "./derive-B4vDpzgP.mjs";
|
|
7
7
|
import { g as stripPublicPrefix, h as getPublicEnvPrefix, s as getAppBuildOrder } from "./workspace-BBdqmkch.mjs";
|
|
8
|
-
import {
|
|
8
|
+
import { $ as constructGlobs, B as manifestServiceDeclarations, Dt as WORKER_PORT, E as validateImageRef, F as STORAGE_KEY_PAIR, Ft as storageBackendFor, G as workerUnits, H as reportDevServices, L as assertExternalServices, Mt as cacheBackendFor, Nt as eventsBackendFor, O as isMainFrontendApp, P as ExternalServicesNotConfigured, Pt as providerOf, R as devServicesUsed, S as dockerCommand, St as resourceName, T as workerDockerfileOf, _ as DeployJournal, a as createEmptyState, an as imageName, b as DockerPushFailed, c as isDnsVerified, cn as markerOf, d as setApplicationId, dn as initStageSecrets, f as setBackupState, g as setPostgresBackupId, gt as dockerfileOf, h as setGeneratedSecret, i as assertNoStaleSecrets, j as otelEnv, k as resolveHost, l as recordRelease, ln as ownershipMarker, m as setDnsVerification, mn as toEmbeddableSecrets, n as reportDatabaseRuns, o as getBackupState, on as imageRef, p as setDnsRecord, r as reportPlannedSeeds, rn as applicationName, s as getGeneratedSecret, sn as isOwnedBy, st as applyPostgres, t as DeploySeedsFailed, u as recordRollback, un as projectName, v as withGeneratedSecrets, vt as workerEnvKeys, y as DockerBuildFailed, z as externalServices } from "./seeds-BdkFpW0P.mjs";
|
|
9
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-ByWtH28i.mjs";
|
|
10
|
-
import {
|
|
10
|
+
import { _ as migrationFiles, f as plannedSeeds } from "./databases-CzszQV0N.mjs";
|
|
11
11
|
import { n as assertStageCredentials } from "./credentialSchemas-BJqRJNK4.mjs";
|
|
12
12
|
import { join, relative } from "node:path";
|
|
13
13
|
import { chmod, mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
@@ -1914,15 +1914,17 @@ var DeployMigrationsFailed = class extends Error {
|
|
|
1914
1914
|
}
|
|
1915
1915
|
};
|
|
1916
1916
|
/**
|
|
1917
|
-
* The URLs a stage's migrations connect with, keyed as the migrator
|
|
1918
|
-
* them, grouped by the database their cluster serves — for the targets
|
|
1919
|
-
* have a migration to
|
|
1920
|
-
* nothing for a project that has
|
|
1917
|
+
* The URLs a stage's migrations and seeds connect with, keyed as the migrator
|
|
1918
|
+
* reads them, grouped by the database their cluster serves — for the targets
|
|
1919
|
+
* that have a migration or a seed to run. Empty when none does, so a deploy
|
|
1920
|
+
* publishes nothing for a project that has written neither.
|
|
1921
1921
|
*/
|
|
1922
1922
|
async function migrationUrls(root, manifest, env) {
|
|
1923
1923
|
const byDatabase = /* @__PURE__ */ new Map();
|
|
1924
1924
|
for (const target of migrationTargets(manifest)) {
|
|
1925
|
-
|
|
1925
|
+
const migrations = await migrationFiles(join(root, target.migrations));
|
|
1926
|
+
const seeds = await migrationFiles(join(root, target.seeds));
|
|
1927
|
+
if (migrations.size === 0 && seeds.size === 0) continue;
|
|
1926
1928
|
for (const role of ["ownerUrl", "url"]) {
|
|
1927
1929
|
const key = provideKey(target.id, role);
|
|
1928
1930
|
const url = env[key];
|
|
@@ -1939,8 +1941,14 @@ async function migrationUrls(root, manifest, env) {
|
|
|
1939
1941
|
const answer = discriminatedUnion("reason", [object({
|
|
1940
1942
|
reason: literal("migrated"),
|
|
1941
1943
|
runs: array(object({
|
|
1944
|
+
construct: string(),
|
|
1942
1945
|
migrations: string(),
|
|
1943
1946
|
applied: array(string())
|
|
1947
|
+
})),
|
|
1948
|
+
seeds: array(object({
|
|
1949
|
+
construct: string(),
|
|
1950
|
+
seeds: string(),
|
|
1951
|
+
seeded: array(string())
|
|
1944
1952
|
}))
|
|
1945
1953
|
}), object({
|
|
1946
1954
|
reason: literal("failed"),
|
|
@@ -1949,13 +1957,18 @@ const answer = discriminatedUnion("reason", [object({
|
|
|
1949
1957
|
message: string()
|
|
1950
1958
|
})
|
|
1951
1959
|
})]);
|
|
1952
|
-
/**
|
|
1960
|
+
/**
|
|
1961
|
+
* Apply every pending migration, then run every seed, in the sandbox, as each
|
|
1962
|
+
* construct's owner. A failing migration throws `DeployMigrationsFailed`, a
|
|
1963
|
+
* failing seed `DeploySeedsFailed` — either before any app is released.
|
|
1964
|
+
*/
|
|
1953
1965
|
async function runMigrations(options) {
|
|
1954
1966
|
const sandbox = options.sandbox ?? activeSandbox() ?? new LocalSandbox({ root: options.root });
|
|
1955
1967
|
const { value } = await runWorker(sandbox, "migrations", {
|
|
1956
1968
|
name: "migrate-worker",
|
|
1957
1969
|
args: [JSON.stringify({
|
|
1958
1970
|
root: options.root,
|
|
1971
|
+
stage: options.stage,
|
|
1959
1972
|
manifest: options.manifest,
|
|
1960
1973
|
patterns: options.patterns
|
|
1961
1974
|
})],
|
|
@@ -1965,8 +1978,15 @@ async function runMigrations(options) {
|
|
|
1965
1978
|
signal: options.signal,
|
|
1966
1979
|
schema: answer
|
|
1967
1980
|
});
|
|
1968
|
-
if (value.reason === "failed")
|
|
1969
|
-
|
|
1981
|
+
if (value.reason === "failed") {
|
|
1982
|
+
const { error } = value;
|
|
1983
|
+
if (error.name === "SeedFailed") throw new DeploySeedsFailed(options.stage, String(error.construct ?? "unknown"), String(error.seed ?? "unknown"), error);
|
|
1984
|
+
throw new DeployMigrationsFailed(options.stage, error.name, error.message);
|
|
1985
|
+
}
|
|
1986
|
+
return {
|
|
1987
|
+
migrations: value.runs,
|
|
1988
|
+
seeds: value.seeds
|
|
1989
|
+
};
|
|
1970
1990
|
}
|
|
1971
1991
|
//#endregion
|
|
1972
1992
|
//#region src/target/dokploy/postgres.ts
|
|
@@ -2938,15 +2958,15 @@ function failed(run, appName, error) {
|
|
|
2938
2958
|
});
|
|
2939
2959
|
}
|
|
2940
2960
|
/**
|
|
2941
|
-
* The stage's pending migrations
|
|
2942
|
-
* each cluster published for them. Nothing is
|
|
2943
|
-
* for a project with
|
|
2961
|
+
* The stage's pending migrations applied, then every seed run, in the
|
|
2962
|
+
* deploy's sandbox against each cluster published for them. Nothing is
|
|
2963
|
+
* published, and nothing runs, for a project with neither.
|
|
2944
2964
|
*/
|
|
2945
2965
|
async function migrate(run) {
|
|
2946
2966
|
const { workspace, manifest, stage, ctx } = run;
|
|
2947
2967
|
const { api, endpoint, migrations, declaredClusters } = run.provisioned;
|
|
2948
2968
|
if (migrations.size === 0) return;
|
|
2949
|
-
logger.log("\n🗄️ Applying migrations...");
|
|
2969
|
+
logger.log("\n🗄️ Applying migrations and seeds...");
|
|
2950
2970
|
const host = serverHostname(endpoint);
|
|
2951
2971
|
const urls = {};
|
|
2952
2972
|
for (const [database, keys] of migrations) {
|
|
@@ -2959,7 +2979,7 @@ async function migrate(run) {
|
|
|
2959
2979
|
}
|
|
2960
2980
|
for (const [key, url] of Object.entries(keys)) urls[key] = publishedUrl(url, published);
|
|
2961
2981
|
}
|
|
2962
|
-
const
|
|
2982
|
+
const ran = await runMigrations({
|
|
2963
2983
|
root: workspace.root,
|
|
2964
2984
|
stage,
|
|
2965
2985
|
manifest,
|
|
@@ -2967,7 +2987,16 @@ async function migrate(run) {
|
|
|
2967
2987
|
urls,
|
|
2968
2988
|
signal: ctx.signal
|
|
2969
2989
|
});
|
|
2970
|
-
for (const { migrations: folder, applied } of
|
|
2990
|
+
for (const { migrations: folder, applied } of ran.migrations) if (applied.length === 0) logger.log(` ✓ ${folder}: up to date`);
|
|
2991
|
+
reportDatabaseRuns(ran.migrations.map(({ construct, migrations: folder, applied }) => ({
|
|
2992
|
+
construct,
|
|
2993
|
+
folder,
|
|
2994
|
+
applied
|
|
2995
|
+
})), ran.seeds.map(({ construct, seeds: folder, seeded }) => ({
|
|
2996
|
+
construct,
|
|
2997
|
+
folder,
|
|
2998
|
+
seeded
|
|
2999
|
+
})), (line) => logger.log(` ${line}`), (event) => ctx.emit(event));
|
|
2971
3000
|
}
|
|
2972
3001
|
/**
|
|
2973
3002
|
* DNS records for `apps`' hosts, their propagation, and Dokploy's validation
|
|
@@ -3301,6 +3330,13 @@ async function planDokploy(run) {
|
|
|
3301
3330
|
resourceType: declaration.kind,
|
|
3302
3331
|
action: "ensure"
|
|
3303
3332
|
}, declaration.kind);
|
|
3333
|
+
reportPlannedSeeds((await plannedSeeds({
|
|
3334
|
+
root: workspace.root,
|
|
3335
|
+
manifest
|
|
3336
|
+
})).map(({ target, seeds }) => ({
|
|
3337
|
+
folder: target.seeds,
|
|
3338
|
+
seeds
|
|
3339
|
+
})), (line) => logger.log(` ${line}`));
|
|
3304
3340
|
const apps = [];
|
|
3305
3341
|
const urls = {};
|
|
3306
3342
|
for (const appName of appsToDeployNames) {
|
|
@@ -3397,4 +3433,4 @@ const MOBILE_SKIP_REASON = "deploys via its framework toolchain";
|
|
|
3397
3433
|
//#endregion
|
|
3398
3434
|
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 };
|
|
3399
3435
|
|
|
3400
|
-
//# sourceMappingURL=engine-
|
|
3436
|
+
//# sourceMappingURL=engine-ba9CvjTo.mjs.map
|