Scaling down removes containers

Squashed version of #162.
Closes #121.
This commit is contained in:
sebastianneubauer 2014-03-21 19:34:19 +01:00 • committed by Aanand Prasad
commit 352ad7a38c
4 changed files with 60 additions and 8 deletions

View file

@ -298,20 +298,13 @@ class TopLevelCommand(Command):
"""
detached = options['-d']
(old, new) = self.project.recreate_containers(service_names=options['SERVICE'])
new = self.project.up(service_names=options['SERVICE'])
if not detached:
to_attach = [c for (s, c) in new]
print("Attaching to", list_containers(to_attach))
log_printer = LogPrinter(to_attach, attach_params={"logs": True})
for (service, container) in new:
service.start_container(container)
for (service, container) in old:
container.remove()
if not detached:
try:
log_printer.run()
finally: