Skip to content

Commit e01cdf5

Browse files
chore(cli): drop dead retagging stub and unused .triggerdeploy.json fields
Two more cleanups identified during PR review: 1. Half-implemented "automatic image retagging" block in registerOnlyDeploy. Was guarded by a TODO comment ("Implement automatic image retagging") and only ever logged shell hints (aws ecr put-image / docker tag) for the user to run by hand, then `await`ed an unconditional 5-second sleep. Never useful: callers that need fixed image tags use DEPLOY_IMAGE_OVERRIDE on the webapp side so deployData.imageTag and deployment.imageTag match. Remove the entire block (~46 lines). 2. simulatedVersion + buildPath fields in the deployData object written to .triggerdeploy.json. Both are written by buildOnlyDeploy but never read by registerOnlyDeploy. simulatedVersion is still used elsewhere in buildOnlyDeploy (deploymentVersion arg + saveLogs filename); we only drop the dead deployData entry. Net: -44 lines. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent daacf5d commit e01cdf5

1 file changed

Lines changed: 0 additions & 44 deletions

File tree

packages/cli-v3/src/commands/deploy.ts

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,8 +1590,6 @@ async function buildOnlyDeploy(projectPath: string, dir: string, options: Deploy
15901590
deploy: buildManifest.deploy,
15911591
},
15921592
indexMetadata,
1593-
simulatedVersion,
1594-
buildPath: destination.path,
15951593
};
15961594

15971595
await writeJSONFile(join(projectPath, ".triggerdeploy.json"), deployData, true);
@@ -1728,48 +1726,6 @@ async function registerOnlyDeploy(projectPath: string, dir: string, options: Dep
17281726
const deployment = deploymentResponse.data;
17291727
const version = deployment.version;
17301728

1731-
// TODO: Implement automatic image retagging
1732-
// Example ECR implementation:
1733-
// const sourceTag = deployData.imageTag; // e.g., localhost:5001/trigger/proj_abc:0f7d1460
1734-
// const targetTag = deployment.imageTag; // e.g., localhost:5001/trigger/proj_abc:20250725.10.prod
1735-
//
1736-
// // For ECR:
1737-
// const manifest = await x("aws", ["ecr", "batch-get-image",
1738-
// "--repository-name", "trigger/proj_abc",
1739-
// "--image-ids", "imageTag=0f7d1460",
1740-
// "--output", "text",
1741-
// "--query", "images[].imageManifest"
1742-
// ]);
1743-
// await x("aws", ["ecr", "put-image",
1744-
// "--repository-name", "trigger/proj_abc",
1745-
// "--image-tag", "20250725.10.prod",
1746-
// "--image-manifest", manifest.stdout
1747-
// ]);
1748-
1749-
// Log retagging command for manual execution
1750-
if (deployData.imageTag && deployment.imageTag && deployData.imageTag !== deployment.imageTag) {
1751-
const sourceTag = deployData.imageTag.split(':').pop();
1752-
const targetTag = deployment.imageTag.split(':').pop();
1753-
const [registry, repoPath] = deployData.imageTag.split('/').slice(0, -1).join('/').split('/');
1754-
const repository = deployData.imageTag.split(':')[0].split('/').slice(-2).join('/');
1755-
1756-
logger.info(`\nImage needs retagging from ${sourceTag} to ${targetTag}`);
1757-
logger.info(`Run this command to retag:\n`);
1758-
1759-
if (deployData.imageTag.includes('.ecr.') && deployData.imageTag.includes('.amazonaws.com')) {
1760-
// ECR retagging command
1761-
logger.info(`MANIFEST=$(aws ecr batch-get-image --repository-name ${repository} --image-ids imageTag=${sourceTag} --output text --query 'images[].imageManifest')`);
1762-
logger.info(`aws ecr put-image --repository-name ${repository} --image-tag ${targetTag} --image-manifest "$MANIFEST"\n`);
1763-
} else {
1764-
// Local/Docker registry retagging
1765-
logger.info(`docker tag ${deployData.imageTag} ${deployment.imageTag}`);
1766-
logger.info(`docker push ${deployment.imageTag}\n`);
1767-
}
1768-
1769-
// Wait 5 seconds to give user time to see the command
1770-
await new Promise(resolve => setTimeout(resolve, 5000));
1771-
}
1772-
17731729
const rawDeploymentLink = `${authorization.dashboardUrl}/projects/v3/${resolvedConfig.project}/deployments/${deployment.shortCode}`;
17741730
const rawTestLink = `${authorization.dashboardUrl}/projects/v3/${
17751731
resolvedConfig.project

0 commit comments

Comments
 (0)