2020-08-18 12:37:07 +00:00
|
|
|
# local
|
2020-08-19 14:10:56 +00:00
|
|
|
from ._subcommand import ServiceCommand
|
2020-08-18 12:37:07 +00:00
|
|
|
from .utils.dockercommand import DockerCommand
|
|
|
|
|
|
|
|
|
2020-08-19 14:10:56 +00:00
|
|
|
class BuildCommand(ServiceCommand):
|
2020-08-18 12:37:07 +00:00
|
|
|
"""kiwi build"""
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
super().__init__(
|
2020-08-19 14:10:56 +00:00
|
|
|
'build', num_projects='?', num_services='*',
|
|
|
|
action="Building images for",
|
2020-08-18 12:37:07 +00:00
|
|
|
description="Build images for the whole instance, a project or service(s) inside a project"
|
|
|
|
)
|
|
|
|
|
2020-08-19 14:10:56 +00:00
|
|
|
def _run_services(self, runner, args, project, services):
|
|
|
|
DockerCommand('docker-compose').run(project, [
|
|
|
|
'build', '--pull', *services
|
|
|
|
])
|
2020-08-18 12:37:07 +00:00
|
|
|
return True
|