fix release validation

This commit is contained in:
Michael Jerger 2023-07-07 08:48:43 +02:00
parent 34527621ac
commit 3260cc39b0
2 changed files with 9 additions and 8 deletions

View file

@ -1,4 +1,4 @@
image: "domaindrivenarchitecture/devops-build:4.0.1" image: "domaindrivenarchitecture/devops-build:4.0.2"
before_script: before_script:
- python --version - python --version

View file

@ -29,7 +29,6 @@ class Release(Validateable):
result = [] result = []
result += self.__validate_is_not_empty__("release_type") result += self.__validate_is_not_empty__("release_type")
result += self.__validate_is_not_empty__("release_main_branch") 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__("release_primary_build_file")
result += self.__validate_is_not_empty__("version") result += self.__validate_is_not_empty__("version")
try: try:
@ -47,12 +46,14 @@ class Release(Validateable):
) )
if self.version: if self.version:
result += self.version.validate() result += self.version.validate()
if ( if self.release_type is not None:
self.release_type is not None result += self.__validate_is_not_empty__("release_current_branch")
and self.release_type != ReleaseType.NONE if (
and self.release_main_branch != self.release_current_branch self.release_current_branch is not None
): and self.release_type != ReleaseType.NONE
result.append(f"Releases are allowed only on {self.release_main_branch}") and self.release_main_branch != self.release_current_branch
):
result.append(f"Releases are allowed only on {self.release_main_branch}")
return result return result
def build_files(self) -> List[str]: def build_files(self) -> List[str]: