|
|
|
@ -1,9 +1,8 @@
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
from typing import List, Dict
|
|
|
|
|
from typing import Dict
|
|
|
|
|
from .common import Devops, MixinType, BuildType
|
|
|
|
|
from .credentials import CredentialMapping, Credentials, GopassType
|
|
|
|
|
from .devops_factory import DevopsFactory
|
|
|
|
|
from .version import Version
|
|
|
|
|
from .release import ReleaseType
|
|
|
|
|
from ..infrastructure import BuildFileRepository, CredentialsApi, EnvironmentApi, GitApi
|
|
|
|
|
|
|
|
|
@ -33,9 +32,9 @@ class InitService:
|
|
|
|
|
GitApi(),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
def initialize(self, input: dict) -> Devops:
|
|
|
|
|
build_types = self.devops_factory.__parse_build_types__(input["build_types"])
|
|
|
|
|
mixin_types = self.devops_factory.__parse_mixin_types__(input["mixin_types"])
|
|
|
|
|
def initialize(self, inp: dict) -> Devops:
|
|
|
|
|
build_types = self.devops_factory.__parse_build_types__(inp["build_types"])
|
|
|
|
|
mixin_types = self.devops_factory.__parse_mixin_types__(inp["mixin_types"])
|
|
|
|
|
|
|
|
|
|
version = None
|
|
|
|
|
default_mappings = []
|
|
|
|
@ -66,7 +65,7 @@ class InitService:
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
if MixinType.RELEASE in mixin_types:
|
|
|
|
|
primary_build_file_id = input.get(
|
|
|
|
|
primary_build_file_id = inp.get(
|
|
|
|
|
"release_primary_build_file", "./project.clj"
|
|
|
|
|
)
|
|
|
|
|
primary_build_file = self.build_file_repository.get(
|
|
|
|
@ -74,12 +73,12 @@ class InitService:
|
|
|
|
|
)
|
|
|
|
|
version = primary_build_file.get_version()
|
|
|
|
|
|
|
|
|
|
credentials = Credentials(input, default_mappings)
|
|
|
|
|
credentials = Credentials(inp, default_mappings)
|
|
|
|
|
authorization = self.authorization(credentials)
|
|
|
|
|
|
|
|
|
|
context = self.context(mixin_types, version)
|
|
|
|
|
|
|
|
|
|
merged = self.devops_factory.merge(input, context, authorization)
|
|
|
|
|
merged = self.devops_factory.merge(inp, context, authorization)
|
|
|
|
|
|
|
|
|
|
return self.devops_factory.build_devops(merged, version=version)
|
|
|
|
|
|
|
|
|
|