Warn early if deploying a multicontainer project to an incompatible app

Change-Type: patch
This commit is contained in:
Akis Kesoglou 2018-03-19 20:58:57 +02:00
parent 62f006b89a
commit 066ac591ac
2 changed files with 9 additions and 0 deletions

View File

@ -20,6 +20,12 @@ buildProject = (docker, logger, composeOpts, opts) ->
composeOpts.projectName
)
.then (project) ->
if project.descriptors.length > 1 and not opts.app.application_type?[0]?.supports_multicontainer
logger.logWarn(
'Target application does not support multiple containers.\n' +
'Continuing with build, but you will not be able to deploy.'
)
compose.buildProject(
docker
logger

View File

@ -26,6 +26,9 @@ deployProject = (docker, logger, composeOpts, opts) ->
opts.image
)
.then (project) ->
if project.descriptors.length > 1 and !opts.app.application_type?[0]?.supports_multicontainer
throw new Error('Target application does not support multiple containers. Aborting!')
# find which services use images that already exist locally
Promise.map project.descriptors, (d) ->
# unconditionally build (or pull) if explicitly requested