Adds pause and unpause-commands

Signed-off-by: Frank Sachsenheim <funkyfuture@riseup.net>
This commit is contained in:
Frank Sachsenheim 2015-07-25 22:20:58 +02:00
commit 227584b864
10 changed files with 147 additions and 4 deletions

View file

@ -172,6 +172,14 @@ class TopLevelCommand(Command):
print("Attaching to", list_containers(containers))
LogPrinter(containers, attach_params={'logs': True}, monochrome=monochrome).run()
def pause(self, project, options):
"""
Pause services.
Usage: pause [SERVICE...]
"""
project.pause(service_names=options['SERVICE'])
def port(self, project, options):
"""
Print the public port for a port binding.
@ -444,6 +452,14 @@ class TopLevelCommand(Command):
timeout = int(options.get('--timeout') or DEFAULT_TIMEOUT)
project.restart(service_names=options['SERVICE'], timeout=timeout)
def unpause(self, project, options):
"""
Unpause services.
Usage: unpause [SERVICE...]
"""
project.unpause(service_names=options['SERVICE'])
def up(self, project, options):
"""
Builds, (re)creates, starts, and attaches to containers for a service.