@cardelli/ambit 0.1.5 → 0.2.0

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 (139) hide show
  1. package/esm/cli/commands/create/index.d.ts +2 -0
  2. package/esm/cli/commands/create/index.d.ts.map +1 -0
  3. package/esm/cli/commands/create/index.js +292 -0
  4. package/esm/cli/commands/create/machine.d.ts +33 -0
  5. package/esm/cli/commands/create/machine.d.ts.map +1 -0
  6. package/esm/cli/commands/create/machine.js +162 -0
  7. package/esm/cli/commands/deploy/index.d.ts +2 -0
  8. package/esm/cli/commands/deploy/index.d.ts.map +1 -0
  9. package/esm/cli/commands/deploy/index.js +290 -0
  10. package/esm/cli/commands/deploy/machine.d.ts +52 -0
  11. package/esm/cli/commands/deploy/machine.d.ts.map +1 -0
  12. package/esm/cli/commands/deploy/machine.js +116 -0
  13. package/esm/cli/commands/deploy/modes.d.ts +18 -0
  14. package/esm/cli/commands/deploy/modes.d.ts.map +1 -0
  15. package/esm/cli/commands/deploy/modes.js +152 -0
  16. package/esm/cli/commands/destroy/app.d.ts +2 -0
  17. package/esm/cli/commands/destroy/app.d.ts.map +1 -0
  18. package/esm/cli/commands/destroy/app.js +173 -0
  19. package/esm/cli/commands/destroy/index.d.ts +2 -0
  20. package/esm/cli/commands/destroy/index.d.ts.map +1 -0
  21. package/esm/cli/commands/destroy/index.js +63 -0
  22. package/esm/cli/commands/destroy/network.d.ts +2 -0
  23. package/esm/cli/commands/destroy/network.d.ts.map +1 -0
  24. package/esm/cli/commands/destroy/network.js +210 -0
  25. package/esm/cli/commands/doctor.d.ts.map +1 -0
  26. package/esm/cli/commands/doctor.js +295 -0
  27. package/esm/{src/cli → cli}/commands/list.d.ts.map +1 -1
  28. package/esm/{src/cli → cli}/commands/list.js +39 -54
  29. package/esm/cli/commands/status.d.ts.map +1 -0
  30. package/esm/cli/commands/status.js +331 -0
  31. package/esm/cli/mod.d.ts.map +1 -0
  32. package/esm/{src/cli → cli}/mod.js +4 -4
  33. package/esm/deno.d.ts +4 -18
  34. package/esm/deno.js +5 -19
  35. package/esm/deps/jsr.io/@std/path/1.1.4/constants.d.ts +1 -1
  36. package/esm/lib/args.d.ts +11 -0
  37. package/esm/lib/args.d.ts.map +1 -0
  38. package/esm/lib/args.js +28 -0
  39. package/esm/lib/cli.d.ts +0 -1
  40. package/esm/lib/cli.d.ts.map +1 -1
  41. package/esm/lib/cli.js +0 -1
  42. package/esm/lib/command.d.ts +0 -3
  43. package/esm/lib/command.d.ts.map +1 -1
  44. package/esm/lib/command.js +2 -13
  45. package/esm/lib/machine.d.ts +11 -0
  46. package/esm/lib/machine.d.ts.map +1 -0
  47. package/esm/lib/machine.js +15 -0
  48. package/esm/lib/output.d.ts +2 -1
  49. package/esm/lib/output.d.ts.map +1 -1
  50. package/esm/lib/output.js +21 -3
  51. package/esm/lib/result.d.ts +0 -1
  52. package/esm/lib/result.d.ts.map +1 -1
  53. package/esm/lib/result.js +0 -1
  54. package/esm/main.d.ts +6 -6
  55. package/esm/main.d.ts.map +1 -1
  56. package/esm/main.js +7 -9
  57. package/esm/providers/fly.d.ts +81 -0
  58. package/esm/providers/fly.d.ts.map +1 -0
  59. package/esm/providers/fly.js +372 -0
  60. package/esm/providers/tailscale.d.ts +31 -0
  61. package/esm/providers/tailscale.d.ts.map +1 -0
  62. package/esm/providers/tailscale.js +150 -0
  63. package/esm/{src/schemas → schemas}/fly.d.ts +1 -11
  64. package/esm/schemas/fly.d.ts.map +1 -0
  65. package/esm/{src/schemas → schemas}/fly.js +14 -56
  66. package/esm/{src/schemas → schemas}/tailscale.d.ts +1 -2
  67. package/esm/schemas/tailscale.d.ts.map +1 -0
  68. package/esm/{src/schemas → schemas}/tailscale.js +2 -3
  69. package/esm/src/{docker/router → router}/Dockerfile +0 -11
  70. package/esm/src/{docker/router → router}/start.sh +18 -9
  71. package/esm/util/constants.d.ts +13 -0
  72. package/esm/util/constants.d.ts.map +1 -0
  73. package/esm/util/constants.js +34 -0
  74. package/esm/{src → util}/credentials.d.ts +0 -1
  75. package/esm/util/credentials.d.ts.map +1 -0
  76. package/esm/{src → util}/credentials.js +3 -5
  77. package/esm/{src → util}/discovery.d.ts +16 -3
  78. package/esm/util/discovery.d.ts.map +1 -0
  79. package/esm/{src → util}/discovery.js +24 -15
  80. package/esm/util/fly-transforms.d.ts +27 -0
  81. package/esm/util/fly-transforms.d.ts.map +1 -0
  82. package/esm/util/fly-transforms.js +87 -0
  83. package/esm/{src → util}/guard.d.ts +1 -2
  84. package/esm/util/guard.d.ts.map +1 -0
  85. package/esm/{src → util}/guard.js +27 -27
  86. package/esm/util/naming.d.ts +5 -0
  87. package/esm/util/naming.d.ts.map +1 -0
  88. package/esm/util/naming.js +12 -0
  89. package/esm/{src → util}/resolve.d.ts +2 -3
  90. package/esm/util/resolve.d.ts.map +1 -0
  91. package/esm/{src → util}/resolve.js +1 -2
  92. package/esm/util/session.d.ts +16 -0
  93. package/esm/util/session.d.ts.map +1 -0
  94. package/esm/util/session.js +19 -0
  95. package/esm/util/tailscale-local.d.ts +13 -0
  96. package/esm/util/tailscale-local.d.ts.map +1 -0
  97. package/esm/util/tailscale-local.js +63 -0
  98. package/esm/{src → util}/template.d.ts +0 -1
  99. package/esm/util/template.d.ts.map +1 -0
  100. package/esm/{src → util}/template.js +0 -1
  101. package/package.json +1 -49
  102. package/esm/lib/paths.d.ts +0 -3
  103. package/esm/lib/paths.d.ts.map +0 -1
  104. package/esm/lib/paths.js +0 -5
  105. package/esm/src/cli/commands/create.d.ts +0 -2
  106. package/esm/src/cli/commands/create.d.ts.map +0 -1
  107. package/esm/src/cli/commands/create.js +0 -308
  108. package/esm/src/cli/commands/deploy.d.ts +0 -2
  109. package/esm/src/cli/commands/deploy.d.ts.map +0 -1
  110. package/esm/src/cli/commands/deploy.js +0 -430
  111. package/esm/src/cli/commands/destroy.d.ts +0 -2
  112. package/esm/src/cli/commands/destroy.d.ts.map +0 -1
  113. package/esm/src/cli/commands/destroy.js +0 -340
  114. package/esm/src/cli/commands/doctor.d.ts.map +0 -1
  115. package/esm/src/cli/commands/doctor.js +0 -141
  116. package/esm/src/cli/commands/status.d.ts.map +0 -1
  117. package/esm/src/cli/commands/status.js +0 -152
  118. package/esm/src/cli/mod.d.ts.map +0 -1
  119. package/esm/src/credentials.d.ts.map +0 -1
  120. package/esm/src/discovery.d.ts.map +0 -1
  121. package/esm/src/guard.d.ts.map +0 -1
  122. package/esm/src/providers/fly.d.ts +0 -76
  123. package/esm/src/providers/fly.d.ts.map +0 -1
  124. package/esm/src/providers/fly.js +0 -407
  125. package/esm/src/providers/tailscale.d.ts +0 -31
  126. package/esm/src/providers/tailscale.d.ts.map +0 -1
  127. package/esm/src/providers/tailscale.js +0 -189
  128. package/esm/src/resolve.d.ts.map +0 -1
  129. package/esm/src/schemas/config.d.ts +0 -5
  130. package/esm/src/schemas/config.d.ts.map +0 -1
  131. package/esm/src/schemas/config.js +0 -22
  132. package/esm/src/schemas/fly.d.ts.map +0 -1
  133. package/esm/src/schemas/tailscale.d.ts.map +0 -1
  134. package/esm/src/template.d.ts.map +0 -1
  135. /package/esm/{src/cli → cli}/commands/doctor.d.ts +0 -0
  136. /package/esm/{src/cli → cli}/commands/list.d.ts +0 -0
  137. /package/esm/{src/cli → cli}/commands/status.d.ts +0 -0
  138. /package/esm/{src/cli → cli}/mod.d.ts +0 -0
  139. /package/esm/src/{docker/router → router}/fly.toml +0 -0
@@ -1,430 +0,0 @@
1
- // =============================================================================
2
- // Deploy Command - Safely Deploy a Workload App on a Custom Private Network
3
- // =============================================================================
4
- import * as dntShim from "../../../_dnt.shims.js";
5
- import { parseArgs } from "../../../deps/jsr.io/@std/cli/1.0.28/mod.js";
6
- import { join } from "../../../deps/jsr.io/@std/path/1.1.4/mod.js";
7
- import { bold, confirm, fileExists } from "../../../lib/cli.js";
8
- import { createOutput } from "../../../lib/output.js";
9
- import { registerCommand } from "../mod.js";
10
- import { createFlyProvider, FlyDeployError, getWorkloadAppName, } from "../../providers/fly.js";
11
- import { findRouterApp } from "../../discovery.js";
12
- import { resolveOrg } from "../../resolve.js";
13
- import { assertNotRouter, auditDeploy, scanFlyToml } from "../../guard.js";
14
- import { fetchTemplate, parseTemplateRef } from "../../template.js";
15
- // =============================================================================
16
- // Image Mode
17
- // =============================================================================
18
- /**
19
- * Generate a minimal fly.toml with http_service config for auto start/stop.
20
- * Written to a temp directory and cleaned up after deploy.
21
- */
22
- const generateServiceToml = (port) => `[http_service]\n` +
23
- ` internal_port = ${port}\n` +
24
- ` auto_stop_machines = "stop"\n` +
25
- ` auto_start_machines = true\n` +
26
- ` min_machines_running = 0\n`;
27
- /**
28
- * Parse --main-port value. Returns the port number, or null if "none".
29
- * Dies on invalid input.
30
- */
31
- const parseMainPort = (raw, out) => {
32
- if (raw === "none")
33
- return null;
34
- const port = Number(raw);
35
- if (!Number.isInteger(port) || port < 1 || port > 65535) {
36
- out.die(`Invalid --main-port: "${raw}". Use a port number (1-65535) or "none".`);
37
- return "error";
38
- }
39
- return port;
40
- };
41
- /** Resolve deploy config for image mode (--image). */
42
- const resolveImageMode = (image, mainPortRaw, out) => {
43
- const mainPort = parseMainPort(mainPortRaw, out);
44
- if (mainPort === "error")
45
- return null;
46
- const preflight = { scanned: false, warnings: [] };
47
- if (mainPort !== null) {
48
- const tempDir = dntShim.Deno.makeTempDirSync();
49
- const configPath = join(tempDir, "fly.toml");
50
- dntShim.Deno.writeTextFileSync(configPath, generateServiceToml(mainPort));
51
- out.ok(`HTTP Service on Port ${mainPort} (auto start/stop)`);
52
- return { image, configPath, preflight, tempDir };
53
- }
54
- out.info("Image Mode — No Service Config");
55
- return { image, preflight };
56
- };
57
- // =============================================================================
58
- // Config Mode
59
- // =============================================================================
60
- /** Resolve deploy config for config mode (default — uses fly.toml). */
61
- const resolveConfigMode = async (explicitConfig, out) => {
62
- // Determine config path: explicit --config, or auto-detect ./fly.toml
63
- let configPath = explicitConfig;
64
- if (!configPath && await fileExists("./fly.toml")) {
65
- configPath = "./fly.toml";
66
- }
67
- if (!configPath) {
68
- out.info("No fly.toml Found — Deploying Without Config Scan");
69
- return { preflight: { scanned: false, warnings: [] } };
70
- }
71
- if (!(await fileExists(configPath))) {
72
- out.die(`Config File Not Found: ${configPath}`);
73
- return null;
74
- }
75
- // Pre-flight scan
76
- const tomlContent = await dntShim.Deno.readTextFile(configPath);
77
- const scan = scanFlyToml(tomlContent);
78
- if (scan.errors.length > 0) {
79
- for (const err of scan.errors) {
80
- out.err(err);
81
- }
82
- out.die("Pre-flight Check Failed. Fix fly.toml Before Deploying.");
83
- return null;
84
- }
85
- for (const warn of scan.warnings) {
86
- out.warn(warn);
87
- }
88
- out.ok(`Scanned ${configPath}`);
89
- return {
90
- configPath,
91
- preflight: { scanned: scan.scanned, warnings: scan.warnings },
92
- };
93
- };
94
- // =============================================================================
95
- // Template Mode
96
- // =============================================================================
97
- /** Resolve deploy config for template mode (--template). */
98
- const resolveTemplateMode = async (templateRaw, out) => {
99
- const ref = parseTemplateRef(templateRaw);
100
- if (!ref) {
101
- out.die(`Invalid Template Reference: "${templateRaw}". ` +
102
- `Format: owner/repo[/path][@ref]`);
103
- return null;
104
- }
105
- const label = (ref.path === "."
106
- ? `${ref.owner}/${ref.repo}`
107
- : `${ref.owner}/${ref.repo}/${ref.path}`) +
108
- (ref.ref ? `@${ref.ref}` : "");
109
- out.info(`Template: ${label}`);
110
- const fetchSpinner = out.spinner("Fetching Template from GitHub");
111
- const result = await fetchTemplate(ref);
112
- if (!result.ok) {
113
- fetchSpinner.fail("Template Fetch Failed");
114
- out.die(result.error);
115
- return null;
116
- }
117
- const { tempDir, templateDir } = result.value;
118
- fetchSpinner.success("Template Fetched");
119
- // Find and scan the template's fly.toml
120
- const configPath = join(templateDir, "fly.toml");
121
- let tomlContent;
122
- try {
123
- tomlContent = await dntShim.Deno.readTextFile(configPath);
124
- }
125
- catch {
126
- try {
127
- dntShim.Deno.removeSync(tempDir, { recursive: true });
128
- }
129
- catch { /* ignore */ }
130
- out.die(`Template '${ref.path === "." ? ref.repo : ref.path}' Has No fly.toml`);
131
- return null;
132
- }
133
- const scan = scanFlyToml(tomlContent);
134
- if (scan.errors.length > 0) {
135
- try {
136
- dntShim.Deno.removeSync(tempDir, { recursive: true });
137
- }
138
- catch { /* ignore */ }
139
- for (const err of scan.errors) {
140
- out.err(err);
141
- }
142
- out.die("Pre-flight Check Failed for Template fly.toml");
143
- return null;
144
- }
145
- for (const warn of scan.warnings) {
146
- out.warn(warn);
147
- }
148
- out.ok(`Scanned ${ref.path === "." ? "" : ref.path + "/"}fly.toml`);
149
- return {
150
- configPath,
151
- preflight: { scanned: scan.scanned, warnings: scan.warnings },
152
- tempDir,
153
- };
154
- };
155
- // =============================================================================
156
- // Deploy Command
157
- // =============================================================================
158
- const deploy = async (argv) => {
159
- const args = parseArgs(argv, {
160
- string: [
161
- "network",
162
- "org",
163
- "region",
164
- "image",
165
- "config",
166
- "main-port",
167
- "template",
168
- ],
169
- boolean: ["help", "yes", "json"],
170
- alias: { y: "yes" },
171
- default: { "main-port": "80" },
172
- });
173
- if (args.help) {
174
- console.log(`
175
- ${bold("ambit deploy")} - Deploy an App Safely on a Custom Private Network
176
-
177
- ${bold("USAGE")}
178
- ambit deploy <app>.<network> [options]
179
- ambit deploy <app> --network <name> [options]
180
-
181
- The network can be specified as part of the name (app.network) or with --network.
182
-
183
- ${bold("MODES")}
184
- Config mode (default):
185
- ambit deploy my-app.lab Uses ./fly.toml
186
- ambit deploy my-app.lab --config path Explicit fly.toml
187
-
188
- Image mode:
189
- ambit deploy my-app.lab --image <img> Docker image, no toml
190
-
191
- Template mode:
192
- ambit deploy my-app.lab --template <ref> GitHub template
193
-
194
- ${bold("OPTIONS")}
195
- --network <name> Target network
196
- --org <org> Fly.io organization slug
197
- --region <region> Primary deployment region
198
- -y, --yes Skip confirmation prompts
199
- --json Output as JSON
200
-
201
- ${bold("CONFIG MODE")} (default)
202
- --config <path> Explicit fly.toml path (auto-detects ./fly.toml if omitted)
203
-
204
- ${bold("IMAGE MODE")}
205
- --image <img> Docker image to deploy (no fly.toml needed)
206
- --main-port <port> Internal port for HTTP service (default: 80, "none" to skip)
207
-
208
- ${bold("TEMPLATE MODE")}
209
- --template <ref> GitHub template as owner/repo[/path][@ref]
210
-
211
- Reference format:
212
- owner/repo Fetch repo root from the default branch
213
- owner/repo/path Fetch subdirectory from the default branch
214
- owner/repo/path@tag Fetch a tagged release
215
- owner/repo/path@branch Fetch a specific branch
216
- owner/repo/path@commit Fetch a specific commit
217
-
218
- ${bold("SAFETY")}
219
- Always deploys with --no-public-ips and --flycast.
220
- Post-deploy audit releases any public IPs and verifies Flycast allocation.
221
- Pre-flight scan rejects fly.toml with force_https or TLS on 443.
222
-
223
- ${bold("EXAMPLES")}
224
- ambit deploy my-app.lab
225
- ambit deploy my-app.lab --image registry/img:latest
226
- ambit deploy my-app.lab --config ./fly.toml --region sea
227
- ambit deploy my-claw.lab --template ToxicPine/ambit-openclaw
228
- ambit deploy my-browser.lab --template ToxicPine/ambit-templates/chromatic
229
- ambit deploy my-browser --network lab --template ToxicPine/ambit-templates/chromatic@v1.0
230
- `);
231
- return;
232
- }
233
- const out = createOutput(args.json);
234
- // ==========================================================================
235
- // Phase 0: Parse & Validate
236
- // ==========================================================================
237
- const appArg = args._[0];
238
- if (!appArg || typeof appArg !== "string") {
239
- return out.die("Missing app name. Usage: ambit deploy <app>.<network>");
240
- }
241
- let app;
242
- let network;
243
- if (appArg.includes(".")) {
244
- const parts = appArg.split(".");
245
- if (parts.length !== 2 || !parts[0] || !parts[1]) {
246
- return out.die(`'${appArg}' should have exactly one dot, like my-app.my-network`);
247
- }
248
- if (args.network) {
249
- return out.die(`Network is already part of the name ('${appArg}'), --network is not needed`);
250
- }
251
- app = parts[0];
252
- network = parts[1];
253
- }
254
- else {
255
- app = appArg;
256
- if (!args.network) {
257
- return out.die(`Missing network. Use: ambit deploy ${app}.<network>`);
258
- }
259
- network = args.network;
260
- }
261
- try {
262
- assertNotRouter(app);
263
- }
264
- catch (e) {
265
- return out.die(e instanceof Error ? e.message : String(e));
266
- }
267
- const modeFlags = [args.image, args.config, args.template].filter(Boolean);
268
- if (modeFlags.length > 1) {
269
- return out.die("--image, --config, and --template Are Mutually Exclusive");
270
- }
271
- out.blank()
272
- .header("=".repeat(50))
273
- .header(` ambit Deploy: ${app}`)
274
- .header("=".repeat(50))
275
- .blank();
276
- // ==========================================================================
277
- // Phase 1: Auth & Org
278
- // ==========================================================================
279
- out.header("Step 1: Fly.io Configuration").blank();
280
- const fly = createFlyProvider();
281
- await fly.ensureInstalled();
282
- const email = await fly.ensureAuth({ interactive: !args.json });
283
- out.ok(`Authenticated as ${email}`);
284
- const org = await resolveOrg(fly, args, out);
285
- out.blank();
286
- // ==========================================================================
287
- // Phase 2: Network Verification
288
- // ==========================================================================
289
- out.header("Step 2: Network Verification").blank();
290
- const routerSpinner = out.spinner("Checking for Router on Network");
291
- const router = await findRouterApp(fly, org, network);
292
- if (!router) {
293
- routerSpinner.fail("No Router Found");
294
- return out.die(`No ambit router found on network '${network}'. ` +
295
- `Run 'ambit create ${network}' first.`);
296
- }
297
- routerSpinner.success(`Router Found: ${router.appName}`);
298
- const routerId = router.routerId;
299
- const flyAppName = getWorkloadAppName(app, routerId);
300
- out.blank();
301
- // ==========================================================================
302
- // Phase 3: App Creation (if needed)
303
- // ==========================================================================
304
- out.header("Step 3: App Setup").blank();
305
- let created = false;
306
- const exists = await fly.appExists(flyAppName);
307
- if (exists) {
308
- out.ok(`App '${flyAppName}' Exists`);
309
- }
310
- else {
311
- out.info(`App '${flyAppName}' Does Not Exist — Will Create on Network '${network}'`);
312
- if (!args.yes && !args.json) {
313
- const confirmed = await confirm(`Create app '${flyAppName}' on network '${network}'?`);
314
- if (!confirmed) {
315
- out.text("Cancelled.");
316
- return;
317
- }
318
- }
319
- await fly.createApp(app, org, { network, routerId });
320
- out.ok(`Created App '${flyAppName}' on Network '${network}'`);
321
- created = true;
322
- }
323
- out.blank();
324
- // ==========================================================================
325
- // Phase 4: Resolve Deploy Mode
326
- // ==========================================================================
327
- out.header("Step 4: Pre-flight Check").blank();
328
- let deployConfig;
329
- if (args.template) {
330
- deployConfig = await resolveTemplateMode(args.template, out);
331
- }
332
- else if (args.image) {
333
- deployConfig = resolveImageMode(args.image, String(args["main-port"]), out);
334
- }
335
- else {
336
- deployConfig = await resolveConfigMode(args.config, out);
337
- }
338
- if (!deployConfig)
339
- return; // mode resolver already called out.die()
340
- out.blank();
341
- // ==========================================================================
342
- // Phase 5: Deploy with Enforced Flags
343
- // ==========================================================================
344
- out.header("Step 5: Deploy").blank();
345
- out.dim("Deploying with --no-public-ips --flycast ...");
346
- try {
347
- await fly.deploySafe(app, {
348
- routerId,
349
- image: deployConfig.image,
350
- config: deployConfig.configPath,
351
- region: args.region,
352
- });
353
- }
354
- catch (e) {
355
- if (e instanceof FlyDeployError) {
356
- out.dim(` ${e.detail}`);
357
- return out.die(e.message);
358
- }
359
- throw e;
360
- }
361
- finally {
362
- if (deployConfig.tempDir) {
363
- try {
364
- dntShim.Deno.removeSync(deployConfig.tempDir, { recursive: true });
365
- }
366
- catch { /* ignore */ }
367
- }
368
- }
369
- out.ok("Deploy Succeeded");
370
- out.blank();
371
- // ==========================================================================
372
- // Phase 6: Post-flight Audit
373
- // ==========================================================================
374
- out.header("Step 6: Post-flight Audit").blank();
375
- const auditSpinner = out.spinner("Auditing Deployment");
376
- const audit = await auditDeploy(fly, flyAppName, network);
377
- auditSpinner.success("Audit Complete");
378
- if (audit.public_ips_released > 0) {
379
- out.warn(`Released ${audit.public_ips_released} Public IP(s)`);
380
- }
381
- if (audit.certs_removed > 0) {
382
- out.ok(`Removed ${audit.certs_removed} Public Certificate(s)`);
383
- }
384
- for (const alloc of audit.flycast_allocations) {
385
- out.ok(`Flycast: ${alloc.address} (network: ${alloc.network})`);
386
- }
387
- for (const warn of audit.warnings) {
388
- out.warn(warn);
389
- }
390
- // ==========================================================================
391
- // Phase 7: Result
392
- // ==========================================================================
393
- const hasIssues = audit.public_ips_released > 0 || audit.warnings.length > 0;
394
- const result = {
395
- app,
396
- network,
397
- created,
398
- audit: {
399
- public_ips_released: audit.public_ips_released,
400
- certs_removed: audit.certs_removed,
401
- flycast_allocations: audit.flycast_allocations,
402
- warnings: audit.warnings,
403
- },
404
- preflight: deployConfig.preflight,
405
- };
406
- if (hasIssues) {
407
- out.fail("Deploy Completed with Issues", result);
408
- }
409
- else {
410
- out.done(result);
411
- }
412
- out.blank()
413
- .header("=".repeat(50))
414
- .header(hasIssues ? " Deploy Completed (with warnings)" : " Deploy Completed!")
415
- .header("=".repeat(50))
416
- .blank()
417
- .text(`App '${app}' Is Reachable from Your Tailnet as:`)
418
- .text(` ${app}.${network}`)
419
- .blank();
420
- out.print();
421
- };
422
- // =============================================================================
423
- // Register Command
424
- // =============================================================================
425
- registerCommand({
426
- name: "deploy",
427
- description: "Deploy an app safely on a custom private network",
428
- usage: "ambit deploy <app> --network <name> [--image <img>] [--template <ref>] [--org <org>] [--region <region>]",
429
- run: deploy,
430
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=destroy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"destroy.d.ts","sourceRoot":"","sources":["../../../../src/src/cli/commands/destroy.ts"],"names":[],"mappings":""}