@turboops/cli 1.0.0-dev.707 → 1.0.0-dev.709
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 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -712,9 +712,10 @@ var apiClient = {
|
|
|
712
712
|
/**
|
|
713
713
|
* Trigger a deployment (Project Token endpoint for CI/CD)
|
|
714
714
|
*/
|
|
715
|
-
async deploy(stageId, imageTag) {
|
|
715
|
+
async deploy(stageId, imageTag, composeFile) {
|
|
716
716
|
const body = { stage: stageId };
|
|
717
717
|
if (imageTag) body.imageTag = imageTag;
|
|
718
|
+
if (composeFile) body.composeFile = composeFile;
|
|
718
719
|
return this.request("POST", "/project/deployment/deploy", body);
|
|
719
720
|
},
|
|
720
721
|
/**
|
|
@@ -747,7 +748,7 @@ var apiClient = {
|
|
|
747
748
|
if (Date.now() - startTime > timeout) {
|
|
748
749
|
throw new Error(`Deployment timeout after ${timeout / 1e3} seconds`);
|
|
749
750
|
}
|
|
750
|
-
await new Promise((
|
|
751
|
+
await new Promise((resolve3) => setTimeout(resolve3, pollInterval));
|
|
751
752
|
}
|
|
752
753
|
}
|
|
753
754
|
};
|
|
@@ -864,7 +865,7 @@ var authService = {
|
|
|
864
865
|
if (result.status === "expired" || result.status === "consumed") {
|
|
865
866
|
return { error: "Autorisierungscode abgelaufen oder bereits verwendet", success: false };
|
|
866
867
|
}
|
|
867
|
-
await new Promise((
|
|
868
|
+
await new Promise((resolve3) => setTimeout(resolve3, pollInterval));
|
|
868
869
|
}
|
|
869
870
|
return { error: "Zeit\xFCberschreitung bei der Anmeldung", success: false };
|
|
870
871
|
},
|
|
@@ -1345,7 +1346,7 @@ var aiToolsService = {
|
|
|
1345
1346
|
text: `${config.name} arbeitet...`,
|
|
1346
1347
|
color: "cyan"
|
|
1347
1348
|
}).start();
|
|
1348
|
-
return new Promise((
|
|
1349
|
+
return new Promise((resolve3) => {
|
|
1349
1350
|
if (verbose) {
|
|
1350
1351
|
spinner.stop();
|
|
1351
1352
|
console.log(chalk4.dim("[DEBUG] Spawning child process..."));
|
|
@@ -1456,14 +1457,14 @@ var aiToolsService = {
|
|
|
1456
1457
|
spinner.fail(`${config.name} fehlgeschlagen (Exit Code: ${code})`);
|
|
1457
1458
|
}
|
|
1458
1459
|
logger.newline();
|
|
1459
|
-
|
|
1460
|
+
resolve3(code === 0);
|
|
1460
1461
|
});
|
|
1461
1462
|
child.on("error", (err) => {
|
|
1462
1463
|
if (verbose) {
|
|
1463
1464
|
console.log(chalk4.red(`[ERROR] Spawn error: ${err.message}`));
|
|
1464
1465
|
}
|
|
1465
1466
|
spinner.fail(`Fehler beim Ausf\xFChren von ${config.name}: ${err.message}`);
|
|
1466
|
-
|
|
1467
|
+
resolve3(false);
|
|
1467
1468
|
});
|
|
1468
1469
|
});
|
|
1469
1470
|
}
|
|
@@ -2334,6 +2335,8 @@ Erstelle die Datei "${pipelineFile}".`;
|
|
|
2334
2335
|
}
|
|
2335
2336
|
|
|
2336
2337
|
// src/commands/deploy.ts
|
|
2338
|
+
import { readFileSync as readFileSync2, existsSync as existsSync3 } from "fs";
|
|
2339
|
+
import { resolve } from "path";
|
|
2337
2340
|
import { Command as Command4 } from "commander";
|
|
2338
2341
|
import chalk6 from "chalk";
|
|
2339
2342
|
function detectCiCommitSha() {
|
|
@@ -2366,7 +2369,7 @@ function detectCiEnvironment() {
|
|
|
2366
2369
|
if (process.env.JENKINS_URL) return "Jenkins";
|
|
2367
2370
|
return null;
|
|
2368
2371
|
}
|
|
2369
|
-
var deployCommand = new Command4("deploy").description("Trigger a deployment (for CI/CD pipelines)").argument("<environment>", "Environment slug (e.g., production, staging)").option("-i, --image <tag>", "Docker image tag to deploy (auto-detected in CI/CD)").option("-w, --wait", "Wait for deployment to complete", true).option("--no-wait", "Do not wait for deployment to complete").option(
|
|
2372
|
+
var deployCommand = new Command4("deploy").description("Trigger a deployment (for CI/CD pipelines)").argument("<environment>", "Environment slug (e.g., production, staging)").option("-i, --image <tag>", "Docker image tag to deploy (auto-detected in CI/CD)").option("-c, --compose <path>", "Path to docker-compose file (auto-detected by default)").option("-w, --wait", "Wait for deployment to complete", true).option("--no-wait", "Do not wait for deployment to complete").option(
|
|
2370
2373
|
"--timeout <ms>",
|
|
2371
2374
|
"Timeout in milliseconds when waiting",
|
|
2372
2375
|
"600000"
|
|
@@ -2383,10 +2386,27 @@ var deployCommand = new Command4("deploy").description("Trigger a deployment (fo
|
|
|
2383
2386
|
logger.info(`Auto-using image: ${imageTag}`);
|
|
2384
2387
|
}
|
|
2385
2388
|
}
|
|
2389
|
+
let composeFileContent;
|
|
2390
|
+
if (typeof options.compose === "string") {
|
|
2391
|
+
const composePath = resolve(options.compose);
|
|
2392
|
+
if (!existsSync3(composePath)) {
|
|
2393
|
+
logger.error(`Compose file not found: ${composePath}`);
|
|
2394
|
+
process.exit(11 /* CONFIG_ERROR */);
|
|
2395
|
+
}
|
|
2396
|
+
composeFileContent = readFileSync2(composePath, "utf-8");
|
|
2397
|
+
logger.info(`Using compose file: ${composePath}`);
|
|
2398
|
+
} else if (project.detectedConfig?.composePath) {
|
|
2399
|
+
const composePath = resolve(process.cwd(), project.detectedConfig.composePath);
|
|
2400
|
+
if (existsSync3(composePath)) {
|
|
2401
|
+
composeFileContent = readFileSync2(composePath, "utf-8");
|
|
2402
|
+
logger.info(`Using project compose file: ${project.detectedConfig.composePath}`);
|
|
2403
|
+
}
|
|
2404
|
+
}
|
|
2386
2405
|
logger.info("Triggering deployment...");
|
|
2387
2406
|
const { data: deployment, error } = await apiClient.deploy(
|
|
2388
2407
|
env.id,
|
|
2389
|
-
imageTag
|
|
2408
|
+
imageTag,
|
|
2409
|
+
composeFileContent
|
|
2390
2410
|
);
|
|
2391
2411
|
if (error) {
|
|
2392
2412
|
logger.error(`Failed to trigger deployment: ${error}`);
|