diff --git a/src/kiwi/subcommands/__init__.py b/src/kiwi/subcommands/__init__.py index 11e6dfc..864cea2 100644 --- a/src/kiwi/subcommands/__init__.py +++ b/src/kiwi/subcommands/__init__.py @@ -7,6 +7,7 @@ from .init import InitCommand from .logs import LogsCommand from .net import NetUpCommand, NetDownCommand from .pull import PullCommand +from .push import PushCommand from .sh import ShCommand from .show import ShowCommand from .up import UpCommand @@ -23,6 +24,7 @@ __all__ = [ 'NetUpCommand', 'NetDownCommand', 'PullCommand', + 'PushCommand', 'ShCommand', 'ShowCommand', 'UpCommand', diff --git a/src/kiwi/subcommands/build.py b/src/kiwi/subcommands/build.py index bc13757..d53c50d 100644 --- a/src/kiwi/subcommands/build.py +++ b/src/kiwi/subcommands/build.py @@ -8,7 +8,7 @@ class BuildCommand(FlexCommand): def __init__(self): super().__init__( - 'build', "Building images", + 'build', "Building images for", description="Build images for the whole instance, a project or service(s) inside a project" ) diff --git a/src/kiwi/subcommands/pull.py b/src/kiwi/subcommands/pull.py index 3497517..019c007 100644 --- a/src/kiwi/subcommands/pull.py +++ b/src/kiwi/subcommands/pull.py @@ -8,7 +8,7 @@ class PullCommand(FlexCommand): def __init__(self): super().__init__( - 'pull', "Pulling images", + 'pull', "Pulling images for", description="Pull images for the whole instance, a project or service(s) inside a project" ) diff --git a/src/kiwi/subcommands/push.py b/src/kiwi/subcommands/push.py new file mode 100644 index 0000000..f0b00ad --- /dev/null +++ b/src/kiwi/subcommands/push.py @@ -0,0 +1,19 @@ +# local +from ._subcommand import FlexCommand +from .utils.dockercommand import DockerCommand + + +class PushCommand(FlexCommand): + """kiwi push""" + + def __init__(self): + super().__init__( + 'push', "Pushing images for", + description="Push images for the whole instance, a project or service(s) inside a project" + ) + + def _run_services(self, runner, config, args, services): + DockerCommand('docker-compose').run( + config, args, ['push', *services] + ) + return True