From cd52a009f39ecd374e5d8000c2dacebb90594aa3 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Mon, 26 Jun 2023 09:35:40 +0200 Subject: [PATCH] fix release init --- build.py | 26 +++++++++++++++++-- .../python/ddadevops/domain/init_service.py | 3 ++- src/test/python/domain/test_devops_factory.py | 1 - 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/build.py b/build.py index 22c6212..b16abed 100644 --- a/build.py +++ b/build.py @@ -13,8 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +from os import environ +from pybuilder.core import init, task, use_plugin, Author +from ddadevops import * -from pybuilder.core import init, use_plugin, Author use_plugin("python.core") use_plugin("copy_resources") @@ -28,7 +30,9 @@ use_plugin("python.distutils") default_task = "publish" name = "ddadevops" -version = "4.0.0-dev71" +MODULE = "not-used" +PROJECT_ROOT_PATH = "." +version = "4.0.0-dev72" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] @@ -40,6 +44,7 @@ license = "Apache Software License" def initialize(project): #project.build_depends_on('mockito') #project.build_depends_on('unittest-xml-reporting') + project.build_depends_on("ddadevops>=4.0.0-dev") project.set_property("verbose", True) project.get_property("filter_resources_glob").append("main/python/ddadevops/__init__.py") @@ -73,3 +78,20 @@ def initialize(project): 'Topic :: Software Development :: Quality Assurance', 'Topic :: Software Development :: Testing' ]) + + input = { + "name": name, + "module": MODULE, + "stage": "notused", + "project_root_path": PROJECT_ROOT_PATH, + "build_types": [], + "mixin_types": ["RELEASE"], + "release_primary_build_file": "build.py", + } + + build = ReleaseMixin(project, input) + build.initialize_build_dir() + +@task +def nothing(project): + pass diff --git a/src/main/python/ddadevops/domain/init_service.py b/src/main/python/ddadevops/domain/init_service.py index 1261b8e..b4a86b3 100644 --- a/src/main/python/ddadevops/domain/init_service.py +++ b/src/main/python/ddadevops/domain/init_service.py @@ -95,7 +95,8 @@ class InitService: ReleaseType.NONE.name, ]: release_type = latest_commit - result["release_type"] = release_type + if release_type: + result["release_type"] = release_type result["release_current_branch"] = self.git_api.get_current_branch() if not tag: diff --git a/src/test/python/domain/test_devops_factory.py b/src/test/python/domain/test_devops_factory.py index 60bab56..5559102 100644 --- a/src/test/python/domain/test_devops_factory.py +++ b/src/test/python/domain/test_devops_factory.py @@ -58,7 +58,6 @@ def test_devops_factory(): "project_root_path": "../../..", "build_types": [], "mixin_types": ["RELEASE"], - "release_type": "NONE", "release_main_branch": "main", "release_current_branch": "my_feature", "release_config_file": "project.clj",