fix release validation
This commit is contained in:
parent
03bf8e5dea
commit
9b05abb80a
2 changed files with 9 additions and 8 deletions
|
@ -1,4 +1,4 @@
|
|||
image: "domaindrivenarchitecture/devops-build:4.0.1"
|
||||
image: "domaindrivenarchitecture/devops-build:4.0.2"
|
||||
|
||||
before_script:
|
||||
- python --version
|
||||
|
|
|
@ -29,7 +29,6 @@ class Release(Validateable):
|
|||
result = []
|
||||
result += self.__validate_is_not_empty__("release_type")
|
||||
result += self.__validate_is_not_empty__("release_main_branch")
|
||||
result += self.__validate_is_not_empty__("release_current_branch")
|
||||
result += self.__validate_is_not_empty__("release_primary_build_file")
|
||||
result += self.__validate_is_not_empty__("version")
|
||||
try:
|
||||
|
@ -47,12 +46,14 @@ class Release(Validateable):
|
|||
)
|
||||
if self.version:
|
||||
result += self.version.validate()
|
||||
if (
|
||||
self.release_type is not None
|
||||
and self.release_type != ReleaseType.NONE
|
||||
and self.release_main_branch != self.release_current_branch
|
||||
):
|
||||
result.append(f"Releases are allowed only on {self.release_main_branch}")
|
||||
if self.release_type is not None:
|
||||
result += self.__validate_is_not_empty__("release_current_branch")
|
||||
if (
|
||||
self.release_current_branch is not None
|
||||
and self.release_type != ReleaseType.NONE
|
||||
and self.release_main_branch != self.release_current_branch
|
||||
):
|
||||
result.append(f"Releases are allowed only on {self.release_main_branch}")
|
||||
return result
|
||||
|
||||
def build_files(self) -> List[str]:
|
||||
|
|
Loading…
Reference in a new issue