@geekmidas/cli 10.0.0-alpha.61 → 10.0.0-alpha.62
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/{HostingerProvider-DI_Pr2VE.mjs → HostingerProvider-B92qH4dC.mjs} +2 -2
- package/dist/{HostingerProvider-DI_Pr2VE.mjs.map → HostingerProvider-B92qH4dC.mjs.map} +1 -1
- package/dist/{HostingerProvider-CgDaD8VR.cjs → HostingerProvider-DyD1Hin8.cjs} +2 -2
- package/dist/{HostingerProvider-CgDaD8VR.cjs.map → HostingerProvider-DyD1Hin8.cjs.map} +1 -1
- package/dist/{LegacyStateStore-C7vFAxbu.mjs → LegacyStateStore-A8d2GdT7.mjs} +2 -2
- package/dist/{LegacyStateStore-C7vFAxbu.mjs.map → LegacyStateStore-A8d2GdT7.mjs.map} +1 -1
- package/dist/{LegacyStateStore-JbBVFp_2.cjs → LegacyStateStore-UHJEBLdn.cjs} +2 -2
- package/dist/{LegacyStateStore-JbBVFp_2.cjs.map → LegacyStateStore-UHJEBLdn.cjs.map} +1 -1
- package/dist/{LocalStateStore-DfUwQsL8.mjs → LocalStateStore-B51rnfgn.mjs} +2 -2
- package/dist/{LocalStateStore-DfUwQsL8.mjs.map → LocalStateStore-B51rnfgn.mjs.map} +1 -1
- package/dist/{LocalStateStore-DHj_-CQB.cjs → LocalStateStore-COW3Ldwa.cjs} +2 -2
- package/dist/{LocalStateStore-DHj_-CQB.cjs.map → LocalStateStore-COW3Ldwa.cjs.map} +1 -1
- package/dist/{S3StateStore-Dq6hHtzY.mjs → S3StateStore-CJewPhgz.mjs} +2 -2
- package/dist/{S3StateStore-Dq6hHtzY.mjs.map → S3StateStore-CJewPhgz.mjs.map} +1 -1
- package/dist/{S3StateStore-xqnpUrzy.cjs → S3StateStore-WUJGdRNL.cjs} +2 -2
- package/dist/{S3StateStore-xqnpUrzy.cjs.map → S3StateStore-WUJGdRNL.cjs.map} +1 -1
- package/dist/{SSMStateStore-5dBRwVlJ.cjs → SSMStateStore-Zejt42V8.cjs} +2 -2
- package/dist/{SSMStateStore-5dBRwVlJ.cjs.map → SSMStateStore-Zejt42V8.cjs.map} +1 -1
- package/dist/{SSMStateStore-SUmvAbLi.mjs → SSMStateStore-iK5UKp9d.mjs} +2 -2
- package/dist/{SSMStateStore-SUmvAbLi.mjs.map → SSMStateStore-iK5UKp9d.mjs.map} +1 -1
- package/dist/{bundler-DXATpO1T.cjs → bundler-CfH9frOS.cjs} +2 -2
- package/dist/{bundler-DXATpO1T.cjs.map → bundler-CfH9frOS.cjs.map} +1 -1
- package/dist/{bundler-B5VsKW-_.mjs → bundler-DN5r4x5b.mjs} +2 -2
- package/dist/{bundler-B5VsKW-_.mjs.map → bundler-DN5r4x5b.mjs.map} +1 -1
- package/dist/{cli-DQdrVkj2.cjs → cli-DOAUp80L.cjs} +12 -16
- package/dist/cli-DOAUp80L.cjs.map +1 -0
- package/dist/{cli-DEA_J3Sa.mjs → cli-DYwxmfsW.mjs} +10 -14
- package/dist/cli-DYwxmfsW.mjs.map +1 -0
- package/dist/{config-DXnkCEq0.cjs → config-BYh9S0cZ.cjs} +2 -2
- package/dist/config-BYh9S0cZ.cjs.map +1 -0
- package/dist/{config-C5-EEdmr.mjs → config-Bf4-bROQ.mjs} +2 -2
- package/dist/config-Bf4-bROQ.mjs.map +1 -0
- package/dist/config.cjs +2 -2
- package/dist/config.d.cts +2 -2
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +2 -2
- package/dist/define-CHBIEc5j.mjs +94 -0
- package/dist/define-CHBIEc5j.mjs.map +1 -0
- package/dist/define-Cv_QvDrg.cjs +141 -0
- package/dist/define-Cv_QvDrg.cjs.map +1 -0
- package/dist/deploy/public.cjs +28 -13
- package/dist/deploy/public.d.cts +38 -315
- package/dist/deploy/public.d.cts.map +1 -1
- package/dist/deploy/public.d.mts +38 -315
- package/dist/deploy/public.d.mts.map +1 -1
- package/dist/deploy/public.mjs +8 -3
- package/dist/{deploy-BJcLmVTc.mjs → deploy-B7jvUORo.mjs} +152 -532
- package/dist/deploy-B7jvUORo.mjs.map +1 -0
- package/dist/deploy-Cg9fae7a.mjs +133 -0
- package/dist/deploy-Cg9fae7a.mjs.map +1 -0
- package/dist/deploy-D8Qr-Xto.cjs +138 -0
- package/dist/deploy-D8Qr-Xto.cjs.map +1 -0
- package/dist/{deploy-BbJdgQ2b.cjs → deploy-DSaCYvcO.cjs} +168 -560
- package/dist/deploy-DSaCYvcO.cjs.map +1 -0
- package/dist/dokploy-CD9PY-3D.mjs +32 -0
- package/dist/dokploy-CD9PY-3D.mjs.map +1 -0
- package/dist/dokploy-Ey2foJLv.cjs +32 -0
- package/dist/dokploy-Ey2foJLv.cjs.map +1 -0
- package/dist/{encryption-DaA9gRXr.mjs → encryption-CVwvGbsL.mjs} +4 -4
- package/dist/{encryption-DaA9gRXr.mjs.map → encryption-CVwvGbsL.mjs.map} +1 -1
- package/dist/{encryption-ojzUo7-z.cjs → encryption-ChBk3hTj.cjs} +4 -4
- package/dist/{encryption-ojzUo7-z.cjs.map → encryption-ChBk3hTj.cjs.map} +1 -1
- package/dist/{github-DmCj2u95.mjs → github-BCB3_LBX.mjs} +3 -3
- package/dist/{github-DmCj2u95.mjs.map → github-BCB3_LBX.mjs.map} +1 -1
- package/dist/{github-Cq57poPj.cjs → github-OUgPDlqg.cjs} +3 -3
- package/dist/{github-Cq57poPj.cjs.map → github-OUgPDlqg.cjs.map} +1 -1
- package/dist/{index-UiWCaGzU.d.cts → index-BtXDZQuF.d.cts} +2 -2
- package/dist/{index-Da1-oa9W.d.mts.map → index-BtXDZQuF.d.cts.map} +1 -1
- package/dist/{index-Da1-oa9W.d.mts → index-DrKzpHl-.d.mts} +2 -2
- package/dist/{index-UiWCaGzU.d.cts.map → index-DrKzpHl-.d.mts.map} +1 -1
- package/dist/index.cjs +42 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +42 -41
- package/dist/index.mjs.map +1 -1
- package/dist/{migrate-5_J5JySj.mjs → migrate-BoHMqdCu.mjs} +4 -4
- package/dist/{migrate-5_J5JySj.mjs.map → migrate-BoHMqdCu.mjs.map} +1 -1
- package/dist/{migrate-BScRpCEx.cjs → migrate-dnaFMvOm.cjs} +4 -4
- package/dist/{migrate-BScRpCEx.cjs.map → migrate-dnaFMvOm.cjs.map} +1 -1
- package/dist/openapi.cjs +1 -1
- package/dist/openapi.d.cts +1 -1
- package/dist/openapi.d.mts +1 -1
- package/dist/openapi.mjs +1 -1
- package/dist/reconcile/public.d.cts +1 -1
- package/dist/reconcile/public.d.mts +1 -1
- package/dist/resolve-CFCIkm7m.mjs +170 -0
- package/dist/resolve-CFCIkm7m.mjs.map +1 -0
- package/dist/resolve-wbv66HjD.cjs +217 -0
- package/dist/resolve-wbv66HjD.cjs.map +1 -0
- package/dist/runtime-CMwtq0AL.cjs +163 -0
- package/dist/runtime-CMwtq0AL.cjs.map +1 -0
- package/dist/runtime-CXPlkZzs.d.mts +90 -0
- package/dist/runtime-CXPlkZzs.d.mts.map +1 -0
- package/dist/runtime-DbakJS8u.mjs +134 -0
- package/dist/runtime-DbakJS8u.mjs.map +1 -0
- package/dist/runtime-Dn_n-29S.d.cts +90 -0
- package/dist/runtime-Dn_n-29S.d.cts.map +1 -0
- package/dist/{sniffer-CQmJnNJM.cjs → sniffer-BsfPa-GA.cjs} +17 -14
- package/dist/sniffer-BsfPa-GA.cjs.map +1 -0
- package/dist/{sniffer-bdleks5l.mjs → sniffer-DHE2Nafd.mjs} +17 -14
- package/dist/sniffer-DHE2Nafd.mjs.map +1 -0
- package/dist/target/public.cjs +15 -0
- package/dist/target/public.d.cts +28 -0
- package/dist/target/public.d.cts.map +1 -0
- package/dist/target/public.d.mts +28 -0
- package/dist/target/public.d.mts.map +1 -0
- package/dist/target/public.mjs +4 -0
- package/dist/terminal-6oL0vANs.cjs +576 -0
- package/dist/terminal-6oL0vANs.cjs.map +1 -0
- package/dist/terminal-ByZNjuig.mjs +517 -0
- package/dist/terminal-ByZNjuig.mjs.map +1 -0
- package/dist/{types-efNLu9xu.d.cts → types-CfLKGfC_.d.mts} +624 -34
- package/dist/types-CfLKGfC_.d.mts.map +1 -0
- package/dist/{types-Bp1mVxG0.d.mts → types-DIA7Li-J.d.cts} +626 -34
- package/dist/types-DIA7Li-J.d.cts.map +1 -0
- package/dist/workspace/index.cjs +1 -1
- package/dist/workspace/index.d.cts +3 -3
- package/dist/workspace/index.d.mts +3 -3
- package/dist/workspace/index.mjs +1 -1
- package/dist/{workspace-B64Xk1Mb.cjs → workspace-B6zQO6RY.cjs} +229 -23
- package/dist/workspace-B6zQO6RY.cjs.map +1 -0
- package/dist/{workspace-Bp1xVaOz.mjs → workspace-BFe57es7.mjs} +229 -23
- package/dist/workspace-BFe57es7.mjs.map +1 -0
- package/package.json +23 -13
- package/dist/cli-DEA_J3Sa.mjs.map +0 -1
- package/dist/cli-DQdrVkj2.cjs.map +0 -1
- package/dist/config-C5-EEdmr.mjs.map +0 -1
- package/dist/config-DXnkCEq0.cjs.map +0 -1
- package/dist/deploy-BJcLmVTc.mjs.map +0 -1
- package/dist/deploy-BbJdgQ2b.cjs.map +0 -1
- package/dist/sniffer-CQmJnNJM.cjs.map +0 -1
- package/dist/sniffer-bdleks5l.mjs.map +0 -1
- package/dist/types-Bp1mVxG0.d.mts.map +0 -1
- package/dist/types-efNLu9xu.d.cts.map +0 -1
- package/dist/workspace-B64Xk1Mb.cjs.map +0 -1
- package/dist/workspace-Bp1xVaOz.mjs.map +0 -1
package/dist/deploy/public.d.cts
CHANGED
|
@@ -1,53 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as DeployEventError, Q as DeployEvent, _t as StateVersionConflict, at as DeployResult, bt as deployIdentity, ct as CredentialKinds, dt as MissingCredential, et as DeployEventType, ft as StoredCredentialsOptions, ht as StateLocked, it as AppDeployResult, lt as CredentialProvider, mt as storedCredentials, nt as ResourceChange, ot as Credential, pt as chainCredentials, rt as ResourceVia, st as CredentialKind, tt as DeployPhase, ut as CredentialRequest, yt as DeployIdentity, z as AnyDeployTarget } from "../types-DIA7Li-J.cjs";
|
|
2
|
+
import { a as TargetRuntimeMismatch, c as DeployTargetNotYetSupported, i as TargetPackageInvalid, l as UnknownDeployTarget, n as InvalidTargetOptions, o as ProviderRemoved, r as TargetEntryInvalid, s as TargetPackageNotFound, t as TargetRuntimeUndeclared } from "../runtime-Dn_n-29S.cjs";
|
|
2
3
|
import { ConstructManifest } from "@geekmidas/manifest";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Who a deploy is, on a target it shares with other workspaces.
|
|
6
|
-
*
|
|
7
|
-
* A Dokploy server is one flat namespace of projects, images and Docker
|
|
8
|
-
* service names. Deploys used to identify everything they made by the
|
|
9
|
-
* workspace name alone, so two workspaces called `shop` — or `Shop` and
|
|
10
|
-
* `shop` — deploying to one server landed in the same project, pushed over
|
|
11
|
-
* each other's images and redeployed each other's applications. A
|
|
12
|
-
* `DeployIdentity` is what a deploy names and claims its resources by instead.
|
|
13
|
-
*/
|
|
14
|
-
interface DeployIdentity {
|
|
15
|
-
/**
|
|
16
|
-
* Whose deploy this is — an organisation, a team, a repository. Two
|
|
17
|
-
* workspaces with the same name are told apart by it. Defaults to the
|
|
18
|
-
* kebab-cased workspace name; set `deploy.namespace` to choose one.
|
|
19
|
-
*/
|
|
20
|
-
readonly namespace: string;
|
|
21
|
-
/** The workspace name as the target spells it: lowercase, `[a-z0-9-]`. */
|
|
22
|
-
readonly project: string;
|
|
23
|
-
readonly stage: string;
|
|
24
|
-
/**
|
|
25
|
-
* `<namespace>/<project>`: what a Dokploy project is claimed by.
|
|
26
|
-
*
|
|
27
|
-
* The stage is not part of it because one Dokploy project holds every stage
|
|
28
|
-
* of a workspace, each as an environment — the key has to be the same from
|
|
29
|
-
* every stage that deploys into it.
|
|
30
|
-
*/
|
|
31
|
-
readonly key: string;
|
|
32
|
-
/**
|
|
33
|
-
* The prefix every name on the target carries: the project alone in the
|
|
34
|
-
* default namespace, `<namespace>-<project>` in any other.
|
|
35
|
-
*
|
|
36
|
-
* The default adds nothing so that a workspace that never set a namespace
|
|
37
|
-
* keeps the names it was already deployed under — a Postgres is found by
|
|
38
|
-
* its name, and a new name would be a new, empty database.
|
|
39
|
-
*/
|
|
40
|
-
readonly scope: string;
|
|
41
|
-
}
|
|
42
|
-
/** What an identity is derived from: a workspace's name and namespace. */
|
|
43
|
-
interface IdentitySource {
|
|
44
|
-
name: string;
|
|
45
|
-
deploy?: {
|
|
46
|
-
namespace?: string;
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
export declare function deployIdentity(workspace: IdentitySource, stage: string): DeployIdentity;
|
|
50
|
-
//#endregion
|
|
4
|
+
import "@geekmidas/envkit/sniffer";
|
|
51
5
|
//#region src/home.d.ts
|
|
52
6
|
/**
|
|
53
7
|
* Where the CLI keeps what belongs to a person rather than a project: stage
|
|
@@ -62,260 +16,6 @@ export declare const GKM_HOME_ENV = "GKM_HOME";
|
|
|
62
16
|
/** The CLI's home: `GKM_HOME` if set, else `~/.gkm`. */
|
|
63
17
|
export declare function gkmHome(env?: NodeJS.ProcessEnv): string;
|
|
64
18
|
//#endregion
|
|
65
|
-
//#region src/deploy/credentials.d.ts
|
|
66
|
-
/**
|
|
67
|
-
* How a deploy gets the credentials it acts with.
|
|
68
|
-
*
|
|
69
|
-
* `deploy()` never prompts and never reads a terminal: it asks a
|
|
70
|
-
* `CredentialProvider` and, when the provider has nothing, stops with
|
|
71
|
-
* `MissingCredential` naming what it needed and how to supply it. Whether to
|
|
72
|
-
* ask a person, read a vault or fail is the caller's decision — `gkm deploy`
|
|
73
|
-
* prompts at a terminal and stores what was typed; a CI job sets the
|
|
74
|
-
* environment; a host passes its own provider.
|
|
75
|
-
*/
|
|
76
|
-
/** What each kind of credential is asked for with, and what it is. */
|
|
77
|
-
interface CredentialKinds {
|
|
78
|
-
/** The Dokploy API a stage deploys through. */
|
|
79
|
-
dokploy: {
|
|
80
|
-
/** `deploy.dokploy.endpoint`, when the config names one. */
|
|
81
|
-
request: {
|
|
82
|
-
endpoint?: string;
|
|
83
|
-
};
|
|
84
|
-
value: {
|
|
85
|
-
endpoint: string;
|
|
86
|
-
token: string;
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
/**
|
|
90
|
-
* A container registry login, for Dokploy to pull with. Asked for only when
|
|
91
|
-
* Dokploy has no registry for `deploy.dokploy.registry` and one has to be
|
|
92
|
-
* created.
|
|
93
|
-
*/
|
|
94
|
-
registry: {
|
|
95
|
-
/** `deploy.dokploy.registry`. */
|
|
96
|
-
request: {
|
|
97
|
-
url: string;
|
|
98
|
-
};
|
|
99
|
-
value: {
|
|
100
|
-
username: string;
|
|
101
|
-
password: string;
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
type CredentialKind = keyof CredentialKinds;
|
|
106
|
-
/** What a deploy asks a provider for. */
|
|
107
|
-
type CredentialRequest<K extends CredentialKind = CredentialKind> = { [P in K]: {
|
|
108
|
-
kind: P;
|
|
109
|
-
} & CredentialKinds[P]['request']; }[K];
|
|
110
|
-
/** What a provider answers with. */
|
|
111
|
-
type Credential<K extends CredentialKind> = CredentialKinds[K]['value'];
|
|
112
|
-
interface CredentialProvider {
|
|
113
|
-
/**
|
|
114
|
-
* The credential `request` asks for, or `undefined` when this provider has
|
|
115
|
-
* none — the deploy then raises {@link MissingCredential}.
|
|
116
|
-
*/
|
|
117
|
-
get<K extends CredentialKind>(request: CredentialRequest<K>, options?: {
|
|
118
|
-
signal?: AbortSignal;
|
|
119
|
-
}): Promise<Credential<K> | undefined>;
|
|
120
|
-
}
|
|
121
|
-
/** A deploy needed a credential, and its provider had none. */
|
|
122
|
-
export declare class MissingCredential extends Error {
|
|
123
|
-
readonly kind: CredentialKind;
|
|
124
|
-
/** What it was for: the Dokploy endpoint or the registry URL. */
|
|
125
|
-
readonly target: string | undefined;
|
|
126
|
-
/** How to supply it. */
|
|
127
|
-
readonly howToProvide: string;
|
|
128
|
-
constructor(kind: CredentialKind,
|
|
129
|
-
/** What it was for: the Dokploy endpoint or the registry URL. */
|
|
130
|
-
target: string | undefined,
|
|
131
|
-
/** How to supply it. */
|
|
132
|
-
howToProvide?: string);
|
|
133
|
-
}
|
|
134
|
-
/** Whatever was asked for, from the first provider that has it. */
|
|
135
|
-
export declare function chainCredentials(...providers: CredentialProvider[]): CredentialProvider;
|
|
136
|
-
interface StoredCredentialsOptions {
|
|
137
|
-
/** Where to read the variables from. Defaults to `process.env`. */
|
|
138
|
-
env?: NodeJS.ProcessEnv;
|
|
139
|
-
/**
|
|
140
|
-
* The CLI's home, whose `credentials.json` holds stored logins. Defaults
|
|
141
|
-
* to `GKM_HOME`, else `~/.gkm`.
|
|
142
|
-
*/
|
|
143
|
-
home?: string;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Credentials from the environment, then from what `gkm login` stored. What
|
|
147
|
-
* `deploy()` uses when it is handed no provider.
|
|
148
|
-
*
|
|
149
|
-
* - Dokploy: `DOKPLOY_API_TOKEN` / `DOKPLOY_ENDPOINT`, each falling back to
|
|
150
|
-
* the stored login, and the endpoint finally to `deploy.dokploy.endpoint`.
|
|
151
|
-
* Each half is read on its own: a token is a secret and belongs in the
|
|
152
|
-
* environment, an endpoint is configuration and belongs in the config.
|
|
153
|
-
* - Registry: `DOCKER_REGISTRY_USERNAME` / `DOCKER_REGISTRY_PASSWORD`.
|
|
154
|
-
*/
|
|
155
|
-
export declare function storedCredentials(options?: StoredCredentialsOptions): CredentialProvider;
|
|
156
|
-
//#endregion
|
|
157
|
-
//#region src/deploy/types.d.ts
|
|
158
|
-
/** Result for a single app deployment in workspace mode */
|
|
159
|
-
interface AppDeployResult {
|
|
160
|
-
/** App name */
|
|
161
|
-
appName: string;
|
|
162
|
-
/** App type */
|
|
163
|
-
type: 'backend' | 'web' | 'mobile';
|
|
164
|
-
/** Whether deployment succeeded */
|
|
165
|
-
success: boolean;
|
|
166
|
-
/** Dokploy application ID */
|
|
167
|
-
applicationId?: string;
|
|
168
|
-
/** Docker image reference */
|
|
169
|
-
imageRef?: string;
|
|
170
|
-
/** The registry's digest for the image, `sha256:…`, once pushed */
|
|
171
|
-
digest?: string;
|
|
172
|
-
/** Deployment URL */
|
|
173
|
-
url?: string;
|
|
174
|
-
/** Error message if failed */
|
|
175
|
-
error?: string;
|
|
176
|
-
}
|
|
177
|
-
/** Result from workspace deployment */
|
|
178
|
-
interface WorkspaceDeployResult {
|
|
179
|
-
/** Results for each app */
|
|
180
|
-
apps: AppDeployResult[];
|
|
181
|
-
/** Dokploy project ID */
|
|
182
|
-
projectId: string;
|
|
183
|
-
/** Total number of successful deployments */
|
|
184
|
-
successCount: number;
|
|
185
|
-
/** Total number of failed deployments */
|
|
186
|
-
failedCount: number;
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* What a deploy did — or, for a dry run, would do. Plain JSON, so it can be
|
|
190
|
-
* written out as is (`gkm deploy --json` ends with it).
|
|
191
|
-
*/
|
|
192
|
-
interface DeployResult extends WorkspaceDeployResult {
|
|
193
|
-
stage: string;
|
|
194
|
-
/** `<namespace>/<project>`. */
|
|
195
|
-
identity: string;
|
|
196
|
-
/** The image tag every app was built with. */
|
|
197
|
-
tag: string;
|
|
198
|
-
/** Whether this was a dry run: nothing was created, built or pushed. */
|
|
199
|
-
dryRun: boolean;
|
|
200
|
-
/** Dokploy's environment for the stage; empty when a dry run would create it. */
|
|
201
|
-
environmentId: string;
|
|
202
|
-
/** Apps left out, and why — a mobile app, another deploy target. */
|
|
203
|
-
skipped: {
|
|
204
|
-
app: string;
|
|
205
|
-
reason: string;
|
|
206
|
-
}[];
|
|
207
|
-
/** Each deployed app's public URL. */
|
|
208
|
-
urls: Record<string, string>;
|
|
209
|
-
/**
|
|
210
|
-
* Every resource the run touched, in order: what it applied, or for a dry
|
|
211
|
-
* run, what it would.
|
|
212
|
-
*/
|
|
213
|
-
changes: ResourceChange[];
|
|
214
|
-
}
|
|
215
|
-
//#endregion
|
|
216
|
-
//#region src/deploy/events.d.ts
|
|
217
|
-
/**
|
|
218
|
-
* The stretch of a deploy an event belongs to.
|
|
219
|
-
*
|
|
220
|
-
* - `validate`: the config, the stage, the apps, the lock, the stage's secrets
|
|
221
|
-
* and what each app reads from its environment
|
|
222
|
-
* - `plan`: a dry run's lookups — what would be created and what reused
|
|
223
|
-
* - `provision`: the Dokploy project, environment and registry, and the
|
|
224
|
-
* declared constructs
|
|
225
|
-
* - `release`: each app's image built, pushed and deployed
|
|
226
|
-
* - `verify`: DNS records and Dokploy's domain validation
|
|
227
|
-
*/
|
|
228
|
-
type DeployPhase = 'validate' | 'plan' | 'provision' | 'release' | 'verify';
|
|
229
|
-
/** An error, as an event carries it. */
|
|
230
|
-
interface DeployEventError {
|
|
231
|
-
/** The error's class name — `MissingCredential`, `StateLocked`. */
|
|
232
|
-
name: string;
|
|
233
|
-
message: string;
|
|
234
|
-
}
|
|
235
|
-
/**
|
|
236
|
-
* How a resource came to be used:
|
|
237
|
-
* - `recorded`: the id the stage's state holds still resolves
|
|
238
|
-
* - `resumed`: a run that died after creating it is picked up
|
|
239
|
-
* - `found`: it existed and was looked up
|
|
240
|
-
* - `created`: this run created it
|
|
241
|
-
*/
|
|
242
|
-
type ResourceVia = 'recorded' | 'resumed' | 'found' | 'created';
|
|
243
|
-
/** One resource a deploy touches, planned or applied. */
|
|
244
|
-
interface ResourceChange {
|
|
245
|
-
/** `<type>:<name>`, unique within the stage — `application:api`. */
|
|
246
|
-
key: string;
|
|
247
|
-
/** `project`, `environment`, `registry`, `application`, `domain`, `image`, or a construct's kind. */
|
|
248
|
-
resourceType: string;
|
|
249
|
-
/**
|
|
250
|
-
* For a plan: whether the run would create it, reuse what exists, or
|
|
251
|
-
* ensure it (look it up, and create it if missing). For an applied change:
|
|
252
|
-
* what was done.
|
|
253
|
-
*/
|
|
254
|
-
action: 'create' | 'reuse' | 'ensure' | 'build';
|
|
255
|
-
/** The target's id, once there is one. */
|
|
256
|
-
id?: string;
|
|
257
|
-
}
|
|
258
|
-
type DeployEvent = {
|
|
259
|
-
type: 'deploy.started';
|
|
260
|
-
stage: string;
|
|
261
|
-
/** `<namespace>/<project>`. */
|
|
262
|
-
identity: string;
|
|
263
|
-
tag: string;
|
|
264
|
-
/** The apps this run deploys, in order. */
|
|
265
|
-
apps: string[];
|
|
266
|
-
dryRun: boolean;
|
|
267
|
-
} | {
|
|
268
|
-
type: 'phase.started';
|
|
269
|
-
phase: DeployPhase;
|
|
270
|
-
} | {
|
|
271
|
-
type: 'phase.finished';
|
|
272
|
-
phase: DeployPhase;
|
|
273
|
-
} |
|
|
274
|
-
/**
|
|
275
|
-
* A progress line, exactly as `gkm deploy` prints it — leading newline and
|
|
276
|
-
* indentation included, so a terminal renderer prints `message` as is.
|
|
277
|
-
*/
|
|
278
|
-
{
|
|
279
|
-
type: 'log';
|
|
280
|
-
level: 'info' | 'warn' | 'error';
|
|
281
|
-
message: string;
|
|
282
|
-
} | {
|
|
283
|
-
type: 'app.skipped';
|
|
284
|
-
app: string;
|
|
285
|
-
reason: string;
|
|
286
|
-
} | ({
|
|
287
|
-
type: 'resource.planned';
|
|
288
|
-
} & ResourceChange) | ({
|
|
289
|
-
type: 'resource.applied';
|
|
290
|
-
via: ResourceVia;
|
|
291
|
-
} & ResourceChange & {
|
|
292
|
-
id: string;
|
|
293
|
-
}) | {
|
|
294
|
-
type: 'artifact.built';
|
|
295
|
-
app: string;
|
|
296
|
-
imageRef: string;
|
|
297
|
-
/** The registry's digest, `sha256:…`, once pushed. */
|
|
298
|
-
digest?: string;
|
|
299
|
-
} | {
|
|
300
|
-
type: 'app.deployed';
|
|
301
|
-
app: string;
|
|
302
|
-
applicationId: string;
|
|
303
|
-
imageRef: string;
|
|
304
|
-
url: string;
|
|
305
|
-
} | {
|
|
306
|
-
type: 'app.failed';
|
|
307
|
-
app: string;
|
|
308
|
-
error: DeployEventError;
|
|
309
|
-
} | {
|
|
310
|
-
type: 'deploy.finished';
|
|
311
|
-
result: DeployResult;
|
|
312
|
-
} | {
|
|
313
|
-
type: 'deploy.failed';
|
|
314
|
-
error: DeployEventError;
|
|
315
|
-
};
|
|
316
|
-
/** Every `type` a deploy event can have. */
|
|
317
|
-
type DeployEventType = DeployEvent['type'];
|
|
318
|
-
//#endregion
|
|
319
19
|
//#region src/deploy/deploy.d.ts
|
|
320
20
|
/**
|
|
321
21
|
* Where a run's progress lines go, besides its events. `@geekmidas/logger`'s
|
|
@@ -334,6 +34,17 @@ interface DeployInput {
|
|
|
334
34
|
cwd: string;
|
|
335
35
|
/** The stage to deploy — one of the config's deployed stages. */
|
|
336
36
|
stage: string;
|
|
37
|
+
/**
|
|
38
|
+
* The target to deploy through, by name. Defaults to `deploy.default`,
|
|
39
|
+
* else `dokploy`.
|
|
40
|
+
*/
|
|
41
|
+
target?: string;
|
|
42
|
+
/**
|
|
43
|
+
* The host's own targets, by name. Consulted before the built-ins and the
|
|
44
|
+
* config's `deploy.targets`, so a host can deploy through an
|
|
45
|
+
* implementation of its own — `{ dokploy: myDokploy }` included.
|
|
46
|
+
*/
|
|
47
|
+
targets?: Record<string, AnyDeployTarget>;
|
|
337
48
|
/** The image tag. Defaults to `<stage>-<timestamp>`. */
|
|
338
49
|
tag?: string;
|
|
339
50
|
/** Deploy only these apps (in dependency order). Defaults to all. */
|
|
@@ -397,17 +108,6 @@ interface DeployRun extends AsyncIterable<DeployEvent> {
|
|
|
397
108
|
export declare function deploy(input: DeployInput): DeployRun;
|
|
398
109
|
//#endregion
|
|
399
110
|
//#region src/deploy/index.d.ts
|
|
400
|
-
/** Apps were asked for by name that the workspace does not have. */
|
|
401
|
-
export declare class UnknownDeployApps extends Error {
|
|
402
|
-
readonly apps: readonly string[];
|
|
403
|
-
readonly available: readonly string[];
|
|
404
|
-
constructor(apps: readonly string[], available: readonly string[]);
|
|
405
|
-
}
|
|
406
|
-
/** Every app asked for deploys somewhere other than Dokploy. */
|
|
407
|
-
export declare class NoDeployableApps extends Error {
|
|
408
|
-
readonly stage: string;
|
|
409
|
-
constructor(stage: string);
|
|
410
|
-
}
|
|
411
111
|
/** A backend failed, so the run stopped before deploying anything after it. */
|
|
412
112
|
export declare class BackendDeployFailed extends Error {
|
|
413
113
|
readonly app: string;
|
|
@@ -421,6 +121,29 @@ export declare class MissingEnvVars extends Error {
|
|
|
421
121
|
constructor(app: string, missing: readonly string[], stage: string);
|
|
422
122
|
}
|
|
423
123
|
//#endregion
|
|
124
|
+
//#region src/deploy/orchestrate.d.ts
|
|
125
|
+
/** Apps were asked for by name that the workspace does not have. */
|
|
126
|
+
export declare class UnknownDeployApps extends Error {
|
|
127
|
+
readonly apps: readonly string[];
|
|
128
|
+
readonly available: readonly string[];
|
|
129
|
+
constructor(apps: readonly string[], available: readonly string[]);
|
|
130
|
+
}
|
|
131
|
+
/** Every app asked for deploys through some other target. */
|
|
132
|
+
export declare class NoDeployableApps extends Error {
|
|
133
|
+
readonly stage: string;
|
|
134
|
+
readonly target: string;
|
|
135
|
+
constructor(stage: string, target: string);
|
|
136
|
+
}
|
|
137
|
+
/** A failed rollback, after the failure that called for it. */
|
|
138
|
+
export declare class RollbackFailed extends Error {
|
|
139
|
+
readonly target: string;
|
|
140
|
+
/** What failed first, and was being rolled back. */
|
|
141
|
+
readonly failure: unknown;
|
|
142
|
+
constructor(target: string,
|
|
143
|
+
/** What failed first, and was being rolled back. */
|
|
144
|
+
failure: unknown, cause: unknown);
|
|
145
|
+
}
|
|
146
|
+
//#endregion
|
|
424
147
|
//#region src/deploy/ownership.d.ts
|
|
425
148
|
/**
|
|
426
149
|
* A Dokploy project with the name this deploy would use exists, and nothing
|
|
@@ -455,5 +178,5 @@ export declare class RegistryAmbiguous extends Error {
|
|
|
455
178
|
constructor(registry: string, registryIds: readonly string[]);
|
|
456
179
|
}
|
|
457
180
|
//#endregion
|
|
458
|
-
export { type AppDeployResult, type Credential, type CredentialKind, type CredentialKinds, type CredentialProvider, type CredentialRequest, type DeployEvent, type DeployEventError, type DeployEventType, type DeployIdentity, type DeployInput, type DeployLogger, type DeployPhase, type DeployResult, type DeployRun, type ResourceChange, type ResourceVia, StateLocked, StateVersionConflict, type StoredCredentialsOptions };
|
|
181
|
+
export { type AppDeployResult, type Credential, type CredentialKind, type CredentialKinds, type CredentialProvider, type CredentialRequest, type DeployEvent, type DeployEventError, type DeployEventType, type DeployIdentity, type DeployInput, type DeployLogger, type DeployPhase, type DeployResult, type DeployRun, DeployTargetNotYetSupported, InvalidTargetOptions, MissingCredential, ProviderRemoved, type ResourceChange, type ResourceVia, StateLocked, StateVersionConflict, type StoredCredentialsOptions, TargetEntryInvalid, TargetPackageInvalid, TargetPackageNotFound, TargetRuntimeMismatch, TargetRuntimeUndeclared, UnknownDeployTarget, chainCredentials, deployIdentity, storedCredentials };
|
|
459
182
|
//# sourceMappingURL=public.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.cts","names":[],"sources":["../../src/
|
|
1
|
+
{"version":3,"file":"public.d.cts","names":[],"sources":["../../src/home.ts","../../src/deploy/deploy.ts","../../src/deploy/index.ts","../../src/deploy/orchestrate.ts","../../src/deploy/ownership.ts","../../src/deploy/registry.ts"],"mappings":";;;;;;;;;;;;;;qBAaa;;wBAGG,QAAQ,MAAK,OAAO;;;;;;;UCanB;EAChB,KAAK;EACL,KAAK;EACL,OAAO;;UAGS;;;;;EAKhB;;EAEA;;;;;EAKA;;;;;;EAMA,UAAU,eAAe;;EAEzB;;EAEA;;;;;;EAMA;;;;;;EAMA,cAAc;;EAEd,SAAS;;;;;;EAMT,SAAS;;;;;EAKT;;;;;EAKA;;;UAIgB,kBAAkB,cAAc;;;;;;WAMvC,QAAQ,QAAQ;;;;;;;;;;;;;;;;;;wBAqEV,OAAO,OAAO,cAAc;;;;qBCqV/B,4BAA4B;WAE9B;EADV,YACU,aACT;;;qBAWW,uBAAuB;WAEzB;WACA;WACA;EAHV,YACU,aACA,4BACA;;;;;qBCvcE,0BAA0B;WAE5B;WACA;EAFV,YACU,yBACA;;;qBAWE,yBAAyB;WAE3B;WACA;EAFV,YACU,eACA;;;qBAUE,uBAAuB;WAEzB;;WAEA;EAHV,YACU,gBAEA;;EAAA,kBACT;;;;;;;;qBC1EW,wBAAwB;WAE1B;WACA;WACA;;WAEA;EALV,YACU,qBACA,mBACA,kBAEA;;EAAA;;;;;qBChBE,8BAA8B;WACrB;EAArB,YAAqB;;;qBAUT,yBAAyB;WAChB;EAArB,YAAqB;;;qBAUT,0BAA0B;WAE5B;WACA;EAFV,YACU,kBACA"}
|