mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-22 06:57:48 +00:00
Merge pull request #1318 from balena-io/fix-multiple-image-use-push
Fix using an image more than once in a balena push
This commit is contained in:
commit
65ab3008e6
@ -315,6 +315,8 @@ export async function performBuilds(
|
|||||||
// Check for failures
|
// Check for failures
|
||||||
await inspectBuildResults(localImages);
|
await inspectBuildResults(localImages);
|
||||||
|
|
||||||
|
const imagesToRemove: string[] = [];
|
||||||
|
|
||||||
// Now tag any external images with the correct name that they should be,
|
// Now tag any external images with the correct name that they should be,
|
||||||
// as this won't be done by resin-multibuild
|
// as this won't be done by resin-multibuild
|
||||||
await Bluebird.map(localImages, async localImage => {
|
await Bluebird.map(localImages, async localImage => {
|
||||||
@ -325,10 +327,14 @@ export async function performBuilds(
|
|||||||
repo: generateImageName(localImage.serviceName),
|
repo: generateImageName(localImage.serviceName),
|
||||||
force: true,
|
force: true,
|
||||||
});
|
});
|
||||||
await image.remove({ force: true });
|
imagesToRemove.push(localImage.name!);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await Bluebird.map(_.uniq(imagesToRemove), image =>
|
||||||
|
docker.getImage(image).remove({ force: true }),
|
||||||
|
);
|
||||||
|
|
||||||
return buildTasks;
|
return buildTasks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user