1
0
Fork 0
mirror of https://github.com/yavook/kiwi-scp.git synced 2024-11-22 21:03:00 +00:00
kiwi-scp/src/kiwi/subcommands/up.py

29 lines
763 B
Python
Raw Normal View History

2020-08-17 12:12:33 +00:00
# local
2020-08-18 11:50:21 +00:00
from ._subcommand import FlexCommand
2020-08-17 12:12:33 +00:00
from .utils.dockercommand import DockerCommand
2020-08-18 11:50:21 +00:00
class UpCommand(FlexCommand):
2020-08-17 12:12:33 +00:00
"""kiwi up"""
def __init__(self):
super().__init__(
'up', "Bringing up",
description="Bring up the whole instance, a project or service(s) inside a project"
2020-08-17 12:12:33 +00:00
)
2020-08-18 14:02:45 +00:00
def _run_instance(self, runner, config, args):
if runner.run('conf-copy'):
return super()._run_instance(runner, config, args)
return False
def _run_services(self, runner, config, args, services):
2020-08-18 12:23:56 +00:00
if runner.run('net-up'):
DockerCommand('docker-compose').run(
config, args, ['up', '-d', *services]
)
return True
return False