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/logs.py

19 lines
482 B
Python
Raw Normal View History

from ..core import Parser
from ._utils import SubCommand, Docker
class LogsCommand(SubCommand):
2020-08-10 09:24:39 +00:00
command = 'logs'
@classmethod
def setup(cls):
2020-08-10 13:21:39 +00:00
_ = Parser().get_subparsers().add_parser(
2020-08-10 09:24:39 +00:00
cls.command,
description="Show logs of a project"
)
@classmethod
def run(cls):
print(Docker.run_command('docker-compose', ['logs', '-tf', '--tail=10'], cwd='hello-world.project', env={'COMPOSE_PROJECT_NAME': 'hello-world'}))