create version outside of devops aggregate
This commit is contained in:
parent
ce69b5970d
commit
1e2fcce452
3 changed files with 14 additions and 12 deletions
|
@ -12,7 +12,7 @@ class DevopsFactory:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def build_devops(self, input) -> Devops:
|
def build_devops(self, input: dict, version: Version) -> Devops:
|
||||||
build_types = self.__parse_build_types__(input["build_types"])
|
build_types = self.__parse_build_types__(input["build_types"])
|
||||||
mixin_types = self.__parse_mixin_types__(input["mixin_types"])
|
mixin_types = self.__parse_mixin_types__(input["mixin_types"])
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@ class DevopsFactory:
|
||||||
|
|
||||||
mixins = {}
|
mixins = {}
|
||||||
if MixinType.RELEASE in mixin_types:
|
if MixinType.RELEASE in mixin_types:
|
||||||
version = Version.from_str(input["version"])
|
|
||||||
mixins[MixinType.RELEASE] = Release(input, version)
|
mixins[MixinType.RELEASE] = Release(input, version)
|
||||||
|
|
||||||
devops = Devops(input, specialized_builds=specialized_builds, mixins=mixins)
|
devops = Devops(input, specialized_builds=specialized_builds, mixins=mixins)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import pytest
|
import pytest
|
||||||
from src.main.python.ddadevops.domain.devops_factory import (
|
from src.main.python.ddadevops.domain import (
|
||||||
DevopsFactory,
|
DevopsFactory, Version
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,7 +26,8 @@ def test_devops_factory():
|
||||||
"image_dockerhub_user": "dockerhub_user",
|
"image_dockerhub_user": "dockerhub_user",
|
||||||
"image_dockerhub_password": "dockerhub_password",
|
"image_dockerhub_password": "dockerhub_password",
|
||||||
"image_tag": "docker_image_tag",
|
"image_tag": "docker_image_tag",
|
||||||
}
|
},
|
||||||
|
Version.from_str("1.0.0")
|
||||||
)
|
)
|
||||||
assert sut is not None
|
assert sut is not None
|
||||||
|
|
||||||
|
@ -40,7 +41,8 @@ def test_devops_factory():
|
||||||
"mixin_types": [],
|
"mixin_types": [],
|
||||||
"c4k_grafana_cloud_user": "user",
|
"c4k_grafana_cloud_user": "user",
|
||||||
"c4k_grafana_cloud_password": "password",
|
"c4k_grafana_cloud_password": "password",
|
||||||
}
|
},
|
||||||
|
Version.from_str("1.0.0")
|
||||||
)
|
)
|
||||||
assert sut is not None
|
assert sut is not None
|
||||||
|
|
||||||
|
@ -52,11 +54,11 @@ def test_devops_factory():
|
||||||
"project_root_path": "../../..",
|
"project_root_path": "../../..",
|
||||||
"build_types": [],
|
"build_types": [],
|
||||||
"mixin_types": ["RELEASE"],
|
"mixin_types": ["RELEASE"],
|
||||||
"version": "1.0.0",
|
|
||||||
"release_type": "NONE",
|
"release_type": "NONE",
|
||||||
"release_main_branch": "main",
|
"release_main_branch": "main",
|
||||||
"release_current_branch": "my_feature",
|
"release_current_branch": "my_feature",
|
||||||
"release_config_file": "project.clj",
|
"release_config_file": "project.clj",
|
||||||
}
|
},
|
||||||
|
Version.from_str("1.0.0")
|
||||||
)
|
)
|
||||||
assert sut is not None
|
assert sut is not None
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from src.main.python.ddadevops.domain import DevopsFactory, Devops
|
from src.main.python.ddadevops.domain import DevopsFactory, Devops, Version
|
||||||
|
|
||||||
|
|
||||||
def devops_config(overrides: dict) -> dict:
|
def devops_config(overrides: dict) -> dict:
|
||||||
|
@ -18,7 +18,6 @@ def devops_config(overrides: dict) -> dict:
|
||||||
"c4k_grafana_cloud_password": "password",
|
"c4k_grafana_cloud_password": "password",
|
||||||
"c4k_grafana_cloud_url": "https://prometheus-prod-01-eu-west-0.grafana.net/api/prom/push",
|
"c4k_grafana_cloud_url": "https://prometheus-prod-01-eu-west-0.grafana.net/api/prom/push",
|
||||||
"c4k_auth": {},
|
"c4k_auth": {},
|
||||||
"version": "1.0.0",
|
|
||||||
"release_type": "NONE",
|
"release_type": "NONE",
|
||||||
"release_main_branch": "main",
|
"release_main_branch": "main",
|
||||||
"release_current_branch": "my_feature",
|
"release_current_branch": "my_feature",
|
||||||
|
@ -29,5 +28,7 @@ def devops_config(overrides: dict) -> dict:
|
||||||
return input
|
return input
|
||||||
|
|
||||||
|
|
||||||
def build_devops(overrides: dict) -> Devops:
|
def build_devops(
|
||||||
return DevopsFactory().build_devops(devops_config(overrides))
|
overrides: dict, version: Version = Version.from_str("1.0.0-SNAPSHOT")
|
||||||
|
) -> Devops:
|
||||||
|
return DevopsFactory().build_devops(devops_config(overrides), version=version)
|
||||||
|
|
Loading…
Reference in a new issue