2020-08-13 11:00:32 +00:00
|
|
|
# local
|
|
|
|
from ._subcommand import ProjectCommand
|
|
|
|
from .utils.dockercommand import DockerCommand
|
|
|
|
|
|
|
|
|
|
|
|
class CmdCommand(ProjectCommand):
|
2020-08-13 12:26:49 +00:00
|
|
|
"""kiwi cmd"""
|
|
|
|
|
2020-08-13 11:00:32 +00:00
|
|
|
def __init__(self):
|
|
|
|
super().__init__(
|
|
|
|
'cmd',
|
|
|
|
description="Run raw docker-compose command in a project"
|
|
|
|
)
|
|
|
|
|
2020-08-13 12:26:49 +00:00
|
|
|
# command string after docker-compose
|
2020-08-13 11:00:32 +00:00
|
|
|
self._sub_parser.add_argument(
|
|
|
|
'compose_cmd', metavar='cmd', type=str,
|
2020-08-13 12:26:49 +00:00
|
|
|
help="runs `docker-compose <cmd>`"
|
2020-08-13 11:00:32 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
def run(self, config, args):
|
2020-08-13 12:26:49 +00:00
|
|
|
import shlex
|
2020-08-13 11:00:32 +00:00
|
|
|
|
2020-08-13 12:26:49 +00:00
|
|
|
# run with split compose_cmd argument
|
|
|
|
DockerCommand('docker-compose').run(config, args, shlex.split(args.compose_cmd))
|