'plum up' is now the special magic
'start' and 'stop' are now analogous to their Docker namesakes.
This commit is contained in:
parent
3bebd18de7
commit
a4710fa9e1
6 changed files with 119 additions and 69 deletions
|
|
@ -50,13 +50,29 @@ class Project(object):
|
|||
if service.name == name:
|
||||
return service
|
||||
|
||||
def start(self):
|
||||
def create_containers(self):
|
||||
"""
|
||||
Returns a list of (service, container) tuples,
|
||||
one for each service with no running containers.
|
||||
"""
|
||||
containers = []
|
||||
for service in self.services:
|
||||
service.start()
|
||||
if len(service.containers()) == 0:
|
||||
containers.append((service, service.create_container()))
|
||||
return containers
|
||||
|
||||
def stop(self):
|
||||
def kill_and_remove(self, tuples):
|
||||
for (service, container) in tuples:
|
||||
container.kill()
|
||||
container.remove()
|
||||
|
||||
def start(self, **options):
|
||||
for service in self.services:
|
||||
service.stop()
|
||||
service.start(**options)
|
||||
|
||||
def stop(self, **options):
|
||||
for service in self.services:
|
||||
service.stop(**options)
|
||||
|
||||
def containers(self, *args, **kwargs):
|
||||
l = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue