1
0
Fork 0
mirror of https://github.com/yavook/kiwi-scp.git synced 2024-11-25 22:12:59 +00:00
kiwi-scp/kiwi_scp/commands/cmd_build.py

22 lines
664 B
Python
Raw Normal View History

2021-11-30 18:26:31 +00:00
from typing import List
2021-12-02 16:19:14 +00:00
from .cmd import KiwiCommandType, KiwiCommand
2021-11-30 18:26:31 +00:00
from .decorators import kiwi_command
from ..executable import COMPOSE_EXE
2021-12-02 16:08:14 +00:00
from ..instance import Instance
from ..project import Project
2021-11-30 18:26:31 +00:00
@kiwi_command(
short_help="Build docker images",
)
class BuildCommand(KiwiCommand):
"""Build images for the whole instance, a project or service(s) inside a project"""
2021-12-01 16:49:19 +00:00
type = KiwiCommandType.SERVICES
enabled_only = True
2021-11-30 18:26:31 +00:00
@classmethod
def run_for_services(cls, instance: Instance, project: Project, service_names: List[str], **kwargs) -> None:
COMPOSE_EXE.run(["build", "--pull", *service_names], **project.process_kwargs)