From 0c18ba2dd5c9ec4c534b7c45000ae325c3ff964c Mon Sep 17 00:00:00 2001 From: ldericher <40151420+ldericher@users.noreply.github.com> Date: Tue, 30 Nov 2021 19:26:31 +0100 Subject: [PATCH] "kiwi build" --- kiwi_scp/commands/cmd_build.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 kiwi_scp/commands/cmd_build.py diff --git a/kiwi_scp/commands/cmd_build.py b/kiwi_scp/commands/cmd_build.py new file mode 100644 index 0000000..2f5de78 --- /dev/null +++ b/kiwi_scp/commands/cmd_build.py @@ -0,0 +1,18 @@ +from typing import List + +from .cli import KiwiCommand, KiwiCommandType +from .decorators import kiwi_command +from ..executable import COMPOSE_EXE +from ..instance import Instance, Project + + +@kiwi_command( + cmd_type=KiwiCommandType.SERVICE, + short_help="Build docker images", +) +class BuildCommand(KiwiCommand): + """Build images for the whole instance, a project or service(s) inside a project""" + + @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)