Skip to content

Commit dbfef4f

Browse files
authored
Merge pull request #6 from povio/bugfix/push-race-condition
fix: prevent redundant Docker push after buildx/bake build
2 parents addf731 + 39ad317 commit dbfef4f

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@povio/ecs-deploy-cli",
3-
"version": "4.5.1",
3+
"version": "4.5.2",
44
"bin": {
55
"ecs-deploy": "dist/sh.js"
66
},

src/commands/ecr-build.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,15 @@ export async function ecrBuild(argv: EcrBuildArgv) {
260260

261261
if (!argv.dryRun) {
262262
if (!argv.skipPush) {
263-
if (!argv.buildx) {
263+
// Only push if we didn't already push during buildx build or bake
264+
const wasAlreadyPushed = argv.buildx || container.bakeFile;
265+
if (!wasAlreadyPushed) {
264266
await loadDocker();
265267
if (!docker) throw new Error("Docker not initialized");
266268
logInfo("Pushing to ECR...");
267269
await docker.imagePush(imageName, { verbose: true });
270+
} else {
271+
logInfo("Image already pushed during build process");
268272
}
269273

270274
logInfo(

0 commit comments

Comments
 (0)