format
This commit is contained in:
parent
e501525db2
commit
2add0a76a2
3 changed files with 28 additions and 27 deletions
|
@ -1,22 +1,20 @@
|
|||
import deprecation
|
||||
from enum import Enum
|
||||
from typing import List
|
||||
from .common import (
|
||||
Devops,
|
||||
BuildType
|
||||
)
|
||||
from .common import Devops, BuildType
|
||||
from .image import (
|
||||
Image,
|
||||
)
|
||||
|
||||
class DevopsFactory():
|
||||
|
||||
class DevopsFactory:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def build_devops(self, input) -> Devops:
|
||||
build_type = BuildType[input['build_type']]
|
||||
build_type = BuildType[input["build_type"]]
|
||||
specialized_build = None
|
||||
if build_type == BuildType.IMAGE:
|
||||
if build_type == BuildType.IMAGE:
|
||||
specialized_build = Image(input)
|
||||
elif build_type == BuildType.C4K:
|
||||
pass
|
||||
|
@ -29,4 +27,3 @@ class DevopsFactory():
|
|||
|
||||
def merge(input, autorization, context) -> dict:
|
||||
pass
|
||||
|
||||
|
|
|
@ -1,22 +1,25 @@
|
|||
from typing import (Optional, List)
|
||||
from typing import Optional, List
|
||||
from .common import (
|
||||
filter_none,
|
||||
Validateable,
|
||||
Devops,
|
||||
)
|
||||
|
||||
|
||||
class Image(Validateable):
|
||||
def __init__(
|
||||
self,
|
||||
input,
|
||||
):
|
||||
self.dockerhub_user=input.get('dockerhub_user')
|
||||
self.dockerhub_password=input.get('dockerhub_password')
|
||||
self.docker_publish_tag=input.get('docker_publish_tag')
|
||||
self.build_commons_path = input.get('build_commons_path')
|
||||
self.docker_publish_tag = input.get('docker_publish_tag')
|
||||
self.use_package_common_files = input.get('use_package_common_files', True)
|
||||
self.docker_build_commons_dir_name = input.get('docker_build_commons_dir_name', 'docker')
|
||||
self.dockerhub_user = input.get("dockerhub_user")
|
||||
self.dockerhub_password = input.get("dockerhub_password")
|
||||
self.docker_publish_tag = input.get("docker_publish_tag")
|
||||
self.build_commons_path = input.get("build_commons_path")
|
||||
self.docker_publish_tag = input.get("docker_publish_tag")
|
||||
self.use_package_common_files = input.get("use_package_common_files", True)
|
||||
self.docker_build_commons_dir_name = input.get(
|
||||
"docker_build_commons_dir_name", "docker"
|
||||
)
|
||||
|
||||
def validate(self) -> List[str]:
|
||||
result = []
|
||||
|
|
|
@ -1,16 +1,17 @@
|
|||
from src.main.python.ddadevops.domain import (
|
||||
DevopsFactory, Devops
|
||||
)
|
||||
from src.main.python.ddadevops.domain import DevopsFactory, Devops
|
||||
|
||||
|
||||
def build_devops(overrides: dict) -> Devops:
|
||||
default = {'build_type': 'IMAGE',
|
||||
'stage': 'test',
|
||||
'project_root_path': "../../..",
|
||||
'name': 'mybuild',
|
||||
'module': 'test_image',
|
||||
'dockerhub_user': 'dockerhub_user',
|
||||
'dockerhub_password': 'dockerhub_password',
|
||||
'docker_image_tag': 'docker_image_tag',}
|
||||
default = {
|
||||
"build_type": "IMAGE",
|
||||
"stage": "test",
|
||||
"project_root_path": "../../..",
|
||||
"name": "mybuild",
|
||||
"module": "test_image",
|
||||
"dockerhub_user": "dockerhub_user",
|
||||
"dockerhub_password": "dockerhub_password",
|
||||
"docker_image_tag": "docker_image_tag",
|
||||
}
|
||||
input = default.copy()
|
||||
input.update(overrides)
|
||||
return DevopsFactory().build_devops(input)
|
||||
|
|
Loading…
Reference in a new issue