@launchmatic/cli 0.7.1 → 0.7.2
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/index.js +28 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -21963,13 +21963,16 @@ function discoverServices(repoRoot = findRepoRoot()) {
|
|
|
21963
21963
|
for (const absDir of dirs) {
|
|
21964
21964
|
if (!isLikelyDeployable(absDir)) continue;
|
|
21965
21965
|
const detection = detectLocal(absDir);
|
|
21966
|
+
const rootDir = toPosix(relative(repoRoot, absDir));
|
|
21967
|
+
const dockerfile = existsSync3(join2(absDir, "Dockerfile")) ? `${rootDir}/Dockerfile` : void 0;
|
|
21966
21968
|
out.push({
|
|
21967
21969
|
name: deriveName(repoRoot, absDir),
|
|
21968
|
-
rootDir
|
|
21970
|
+
rootDir,
|
|
21969
21971
|
framework: detection.framework,
|
|
21970
21972
|
buildCmd: detection.buildCmd,
|
|
21971
21973
|
startCmd: detection.startCmd,
|
|
21972
|
-
port: detection.port
|
|
21974
|
+
port: detection.port,
|
|
21975
|
+
...dockerfile ? { dockerfile } : {}
|
|
21973
21976
|
});
|
|
21974
21977
|
}
|
|
21975
21978
|
out.sort((a, b) => a.rootDir.localeCompare(b.rootDir));
|
|
@@ -26328,10 +26331,15 @@ Discovered ${discoveredInfra.length} infra dependenc${discoveredInfra.length ===
|
|
|
26328
26331
|
discovered = await reviewList(
|
|
26329
26332
|
`services`,
|
|
26330
26333
|
discovered,
|
|
26331
|
-
(s) =>
|
|
26334
|
+
(s) => {
|
|
26335
|
+
const fw = s.framework ? source_default.dim(` [${s.framework}]`) : "";
|
|
26336
|
+
const df = s.dockerfile ? source_default.dim(` Dockerfile=${s.dockerfile}`) : "";
|
|
26337
|
+
return `${source_default.cyan(s.name)} ${source_default.dim(s.rootDir)}${fw}${df}`;
|
|
26338
|
+
},
|
|
26332
26339
|
[
|
|
26333
26340
|
{ key: "name", label: "name" },
|
|
26334
26341
|
{ key: "rootDir", label: "rootDir" },
|
|
26342
|
+
{ key: "dockerfile", label: "dockerfile (path from repo root)" },
|
|
26335
26343
|
{ key: "framework", label: "framework" },
|
|
26336
26344
|
{ key: "buildCmd", label: "buildCmd" },
|
|
26337
26345
|
{ key: "startCmd", label: "startCmd" },
|
|
@@ -26426,6 +26434,7 @@ Discovered ${discoveredInfra.length} infra dependenc${discoveredInfra.length ===
|
|
|
26426
26434
|
if (s.framework) payload.framework = s.framework;
|
|
26427
26435
|
if (s.buildCmd) payload.buildCmd = s.buildCmd;
|
|
26428
26436
|
if (s.startCmd) payload.startCmd = s.startCmd;
|
|
26437
|
+
if (s.dockerfile) payload.dockerfilePath = s.dockerfile;
|
|
26429
26438
|
if (gitInfo.repoOwner && gitInfo.repoName) {
|
|
26430
26439
|
payload.repoOwner = gitInfo.repoOwner;
|
|
26431
26440
|
payload.repoName = gitInfo.repoName;
|
|
@@ -26453,7 +26462,8 @@ Discovered ${discoveredInfra.length} infra dependenc${discoveredInfra.length ===
|
|
|
26453
26462
|
framework: s.framework,
|
|
26454
26463
|
buildCmd: s.buildCmd,
|
|
26455
26464
|
startCmd: s.startCmd,
|
|
26456
|
-
port: s.port
|
|
26465
|
+
port: s.port,
|
|
26466
|
+
...s.dockerfile ? { dockerfile: s.dockerfile } : {}
|
|
26457
26467
|
});
|
|
26458
26468
|
}
|
|
26459
26469
|
const infra = [];
|
|
@@ -26612,6 +26622,20 @@ async function up(opts) {
|
|
|
26612
26622
|
console.log();
|
|
26613
26623
|
const results = await Promise.allSettled(
|
|
26614
26624
|
selected.map(async ({ entry }) => {
|
|
26625
|
+
const patch = {};
|
|
26626
|
+
if (entry.dockerfile !== void 0) patch.dockerfilePath = entry.dockerfile || null;
|
|
26627
|
+
if (entry.rootDir) patch.rootDir = `/${entry.rootDir.replace(/^\/+/, "")}`;
|
|
26628
|
+
if (entry.buildCmd) patch.buildCmd = entry.buildCmd;
|
|
26629
|
+
if (entry.startCmd) patch.startCmd = entry.startCmd;
|
|
26630
|
+
if (Object.keys(patch).length > 0) {
|
|
26631
|
+
try {
|
|
26632
|
+
await api(`/api/services/${entry.serviceId}`, {
|
|
26633
|
+
method: "PATCH",
|
|
26634
|
+
body: JSON.stringify(patch)
|
|
26635
|
+
});
|
|
26636
|
+
} catch {
|
|
26637
|
+
}
|
|
26638
|
+
}
|
|
26615
26639
|
const res = await api("/api/deployments", {
|
|
26616
26640
|
method: "POST",
|
|
26617
26641
|
body: JSON.stringify({
|