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,30 +243,30 @@ ${dockerignoreHelp}
compositionToBuild.services,
servicesToSkip,
);
let builtImagesByService: Dictionary<any> = {};
if (_.size(compositionToBuild.services) === 0) {
logger.logInfo(
'Everything is up to date (use --build to force a rebuild)',
);
return {};
} else {
const builtImages = await compose.buildProject(
docker,
logger,
project.path,
project.name,
compositionToBuild,
opts.app.arch,
(opts.app?.is_for__device_type as DeviceType[])?.[0].slug,
opts.buildEmulated,
opts.buildOpts,
composeOpts.inlineLogs,
composeOpts.convertEol,
composeOpts.dockerfilePath,
composeOpts.nogitignore,
composeOpts.multiDockerignore,
);
builtImagesByService = _.keyBy(builtImages, 'serviceName');
}
const builtImages = await compose.buildProject(
docker,
logger,
project.path,
project.name,
compositionToBuild,
opts.app.arch,
(opts.app?.is_for__device_type as DeviceType[])?.[0].slug,
opts.buildEmulated,
opts.buildOpts,
composeOpts.inlineLogs,
composeOpts.convertEol,
composeOpts.dockerfilePath,
composeOpts.nogitignore,
composeOpts.multiDockerignore,
);
const builtImagesByService = _.keyBy(builtImages, 'serviceName');
const images = project.descriptors.map(
(d) =>
builtImagesByService[d.serviceName] ?? {