Merge pull request #2041 from balena-io/2040-fix-deploy-exit

deploy: Fix unexpected exit with "Everything is up to date"
This commit is contained in:
bulldozer-balena[bot] 2020-09-20 00:18:08 +00:00 committed by GitHub
commit 4c9a22aba7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -243,12 +243,12 @@ ${dockerignoreHelp}
compositionToBuild.services, compositionToBuild.services,
servicesToSkip, servicesToSkip,
); );
let builtImagesByService: Dictionary<any> = {};
if (_.size(compositionToBuild.services) === 0) { if (_.size(compositionToBuild.services) === 0) {
logger.logInfo( logger.logInfo(
'Everything is up to date (use --build to force a rebuild)', 'Everything is up to date (use --build to force a rebuild)',
); );
return {}; } else {
}
const builtImages = await compose.buildProject( const builtImages = await compose.buildProject(
docker, docker,
logger, logger,
@ -265,8 +265,8 @@ ${dockerignoreHelp}
composeOpts.nogitignore, composeOpts.nogitignore,
composeOpts.multiDockerignore, composeOpts.multiDockerignore,
); );
const builtImagesByService = _.keyBy(builtImages, 'serviceName'); builtImagesByService = _.keyBy(builtImages, 'serviceName');
}
const images = project.descriptors.map( const images = project.descriptors.map(
(d) => (d) =>
builtImagesByService[d.serviceName] ?? { builtImagesByService[d.serviceName] ?? {