Loading src/cli/entrypoint.py +45 −12 Changes for src/cli/entrypoint.py: 45 added lines, 12 removed lines. Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ from ..features.configurations import ConfigurationsFeature from ..features.images import ImagesFeature from ..features.menus import MenusFeature from ..features.pipelines import PipelinesFeature from ..models.pipelines import Pipeline from ..package.bundle import Bundle from ..package.settings import Settings from ..parsers.parsers import Parsers Loading @@ -26,7 +27,12 @@ from ..types.files import Files class Entrypoint: # Enumerations Result = Enum('Result', ['SUCCESS', 'FINALIZE', 'ERROR', 'CRITICAL']) Result = Enum('Result', [ 'SUCCESS', 'FINALIZE', 'ERROR', 'CRITICAL', ]) # CLI, pylint: disable=too-many-branches,too-many-locals,too-many-return-statements @staticmethod Loading Loading @@ -99,8 +105,8 @@ class Entrypoint: options.tags_default = True # Read configuration jobs = Parsers(options).read() if not jobs: pipeline: Optional[Pipeline] = Parsers(options).read() if not pipeline: return Entrypoint.Result.CRITICAL # Header Loading @@ -109,44 +115,71 @@ class Entrypoint: # Dump configuration if options.dump: result = ConfigurationsFeature(jobs=jobs, options=options).dump() result = ConfigurationsFeature( pipeline=pipeline, options=options, ).dump() # Pull jobs images elif options.pull: result = ImagesFeature(jobs=jobs, options=options).pull() result = ImagesFeature( pipeline=pipeline, options=options, ).pull() # Remove jobs images elif options.rmi: result = ImagesFeature(jobs=jobs, options=options).rmi() result = ImagesFeature( pipeline=pipeline, options=options, ).rmi() # Select job elif options.list and interactive: options.manual = True options.no_regex = True result = MenusFeature(jobs=jobs, options=options).select() result = MenusFeature( pipeline=pipeline, options=options, ).select() # Select jobs elif options.select and interactive: options.no_regex = True result = MenusFeature(jobs=jobs, options=options).select() result = MenusFeature( pipeline=pipeline, options=options, ).select() # Launch pipeline elif options.pipeline: result = PipelinesFeature(jobs=jobs, options=options).launch() result = PipelinesFeature( pipeline=pipeline, options=options, ).launch() # Launch jobs elif options.names: result = PipelinesFeature(jobs=jobs, options=options).launch() result = PipelinesFeature( pipeline=pipeline, options=options, ).launch() # Select jobs elif interactive: options.no_regex = True result = MenusFeature(jobs=jobs, options=options).select() result = MenusFeature( pipeline=pipeline, options=options, ).select() # Launch all jobs elif options.all: options.pipeline = True result = PipelinesFeature(jobs=jobs, options=options).launch() result = PipelinesFeature( pipeline=pipeline, options=options, ).launch() # Unsupported case else: Loading src/engines/base.py +3 −2 Changes for src/engines/base.py: 3 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -2,9 +2,10 @@ # Standard libraries from abc import ABC, abstractmethod from typing import Any, Dict, Iterator, List, NamedTuple from typing import Dict, Iterator, List, NamedTuple # Components from ..models.images import Entrypoint from ..types.volumes import Volumes # Commands type Loading Loading @@ -80,7 +81,7 @@ class BaseEngine(ABC): # pragma: no cover self, image: str, commands: Commands, entrypoint: Any, entrypoint: Entrypoint, variables: Dict[str, str], network: str, option_sockets: bool, Loading src/engines/docker.py +3 −2 Changes for src/engines/docker.py: 3 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ # Standard libraries from os import environ from typing import Any, cast, Dict, Optional from typing import cast, Dict, Optional # Modules libraries from docker import DockerClient, from_env Loading @@ -11,6 +11,7 @@ from docker.models.containers import Container # Components from ..jobs.outputs import Outputs from ..models.images import Entrypoint from ..system.platform import Platform from ..types.volumes import Volumes from .base import _ExecResult, _LogsResult, BaseEngine, Commands, ContainerName Loading Loading @@ -211,7 +212,7 @@ class DockerEngine(BaseEngine): self, image: str, commands: Commands, entrypoint: Any, entrypoint: Entrypoint, variables: Dict[str, str], network: str, option_sockets: bool, Loading src/engines/engine.py +3 −2 Changes for src/engines/engine.py: 3 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -3,9 +3,10 @@ # Standard libraries from argparse import Namespace from enum import Enum from typing import Any, Dict, List from typing import Dict, List # Components from ..models.images import Entrypoint from ..package.bundle import Bundle from ..types.volumes import Volumes from .base import _ExecResult, _LogsResult, BaseEngine, Commands, ContainerName Loading Loading @@ -161,7 +162,7 @@ class Engine: self, image: str, commands: Commands, entrypoint: Any, entrypoint: Entrypoint, variables: Dict[str, str], network: str, option_sockets: bool, Loading src/engines/podman.py +3 −2 Changes for src/engines/podman.py: 3 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -4,9 +4,10 @@ from __future__ import annotations from os import environ from subprocess import CompletedProcess, DEVNULL, PIPE, Popen, run from typing import Any, Dict, Iterator, List, Optional from typing import Dict, Iterator, List, Optional # Components from ..models.images import Entrypoint from ..package.bundle import Bundle from ..system.platform import Platform from ..types.volumes import Volumes Loading Loading @@ -219,7 +220,7 @@ class PodmanEngine(BaseEngine): self, image: str, commands: Commands, entrypoint: Any, entrypoint: Entrypoint, variables: Dict[str, str], network: str, option_sockets: bool, Loading Loading
src/cli/entrypoint.py +45 −12 Changes for src/cli/entrypoint.py: 45 added lines, 12 removed lines. Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ from ..features.configurations import ConfigurationsFeature from ..features.images import ImagesFeature from ..features.menus import MenusFeature from ..features.pipelines import PipelinesFeature from ..models.pipelines import Pipeline from ..package.bundle import Bundle from ..package.settings import Settings from ..parsers.parsers import Parsers Loading @@ -26,7 +27,12 @@ from ..types.files import Files class Entrypoint: # Enumerations Result = Enum('Result', ['SUCCESS', 'FINALIZE', 'ERROR', 'CRITICAL']) Result = Enum('Result', [ 'SUCCESS', 'FINALIZE', 'ERROR', 'CRITICAL', ]) # CLI, pylint: disable=too-many-branches,too-many-locals,too-many-return-statements @staticmethod Loading Loading @@ -99,8 +105,8 @@ class Entrypoint: options.tags_default = True # Read configuration jobs = Parsers(options).read() if not jobs: pipeline: Optional[Pipeline] = Parsers(options).read() if not pipeline: return Entrypoint.Result.CRITICAL # Header Loading @@ -109,44 +115,71 @@ class Entrypoint: # Dump configuration if options.dump: result = ConfigurationsFeature(jobs=jobs, options=options).dump() result = ConfigurationsFeature( pipeline=pipeline, options=options, ).dump() # Pull jobs images elif options.pull: result = ImagesFeature(jobs=jobs, options=options).pull() result = ImagesFeature( pipeline=pipeline, options=options, ).pull() # Remove jobs images elif options.rmi: result = ImagesFeature(jobs=jobs, options=options).rmi() result = ImagesFeature( pipeline=pipeline, options=options, ).rmi() # Select job elif options.list and interactive: options.manual = True options.no_regex = True result = MenusFeature(jobs=jobs, options=options).select() result = MenusFeature( pipeline=pipeline, options=options, ).select() # Select jobs elif options.select and interactive: options.no_regex = True result = MenusFeature(jobs=jobs, options=options).select() result = MenusFeature( pipeline=pipeline, options=options, ).select() # Launch pipeline elif options.pipeline: result = PipelinesFeature(jobs=jobs, options=options).launch() result = PipelinesFeature( pipeline=pipeline, options=options, ).launch() # Launch jobs elif options.names: result = PipelinesFeature(jobs=jobs, options=options).launch() result = PipelinesFeature( pipeline=pipeline, options=options, ).launch() # Select jobs elif interactive: options.no_regex = True result = MenusFeature(jobs=jobs, options=options).select() result = MenusFeature( pipeline=pipeline, options=options, ).select() # Launch all jobs elif options.all: options.pipeline = True result = PipelinesFeature(jobs=jobs, options=options).launch() result = PipelinesFeature( pipeline=pipeline, options=options, ).launch() # Unsupported case else: Loading
src/engines/base.py +3 −2 Changes for src/engines/base.py: 3 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -2,9 +2,10 @@ # Standard libraries from abc import ABC, abstractmethod from typing import Any, Dict, Iterator, List, NamedTuple from typing import Dict, Iterator, List, NamedTuple # Components from ..models.images import Entrypoint from ..types.volumes import Volumes # Commands type Loading Loading @@ -80,7 +81,7 @@ class BaseEngine(ABC): # pragma: no cover self, image: str, commands: Commands, entrypoint: Any, entrypoint: Entrypoint, variables: Dict[str, str], network: str, option_sockets: bool, Loading
src/engines/docker.py +3 −2 Changes for src/engines/docker.py: 3 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ # Standard libraries from os import environ from typing import Any, cast, Dict, Optional from typing import cast, Dict, Optional # Modules libraries from docker import DockerClient, from_env Loading @@ -11,6 +11,7 @@ from docker.models.containers import Container # Components from ..jobs.outputs import Outputs from ..models.images import Entrypoint from ..system.platform import Platform from ..types.volumes import Volumes from .base import _ExecResult, _LogsResult, BaseEngine, Commands, ContainerName Loading Loading @@ -211,7 +212,7 @@ class DockerEngine(BaseEngine): self, image: str, commands: Commands, entrypoint: Any, entrypoint: Entrypoint, variables: Dict[str, str], network: str, option_sockets: bool, Loading
src/engines/engine.py +3 −2 Changes for src/engines/engine.py: 3 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -3,9 +3,10 @@ # Standard libraries from argparse import Namespace from enum import Enum from typing import Any, Dict, List from typing import Dict, List # Components from ..models.images import Entrypoint from ..package.bundle import Bundle from ..types.volumes import Volumes from .base import _ExecResult, _LogsResult, BaseEngine, Commands, ContainerName Loading Loading @@ -161,7 +162,7 @@ class Engine: self, image: str, commands: Commands, entrypoint: Any, entrypoint: Entrypoint, variables: Dict[str, str], network: str, option_sockets: bool, Loading
src/engines/podman.py +3 −2 Changes for src/engines/podman.py: 3 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -4,9 +4,10 @@ from __future__ import annotations from os import environ from subprocess import CompletedProcess, DEVNULL, PIPE, Popen, run from typing import Any, Dict, Iterator, List, Optional from typing import Dict, Iterator, List, Optional # Components from ..models.images import Entrypoint from ..package.bundle import Bundle from ..system.platform import Platform from ..types.volumes import Volumes Loading Loading @@ -219,7 +220,7 @@ class PodmanEngine(BaseEngine): self, image: str, commands: Commands, entrypoint: Any, entrypoint: Entrypoint, variables: Dict[str, str], network: str, option_sockets: bool, Loading