@turboops/cli 1.0.22 → 1.0.23
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 +17 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2541,12 +2541,23 @@ var deployCommand = new Command4("deploy").description("Trigger a deployment (fo
|
|
|
2541
2541
|
logger.header(`Deploying: ${project.name} \u2192 ${env.name}`);
|
|
2542
2542
|
let imageTag = options.image;
|
|
2543
2543
|
if (!imageTag) {
|
|
2544
|
-
const
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2544
|
+
const isFirstStage = !env.stageOrder || env.stageOrder === 0;
|
|
2545
|
+
if (isFirstStage) {
|
|
2546
|
+
const commitSha = detectCiCommitSha();
|
|
2547
|
+
const ciEnv = detectCiEnvironment();
|
|
2548
|
+
if (commitSha && ciEnv) {
|
|
2549
|
+
imageTag = `${configService.getRegistryUrl()}/${project.slug}:${commitSha}`;
|
|
2550
|
+
logger.info(`CI/CD detected (${ciEnv})`);
|
|
2551
|
+
logger.info(`Auto-using image: ${imageTag}`);
|
|
2552
|
+
}
|
|
2553
|
+
} else {
|
|
2554
|
+
const ciEnv = detectCiEnvironment();
|
|
2555
|
+
if (ciEnv) {
|
|
2556
|
+
logger.info(`CI/CD detected (${ciEnv})`);
|
|
2557
|
+
logger.info(
|
|
2558
|
+
`Stage "${env.name}" uses promotion - using image from previous stage`
|
|
2559
|
+
);
|
|
2560
|
+
}
|
|
2550
2561
|
}
|
|
2551
2562
|
}
|
|
2552
2563
|
let composeFileContent;
|