From 889fafcffce017373d7b6896ce9fd0a18b6b55f2 Mon Sep 17 00:00:00 2001 From: Paulo Castro Date: Sun, 20 Sep 2020 00:35:57 +0100 Subject: [PATCH] deploy: Fix unexpected exit with "Everything is up to date" Resolves: #2040 Change-type: patch --- lib/actions-oclif/deploy.ts | 38 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/actions-oclif/deploy.ts b/lib/actions-oclif/deploy.ts index f3dd566d..7e74a7cf 100644 --- a/lib/actions-oclif/deploy.ts +++ b/lib/actions-oclif/deploy.ts @@ -243,30 +243,30 @@ ${dockerignoreHelp} compositionToBuild.services, servicesToSkip, ); + let builtImagesByService: Dictionary = {}; 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] ?? {