From a661eaf3cabba3644fce9eac02cd48bda1300063 Mon Sep 17 00:00:00 2001 From: bom Date: Fri, 28 Jun 2024 12:00:54 +0200 Subject: [PATCH] Add optional release tag prefix Used for go modules --- doc/ReleaseMixin.md | 1 + .../python/ddadevops/application/release_mixin_services.py | 3 ++- src/main/python/ddadevops/domain/release.py | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/ReleaseMixin.md b/doc/ReleaseMixin.md index 50a9122..182b863 100644 --- a/doc/ReleaseMixin.md +++ b/doc/ReleaseMixin.md @@ -35,6 +35,7 @@ classDiagram | release_organisation | Optional: The repository organisation name | | | release_repository_name | Optional: The repository name name | | | release_artifacts | Optional: The list of artifacts to publish to the release generated name | [] | +| release_tag_prefix | Optional: Prefix of tag | "" | ## Example Usage just for creating releases diff --git a/src/main/python/ddadevops/application/release_mixin_services.py b/src/main/python/ddadevops/application/release_mixin_services.py index 6c96c07..9952884 100644 --- a/src/main/python/ddadevops/application/release_mixin_services.py +++ b/src/main/python/ddadevops/application/release_mixin_services.py @@ -53,7 +53,8 @@ class ReleaseService: bump_version = release_version.create_bump() release_message = f"release: {release_version.to_string()}" bump_message = f"bump version to: {bump_version.to_string()}" - self.git_api.tag_annotated(release_version.to_string(), release_message, 0) + release_tag = f"{release.release_tag_prefix}{release_version.to_string()}" + self.git_api.tag_annotated(release_tag, release_message, 0) self.__set_version_and_commit__( bump_version, release.build_files(), diff --git a/src/main/python/ddadevops/domain/release.py b/src/main/python/ddadevops/domain/release.py index 490db9b..27cda8c 100644 --- a/src/main/python/ddadevops/domain/release.py +++ b/src/main/python/ddadevops/domain/release.py @@ -24,6 +24,7 @@ class Release(Validateable): "release_secondary_build_files", [] ) self.version = version + self.release_tag_prefix = inp.get("release_tag_prefix", "") self.release_artifact_server_url = inp.get("release_artifact_server_url") self.release_organisation = inp.get("release_organisation") self.release_repository_name = inp.get("release_repository_name")