Implement ReleaseConfig
This commit is contained in:
parent
fce12d2e21
commit
d0ddeb3288
2 changed files with 30 additions and 1 deletions
22
src/main/python/ddadevops/domain/release_config.py
Normal file
22
src/main/python/ddadevops/domain/release_config.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
from typing import Optional
|
||||
from .common import (
|
||||
filter_none,
|
||||
Validateable,
|
||||
Devops,
|
||||
)
|
||||
|
||||
class ReleaseConfig(Validateable):
|
||||
def __init__(
|
||||
self,
|
||||
main_branch: str,
|
||||
config_file: str,
|
||||
devops: Devops,
|
||||
release_version: str = None,
|
||||
bump_version: str = None
|
||||
):
|
||||
self.main_branch = main_branch
|
||||
self.config_file = config_file
|
||||
self.release_version = release_version
|
||||
self.bump_version = bump_version
|
||||
self.devops = devops
|
||||
|
|
@ -4,7 +4,7 @@ from os import chmod
|
|||
from subprocess import run
|
||||
from pkg_resources import resource_string
|
||||
import yaml
|
||||
from .domain import Devops, Image, C4k
|
||||
from .domain import Devops, Image, C4k, ReleaseConfig
|
||||
from .python_util import execute
|
||||
|
||||
|
||||
|
@ -30,6 +30,13 @@ class ProjectRepository:
|
|||
def set_c4k(self, project, build: C4k):
|
||||
project.set_property("c4k_build", build)
|
||||
|
||||
def get_release(self, project) -> ReleaseConfig:
|
||||
return project.get_property("release_build")
|
||||
|
||||
def set_release(self, project, build: ReleaseConfig):
|
||||
project.set_property("release_build", build)
|
||||
|
||||
|
||||
|
||||
class ResourceApi:
|
||||
def read_resource(self, path: str) -> bytes:
|
||||
|
|
Loading…
Reference in a new issue