@deepraxis/cli 0.3.0-dev.445505c → 0.3.0-dev.4e5fc1f
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/praxis.js +24 -1
- package/package.json +1 -1
package/dist/praxis.js
CHANGED
|
@@ -58000,6 +58000,24 @@ function backendDocument(backend, target) {
|
|
|
58000
58000
|
|
|
58001
58001
|
// src/devops/tofu/run.ts
|
|
58002
58002
|
import { dirname as dirname4, isAbsolute, resolve as resolve3 } from "node:path";
|
|
58003
|
+
function planReadyLine(summary) {
|
|
58004
|
+
const planned = new Set(summary.targets.filter((t) => t.status === "planned").map((t) => t.target));
|
|
58005
|
+
const layers = summary.layers.map((layer) => layer.filter((path) => planned.has(path))).filter((layer) => layer.length > 0);
|
|
58006
|
+
const migrations = summary.targets.flatMap((t) => {
|
|
58007
|
+
const files = t.status === "planned" ? t.pending.filter((line) => line.startsWith("d1 migrations ")) : [];
|
|
58008
|
+
return files.length === 0 ? [] : [{ targetPath: t.target, files }];
|
|
58009
|
+
});
|
|
58010
|
+
return { type: "plan.ready", layers, migrations };
|
|
58011
|
+
}
|
|
58012
|
+
function failureDigest(summary) {
|
|
58013
|
+
const count2 = (status) => summary.targets.filter((t) => t.status === status).length;
|
|
58014
|
+
const lines = [`RESULT ${summary.finished} planned=${count2("planned")} succeeded=${count2("succeeded")} failed=${count2("failed")} blocked=${count2("blocked")}`];
|
|
58015
|
+
for (const t of summary.targets) {
|
|
58016
|
+
if (t.status === "failed" || t.status === "blocked" && t.message !== "a target it depends on did not finish")
|
|
58017
|
+
lines.push(`FAILED ${t.target}: ${t.message ?? t.status}`);
|
|
58018
|
+
}
|
|
58019
|
+
return lines;
|
|
58020
|
+
}
|
|
58003
58021
|
var BACKEND_FILE = "praxis_backend.tf.json";
|
|
58004
58022
|
async function runTofuDeploy(args, plan, ports) {
|
|
58005
58023
|
const { fs, exec, out } = ports;
|
|
@@ -58031,6 +58049,9 @@ async function runTofuDeploy(args, plan, ports) {
|
|
|
58031
58049
|
};
|
|
58032
58050
|
const writeSummary = async (summary) => {
|
|
58033
58051
|
await fs.write(`${planDir}/summary.json`, `${JSON.stringify(summary, null, 2)}
|
|
58052
|
+
`);
|
|
58053
|
+
if (args.mode === "plan-only")
|
|
58054
|
+
await fs.write(`${planDir}/plan-ready.json`, `${JSON.stringify(planReadyLine(summary))}
|
|
58034
58055
|
`);
|
|
58035
58056
|
out(`SUMMARY ${JSON.stringify(summary)}`);
|
|
58036
58057
|
};
|
|
@@ -58515,6 +58536,8 @@ async function devopsDeployTofu(flags, ports) {
|
|
|
58515
58536
|
out: ports.stdout
|
|
58516
58537
|
});
|
|
58517
58538
|
ports.emit({ kind: "object", data: result.summary });
|
|
58539
|
+
for (const line of failureDigest(result.summary))
|
|
58540
|
+
ports.stdout(line);
|
|
58518
58541
|
return result.exitCode;
|
|
58519
58542
|
}
|
|
58520
58543
|
|
|
@@ -61739,7 +61762,7 @@ function startProgress(ctx, write = (text) => writeOutput({ stderr: text })) {
|
|
|
61739
61762
|
}
|
|
61740
61763
|
|
|
61741
61764
|
// src/main.ts
|
|
61742
|
-
var version = "0.3.0-dev.
|
|
61765
|
+
var version = "0.3.0-dev.4e5fc1f";
|
|
61743
61766
|
var commands = commandTree(operations);
|
|
61744
61767
|
var manual = [...workflows.map((w) => w.words), [API_WORD]];
|
|
61745
61768
|
function route(argv) {
|