From c15503b7a0fd970c6ebcd31b24880de3e8b73d59 Mon Sep 17 00:00:00 2001 From: bom Date: Thu, 3 Aug 2023 12:15:18 +0200 Subject: [PATCH 01/97] Update artifact deployment mixin --- src/main/python/ddadevops/artifact_deployment_mixin.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/python/ddadevops/artifact_deployment_mixin.py b/src/main/python/ddadevops/artifact_deployment_mixin.py index 144fe53..d48e91c 100644 --- a/src/main/python/ddadevops/artifact_deployment_mixin.py +++ b/src/main/python/ddadevops/artifact_deployment_mixin.py @@ -1,5 +1,6 @@ from pybuilder.core import Project from .devops_build import DevopsBuild +from .domain import MixinType # """ # Functional Req: @@ -46,7 +47,7 @@ from .devops_build import DevopsBuild # generate sha256 sums & generate sha512 sums of results of [-1] # [6] -# push results of [-1] & [5] to [0]/[4] +# push results of [-1] & [5] to [0]/[4]/assets # """ @@ -54,3 +55,7 @@ from .devops_build import DevopsBuild class ArtifactDeploymentMixin(DevopsBuild): def __init__(self, project: Project, inp: dict): super().__init__(project, inp) + devops = self.devops_repo.get_devops(self.project) + if MixinType.ARTIFACT_DEPLOYMENT not in devops.mixins: # TODO: Check for Release mixin as well + raise ValueError("ArtifactDeploymentMixin requires MixinType.ARTIFACT_DEPLOYMENT") + self.base_url = 'https://repo.prod.meissa.de/api/v1/repos/' From e6450b796fe8a2b7c9141561bb9a16a2d78fc252 Mon Sep 17 00:00:00 2001 From: bom Date: Thu, 3 Aug 2023 12:15:37 +0200 Subject: [PATCH 02/97] Add basic artifact service --- .../application/artifact_deployment_service.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/main/python/ddadevops/application/artifact_deployment_service.py diff --git a/src/main/python/ddadevops/application/artifact_deployment_service.py b/src/main/python/ddadevops/application/artifact_deployment_service.py new file mode 100644 index 0000000..f90847a --- /dev/null +++ b/src/main/python/ddadevops/application/artifact_deployment_service.py @@ -0,0 +1,15 @@ +from ..infrastructure import GitApi + + +class ArtifactDeploymentService: + def __init__(self, git_api: GitApi): + self.git_api = git_api + + @classmethod + def prod(cls): + return cls( + GitApi(), + ) + +# def __get_base_artifact_release_url(self, base_url: str, organization: str, name: str) -> str: +# return f"{base_url}/{organization}/{name}/releases" From 6dbbb8f2a11c06abf3b8ffeba24c871ce0364bd1 Mon Sep 17 00:00:00 2001 From: erik Date: Thu, 3 Aug 2023 12:45:53 +0200 Subject: [PATCH 03/97] [Skip-CI] Add ArtifactDeploymentApi --- .../infrastructure/infrastructure.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index 99ec45c..2c27fb1 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -206,3 +206,23 @@ class GitApi: class TerraformApi: pass + + +class ArtifactDeploymentApi: + def __init__(self): + self.execution_api = ExecutionApi() + + def post_release(self, target_url: str, token: str, tag: str): + self.execution_api.execute_secure(f"curl -X 'POST' '{target_url}' -H 'accept: application/json' -H 'Content-Type: application/json' -d " + + "'{ \"body\": \"Provides files for release " + tag + "\\nAttention: The \\\"Source Code\\\"-files below are not up-to-date!\", " + f"\"tag_name\": \"{tag}\"" + "}'" + + f"-H \"Authorization: token {token}\"") + + def post_asset(self, target_url: str, release_id: str, token: str, attachment: str, type: str): + self.execution_api.execute_secure(f"curl -X 'POST' '{target_url}/{release_id}/assets' -H 'accept: application/json' -H \"Authorization: token {token}\" -H 'Content-Type: multipart/form-data' -F 'attachment=@{attachment};type={type}'") + + def calculate_checksums(self, build_path: str): + self.execution_api.execute("find " + build_path + " -type f -exec sha256sum {} \\; | sort > " + build_path + "sha256sum.lst") + self.execution_api.execute("find " + build_path + " -type f -exec sha512sum {} \\; | sort > " + build_path + "sha512sum.lst") + + + \ No newline at end of file From 09bf3f5d4478a89dc8e74bf2c096b5b9680bd5b2 Mon Sep 17 00:00:00 2001 From: bom Date: Thu, 3 Aug 2023 13:33:57 +0200 Subject: [PATCH 04/97] Switch some quotes and brackets --- .../infrastructure/infrastructure.py | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index 2c27fb1..95b5105 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -213,16 +213,24 @@ class ArtifactDeploymentApi: self.execution_api = ExecutionApi() def post_release(self, target_url: str, token: str, tag: str): - self.execution_api.execute_secure(f"curl -X 'POST' '{target_url}' -H 'accept: application/json' -H 'Content-Type: application/json' -d " + - "'{ \"body\": \"Provides files for release " + tag + "\\nAttention: The \\\"Source Code\\\"-files below are not up-to-date!\", " + f"\"tag_name\": \"{tag}\"" + "}'" + - f"-H \"Authorization: token {token}\"") + self.execution_api.execute_secure(f'curl -X "POST" "{target_url}" ' + + '-H "accept: application/json" -H "Content-Type: application/json" ' + + f'-d "{{ "body": "Provides files for release {tag} Attention: The "Source Code"-files below are not up-to-date!", "tag_name": "{tag}"}}" ' # noqa: E501 + + f'-H "Authorization: token {token}"', + sanitized_command=f'curl -X "POST" "{target_url}" ' + + '-H "accept: application/json" -H "Content-Type: application/json" ' + + f'-d "{{ "body": "Provides files for release {tag} Attention: The "Source Code"-files below are not up-to-date!", "tag_name": "{tag}"}}" ') # noqa: E501 + + def post_asset(self, target_url: str, release_id: str, token: str, attachment: str, attachment_type: str): + self.execution_api.execute_secure(f'curl -X "POST" "{target_url}/{release_id}/assets" ' + + f'-H "accept: application/json" -H "Authorization: token {token}" ' + + '-H "Content-Type: multipart/form-data" ' + + f'-F "attachment=@{attachment};type={attachment_type}"', + sanitized_command=f'curl -X "POST" "{target_url}/{release_id}/assets" ' + + '-H "accept: application/json" ' + + '-H "Content-Type: multipart/form-data" ' + + f'-F "attachment=@{attachment};type={attachment_type}"') - def post_asset(self, target_url: str, release_id: str, token: str, attachment: str, type: str): - self.execution_api.execute_secure(f"curl -X 'POST' '{target_url}/{release_id}/assets' -H 'accept: application/json' -H \"Authorization: token {token}\" -H 'Content-Type: multipart/form-data' -F 'attachment=@{attachment};type={type}'") - def calculate_checksums(self, build_path: str): - self.execution_api.execute("find " + build_path + " -type f -exec sha256sum {} \\; | sort > " + build_path + "sha256sum.lst") - self.execution_api.execute("find " + build_path + " -type f -exec sha512sum {} \\; | sort > " + build_path + "sha512sum.lst") - - - \ No newline at end of file + self.execution_api.execute(f"find {build_path} -type f -exec sha256sum {{}}; | sort > {build_path} sha256sum.lst") + self.execution_api.execute(f"find {build_path} -type f -exec sha512sum {{}}; | sort > {build_path} sha512sum.lst") From 8d4921ea704bd13d35446c488ad46f526b6e9cf7 Mon Sep 17 00:00:00 2001 From: bom Date: Fri, 4 Aug 2023 11:47:32 +0200 Subject: [PATCH 05/97] Switch order of function parameters --- .../python/ddadevops/infrastructure/infrastructure.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index 95b5105..3279430 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -212,7 +212,7 @@ class ArtifactDeploymentApi: def __init__(self): self.execution_api = ExecutionApi() - def post_release(self, target_url: str, token: str, tag: str): + def post_release(self, target_url: str, tag: str, token: str): self.execution_api.execute_secure(f'curl -X "POST" "{target_url}" ' + '-H "accept: application/json" -H "Content-Type: application/json" ' + f'-d "{{ "body": "Provides files for release {tag} Attention: The "Source Code"-files below are not up-to-date!", "tag_name": "{tag}"}}" ' # noqa: E501 @@ -221,12 +221,12 @@ class ArtifactDeploymentApi: + '-H "accept: application/json" -H "Content-Type: application/json" ' + f'-d "{{ "body": "Provides files for release {tag} Attention: The "Source Code"-files below are not up-to-date!", "tag_name": "{tag}"}}" ') # noqa: E501 - def post_asset(self, target_url: str, release_id: str, token: str, attachment: str, attachment_type: str): - self.execution_api.execute_secure(f'curl -X "POST" "{target_url}/{release_id}/assets" ' + def post_asset(self, target_url: str, release_id: str, attachment: str, attachment_type: str, token: str): + self.execution_api.execute_secure(f'curl -X "POST" "{target_url}/{release_id}/assets" ' # {target_url}/{release_id}/assets move to Domain + f'-H "accept: application/json" -H "Authorization: token {token}" ' + '-H "Content-Type: multipart/form-data" ' + f'-F "attachment=@{attachment};type={attachment_type}"', - sanitized_command=f'curl -X "POST" "{target_url}/{release_id}/assets" ' + sanitized_command=f'curl -X "POST" "{target_url}/{release_id}/assets" ' # see above + '-H "accept: application/json" ' + '-H "Content-Type: multipart/form-data" ' + f'-F "attachment=@{attachment};type={attachment_type}"') From c02440ac65eee037d971bc5eff561038f1f7abf4 Mon Sep 17 00:00:00 2001 From: bom Date: Fri, 4 Aug 2023 11:47:55 +0200 Subject: [PATCH 06/97] Return values of post requests --- src/main/python/ddadevops/infrastructure/infrastructure.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index 3279430..40fee1b 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -213,7 +213,7 @@ class ArtifactDeploymentApi: self.execution_api = ExecutionApi() def post_release(self, target_url: str, tag: str, token: str): - self.execution_api.execute_secure(f'curl -X "POST" "{target_url}" ' + return self.execution_api.execute_secure(f'curl -X "POST" "{target_url}" ' + '-H "accept: application/json" -H "Content-Type: application/json" ' + f'-d "{{ "body": "Provides files for release {tag} Attention: The "Source Code"-files below are not up-to-date!", "tag_name": "{tag}"}}" ' # noqa: E501 + f'-H "Authorization: token {token}"', @@ -222,7 +222,7 @@ class ArtifactDeploymentApi: + f'-d "{{ "body": "Provides files for release {tag} Attention: The "Source Code"-files below are not up-to-date!", "tag_name": "{tag}"}}" ') # noqa: E501 def post_asset(self, target_url: str, release_id: str, attachment: str, attachment_type: str, token: str): - self.execution_api.execute_secure(f'curl -X "POST" "{target_url}/{release_id}/assets" ' # {target_url}/{release_id}/assets move to Domain + return self.execution_api.execute_secure(f'curl -X "POST" "{target_url}/{release_id}/assets" ' # {target_url}/{release_id}/assets move to Domain + f'-H "accept: application/json" -H "Authorization: token {token}" ' + '-H "Content-Type: multipart/form-data" ' + f'-F "attachment=@{attachment};type={attachment_type}"', From f3bf8cb335f33c51ae36fc80733bcd4f57ff3c2e Mon Sep 17 00:00:00 2001 From: bom Date: Fri, 4 Aug 2023 11:48:16 +0200 Subject: [PATCH 07/97] Add skeleton for ArtifactDeploymentService --- .../artifact_deployment_service.py | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/main/python/ddadevops/application/artifact_deployment_service.py b/src/main/python/ddadevops/application/artifact_deployment_service.py index f90847a..e7e3c61 100644 --- a/src/main/python/ddadevops/application/artifact_deployment_service.py +++ b/src/main/python/ddadevops/application/artifact_deployment_service.py @@ -1,15 +1,27 @@ -from ..infrastructure import GitApi - +from ..infrastructure import GitApi, ArtifactDeploymentApi +from ..domain import Credentials class ArtifactDeploymentService: - def __init__(self, git_api: GitApi): + def __init__(self, git_api: GitApi, artifact_deployment_api: ArtifactDeploymentApi): self.git_api = git_api + self.artifact_deployment_api = artifact_deployment_api @classmethod def prod(cls): return cls( GitApi(), + ArtifactDeploymentApi(), ) -# def __get_base_artifact_release_url(self, base_url: str, organization: str, name: str) -> str: -# return f"{base_url}/{organization}/{name}/releases" + def __get_base_artifact_release_url(self, base_url: str, organization: str, name: str) -> str: + return f"{base_url}/{organization}/{name}/releases" + + def post_release(self, target_url: str, tag: str, credentials: Credentials): + response = self.artifact_deployment_api.post_release(target_url, tag, credentials.mappings["token"]) + # Get release id from response + + def post_asset(self, target_url: str, release_id: str, attachment: str, attachment_type: str, token: str): + self.artifact_deployment_api.post_asset(target_url, release_id, attachment, attachment_type, token) + + def calculate_checksums(self, build_path: str): + self.artifact_deployment_api.calculate_checksums(build_path) From 911158f882d8099aefb341ec9b07e85183657a2c Mon Sep 17 00:00:00 2001 From: erik Date: Fri, 4 Aug 2023 12:08:23 +0200 Subject: [PATCH 08/97] Remove __get_base_artifact_release_url() --- .../ddadevops/application/artifact_deployment_service.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/python/ddadevops/application/artifact_deployment_service.py b/src/main/python/ddadevops/application/artifact_deployment_service.py index e7e3c61..a53a9cf 100644 --- a/src/main/python/ddadevops/application/artifact_deployment_service.py +++ b/src/main/python/ddadevops/application/artifact_deployment_service.py @@ -12,9 +12,6 @@ class ArtifactDeploymentService: GitApi(), ArtifactDeploymentApi(), ) - - def __get_base_artifact_release_url(self, base_url: str, organization: str, name: str) -> str: - return f"{base_url}/{organization}/{name}/releases" def post_release(self, target_url: str, tag: str, credentials: Credentials): response = self.artifact_deployment_api.post_release(target_url, tag, credentials.mappings["token"]) @@ -25,3 +22,5 @@ class ArtifactDeploymentService: def calculate_checksums(self, build_path: str): self.artifact_deployment_api.calculate_checksums(build_path) + + # ToDo: Update release Id as in release_mixin_services.py From 0952ec57a87c07bbeade33cc43dd1fad816c74a1 Mon Sep 17 00:00:00 2001 From: erik Date: Fri, 4 Aug 2023 12:09:09 +0200 Subject: [PATCH 09/97] [Skip-CI] Add initial artifact deployment domain object --- .../ddadevops/domain/artifact_deployment.py | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/main/python/ddadevops/domain/artifact_deployment.py diff --git a/src/main/python/ddadevops/domain/artifact_deployment.py b/src/main/python/ddadevops/domain/artifact_deployment.py new file mode 100644 index 0000000..64905cc --- /dev/null +++ b/src/main/python/ddadevops/domain/artifact_deployment.py @@ -0,0 +1,40 @@ +from typing import List, Dict, Optional +from .common import ( + Validateable, + CredentialMappingDefault, + DnsRecord, + Devops, +) + + +class ArtifactDeployment(Validateable, CredentialMappingDefault): + def __init__(self, inp: dict): + self.name = inp.get("name") + self.artifact_base_url = inp.get("artifact_base_url") + self.organization = inp.get("organization") + + def get_artifact_release_url(self) -> str: + return f"{self.artifact_base_url}/{self.organization}/{self.name}/releases" + + def get_artifact_asset_url(self, release_id: str) -> str: + return f"{self.get_artifact_release_url}/{release_id}/assets" + + def update_runtime_config(self, dns_record: DnsRecord): + self.dns_record = dns_record + self.throw_if_invalid() + + def validate(self) -> List[str]: + result = [] + result += self.__validate_is_not_empty__("name") + result += self.__validate_is_not_empty__("artifact_base_url") + return result + + @classmethod + def get_mapping_default(cls) -> List[Dict[str, str]]: + return [ # ToDo: Adapt for token + { + "gopass_path": "server/meissa/grafana-cloud", + "gopass_field": "grafana-cloud-user", + "name": "c4k_grafana_cloud_user", + } + ] From 2fc59f105b90fc8205cc1ee905983de544626443 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 11 Aug 2023 14:08:46 +0200 Subject: [PATCH 10/97] artifact publish ist part of release now --- build.py | 1 + .../python/ddadevops/application/release_mixin_services.py | 6 ++++++ src/main/python/ddadevops/release_mixin.py | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/build.py b/build.py index a1fddfb..c0377b4 100644 --- a/build.py +++ b/build.py @@ -176,6 +176,7 @@ def prepare(project): def tag(project): build = get_devops_build(project) build.tag_bump_and_push_release() + #TODO: build.publish_artifacts() def release(project): diff --git a/src/main/python/ddadevops/application/release_mixin_services.py b/src/main/python/ddadevops/application/release_mixin_services.py index c9ab06e..f686c3f 100644 --- a/src/main/python/ddadevops/application/release_mixin_services.py +++ b/src/main/python/ddadevops/application/release_mixin_services.py @@ -53,6 +53,12 @@ class ReleaseService: ) self.git_api.push_follow_tags() + def publish_artifacts(self, release: Release): + # calculate checksum + # create release + # add artifacts to release + pass + def __set_version_and_commit__( self, version: Version, build_file_ids: List[str], message: str ): diff --git a/src/main/python/ddadevops/release_mixin.py b/src/main/python/ddadevops/release_mixin.py index 3d7defd..5ece524 100644 --- a/src/main/python/ddadevops/release_mixin.py +++ b/src/main/python/ddadevops/release_mixin.py @@ -26,3 +26,8 @@ class ReleaseMixin(DevopsBuild): devops = self.devops_repo.get_devops(self.project) release = devops.mixins[MixinType.RELEASE] self.release_service.tag_bump_and_push_release(release) + + def publish_artifacts(self): + devops = self.devops_repo.get_devops(self.project) + release = devops.mixins[MixinType.RELEASE] + self.release_service.publish_artifacts(release) From 88253f49ac3e587710ebf6c91e564172447e99b2 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 11 Aug 2023 14:20:27 +0200 Subject: [PATCH 11/97] use new api in release-service --- .../application/release_mixin_services.py | 11 +++++++++-- .../python/ddadevops/infrastructure/__init__.py | 1 + .../application/test_release_mixin_services.py | 3 ++- src/test/python/domain/helper.py | 14 ++++++++++++++ 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/main/python/ddadevops/application/release_mixin_services.py b/src/main/python/ddadevops/application/release_mixin_services.py index f686c3f..f9aeb53 100644 --- a/src/main/python/ddadevops/application/release_mixin_services.py +++ b/src/main/python/ddadevops/application/release_mixin_services.py @@ -1,18 +1,25 @@ from typing import List from pathlib import Path -from ..infrastructure import GitApi, BuildFileRepository +from ..infrastructure import GitApi, ArtifactDeploymentApi, BuildFileRepository from ..domain import Version, Release, ReleaseType class ReleaseService: - def __init__(self, git_api: GitApi, build_file_repository: BuildFileRepository): + def __init__( + self, + git_api: GitApi, + build_file_repository: BuildFileRepository, + artifact_deployment_api: ArtifactDeploymentApi, + ): self.git_api = git_api + self.artifact_deployment_api = artifact_deployment_api self.build_file_repository = build_file_repository @classmethod def prod(cls, base_dir: str): return cls( GitApi(), + ArtifactDeploymentApi(), BuildFileRepository(base_dir), ) diff --git a/src/main/python/ddadevops/infrastructure/__init__.py b/src/main/python/ddadevops/infrastructure/__init__.py index 1bb11b5..1a520ed 100644 --- a/src/main/python/ddadevops/infrastructure/__init__.py +++ b/src/main/python/ddadevops/infrastructure/__init__.py @@ -7,5 +7,6 @@ from .infrastructure import ( CredentialsApi, GitApi, TerraformApi, + ArtifactDeploymentApi, ) from .repository import DevopsRepository, BuildFileRepository diff --git a/src/test/python/application/test_release_mixin_services.py b/src/test/python/application/test_release_mixin_services.py index 40f6553..b6fbe02 100644 --- a/src/test/python/application/test_release_mixin_services.py +++ b/src/test/python/application/test_release_mixin_services.py @@ -7,12 +7,13 @@ from src.main.python.ddadevops.domain import ( from src.test.python.domain.helper import ( BuildFileRepositoryMock, GitApiMock, + ArtifactDeploymentApiMock, build_devops, ) from src.main.python.ddadevops.application import ReleaseService def test_sould_update_release_type(): - sut = ReleaseService(GitApiMock(), BuildFileRepositoryMock("build.py")) + sut = ReleaseService(GitApiMock(), ArtifactDeploymentApiMock(), BuildFileRepositoryMock("build.py")) devops = build_devops({}) release = devops.mixins[MixinType.RELEASE] sut.update_release_type(release, "MAJOR") diff --git a/src/test/python/domain/helper.py b/src/test/python/domain/helper.py index 05161d0..74a67d5 100644 --- a/src/test/python/domain/helper.py +++ b/src/test/python/domain/helper.py @@ -150,3 +150,17 @@ class GitApiMock: def checkout(self, branch: str): pass + + +class ArtifactDeploymentApiMock: + def __init__(self): + pass + + def post_release(self, target_url: str, tag: str, token: str): + pass + + def post_asset(self, target_url: str, release_id: str, attachment: str, attachment_type: str, token: str): + pass + + def calculate_checksums(self, build_path: str): + pass From 074e77196e320f74a9ec48d83b4c940f2f9c2cc8 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 11 Aug 2023 14:24:11 +0200 Subject: [PATCH 12/97] wip calculate-sha [skip-ci] --- src/main/python/ddadevops/application/release_mixin_services.py | 2 +- src/main/python/ddadevops/infrastructure/infrastructure.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/python/ddadevops/application/release_mixin_services.py b/src/main/python/ddadevops/application/release_mixin_services.py index f9aeb53..84c5533 100644 --- a/src/main/python/ddadevops/application/release_mixin_services.py +++ b/src/main/python/ddadevops/application/release_mixin_services.py @@ -61,7 +61,7 @@ class ReleaseService: self.git_api.push_follow_tags() def publish_artifacts(self, release: Release): - # calculate checksum + self.artifact_deployment_api.calculate_checksums(artifact_path=) # create release # add artifacts to release pass diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index 40fee1b..878581c 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -231,6 +231,6 @@ class ArtifactDeploymentApi: + '-H "Content-Type: multipart/form-data" ' + f'-F "attachment=@{attachment};type={attachment_type}"') - def calculate_checksums(self, build_path: str): + def calculate_checksums(self, artifact_path: str): self.execution_api.execute(f"find {build_path} -type f -exec sha256sum {{}}; | sort > {build_path} sha256sum.lst") self.execution_api.execute(f"find {build_path} -type f -exec sha512sum {{}}; | sort > {build_path} sha512sum.lst") From 369f62ff38a3b242a117d2c5d5223e888d2b069c Mon Sep 17 00:00:00 2001 From: erik Date: Fri, 11 Aug 2023 14:25:12 +0200 Subject: [PATCH 13/97] Correct var names --- src/main/python/ddadevops/infrastructure/infrastructure.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index 878581c..44054bb 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -232,5 +232,5 @@ class ArtifactDeploymentApi: + f'-F "attachment=@{attachment};type={attachment_type}"') def calculate_checksums(self, artifact_path: str): - self.execution_api.execute(f"find {build_path} -type f -exec sha256sum {{}}; | sort > {build_path} sha256sum.lst") - self.execution_api.execute(f"find {build_path} -type f -exec sha512sum {{}}; | sort > {build_path} sha512sum.lst") + self.execution_api.execute(f"find {artifact_path} -type f -exec sha256sum {{}}; | sort > {artifact_path} sha256sum.lst") + self.execution_api.execute(f"find {artifact_path} -type f -exec sha512sum {{}}; | sort > {artifact_path} sha512sum.lst") From 935baa9932a41c6e985ab9c1ad7ad276f002c041 Mon Sep 17 00:00:00 2001 From: erik Date: Fri, 11 Aug 2023 14:35:52 +0200 Subject: [PATCH 14/97] Simpler sha calc command --- src/main/python/ddadevops/infrastructure/infrastructure.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index 44054bb..5a7ab9a 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -232,5 +232,6 @@ class ArtifactDeploymentApi: + f'-F "attachment=@{attachment};type={attachment_type}"') def calculate_checksums(self, artifact_path: str): - self.execution_api.execute(f"find {artifact_path} -type f -exec sha256sum {{}}; | sort > {artifact_path} sha256sum.lst") - self.execution_api.execute(f"find {artifact_path} -type f -exec sha512sum {{}}; | sort > {artifact_path} sha512sum.lst") + # self.execution_api.execute(f"find {artifact_path} -type f -exec sha256sum {{}}; | sort > {artifact_path} sha256sum.lst") relevant für provs + self.execution_api(f"sha256sum {artifact_path} > {artifact_path}.sha256",) + self.execution_api(f"sha512sum {artifact_path} > {artifact_path}.sha512",) From 337a7900444f8486387ed23cb1d33dfa0819367d Mon Sep 17 00:00:00 2001 From: erik Date: Fri, 11 Aug 2023 14:38:41 +0200 Subject: [PATCH 15/97] Implement checksum calculation --- doc/architecture/Domain.md | 1 + .../python/ddadevops/application/release_mixin_services.py | 3 ++- src/main/python/ddadevops/domain/release.py | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/architecture/Domain.md b/doc/architecture/Domain.md index afb8378..a865a1e 100644 --- a/doc/architecture/Domain.md +++ b/doc/architecture/Domain.md @@ -88,6 +88,7 @@ classDiagram release_type release_main_branch release_current_branch + release_artifacts } class Credentials { <> diff --git a/src/main/python/ddadevops/application/release_mixin_services.py b/src/main/python/ddadevops/application/release_mixin_services.py index 84c5533..6b5624b 100644 --- a/src/main/python/ddadevops/application/release_mixin_services.py +++ b/src/main/python/ddadevops/application/release_mixin_services.py @@ -61,7 +61,8 @@ class ReleaseService: self.git_api.push_follow_tags() def publish_artifacts(self, release: Release): - self.artifact_deployment_api.calculate_checksums(artifact_path=) + for artifact_path in release.release_artifacts: + self.artifact_deployment_api.calculate_checksums(artifact_path) # create release # add artifacts to release pass diff --git a/src/main/python/ddadevops/domain/release.py b/src/main/python/ddadevops/domain/release.py index e8a6db5..ae3720b 100644 --- a/src/main/python/ddadevops/domain/release.py +++ b/src/main/python/ddadevops/domain/release.py @@ -17,6 +17,9 @@ class Release(Validateable): self.release_primary_build_file = inp.get( "release_primary_build_file", "./project.clj" ) + self.release_artifacts = inp.get( + "release_artifacts", [] + ) self.release_secondary_build_files = inp.get( "release_secondary_build_files", [] ) From 39591c8aa99332364e2a055b107a08c07974f3ef Mon Sep 17 00:00:00 2001 From: erik Date: Fri, 11 Aug 2023 14:45:43 +0200 Subject: [PATCH 16/97] [Skip-CI] WIP Implement release publishing --- src/main/python/ddadevops/application/release_mixin_services.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/python/ddadevops/application/release_mixin_services.py b/src/main/python/ddadevops/application/release_mixin_services.py index 6b5624b..b15f260 100644 --- a/src/main/python/ddadevops/application/release_mixin_services.py +++ b/src/main/python/ddadevops/application/release_mixin_services.py @@ -63,7 +63,7 @@ class ReleaseService: def publish_artifacts(self, release: Release): for artifact_path in release.release_artifacts: self.artifact_deployment_api.calculate_checksums(artifact_path) - # create release + self.artifact_deployment_api.post_release(release) # create release # add artifacts to release pass From 2469fd2f5bacfc944df9463c4869a92091cbfb29 Mon Sep 17 00:00:00 2001 From: erik Date: Fri, 11 Aug 2023 14:46:25 +0200 Subject: [PATCH 17/97] [Skip-CI] Rename function --- src/main/python/ddadevops/infrastructure/infrastructure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index 5a7ab9a..0a41221 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -212,7 +212,7 @@ class ArtifactDeploymentApi: def __init__(self): self.execution_api = ExecutionApi() - def post_release(self, target_url: str, tag: str, token: str): + def create_forgejo_release(self, target_url: str, tag: str, token: str): return self.execution_api.execute_secure(f'curl -X "POST" "{target_url}" ' + '-H "accept: application/json" -H "Content-Type: application/json" ' + f'-d "{{ "body": "Provides files for release {tag} Attention: The "Source Code"-files below are not up-to-date!", "tag_name": "{tag}"}}" ' # noqa: E501 From 5f5743354ca34865be0228b1980c9e5566a64820 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 11 Aug 2023 15:08:21 +0200 Subject: [PATCH 18/97] wip: calculate forgejo_release_api_endpoint --- src/main/python/ddadevops/domain/release.py | 8 ++++ src/test/python/domain/helper.py | 4 ++ src/test/python/domain/test_release.py | 46 +++++++++++++++++++++ 3 files changed, 58 insertions(+) diff --git a/src/main/python/ddadevops/domain/release.py b/src/main/python/ddadevops/domain/release.py index ae3720b..b8c64ec 100644 --- a/src/main/python/ddadevops/domain/release.py +++ b/src/main/python/ddadevops/domain/release.py @@ -24,6 +24,9 @@ class Release(Validateable): "release_secondary_build_files", [] ) self.version = version + 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") def update_release_type(self, release_type: ReleaseType): self.release_type = release_type @@ -63,3 +66,8 @@ class Release(Validateable): result = [self.release_primary_build_file] result += self.release_secondary_build_files return result + + def forgejo_release_api_endpoint(self): + if self.release_artifact_server_url == None or self.release_organisation == None or self.release_repository_name == None: + raise RuntimeError("when doing artifact release, release_artifact_server_url, release_organisation, release_repository_name may not be None.") + return f"{self.release_artifact_server_url}/api/v1/repos/{self.release_organisation}/{self.release_repository_name}/releases" diff --git a/src/test/python/domain/helper.py b/src/test/python/domain/helper.py index 74a67d5..31a8911 100644 --- a/src/test/python/domain/helper.py +++ b/src/test/python/domain/helper.py @@ -53,6 +53,10 @@ def devops_config(overrides: dict) -> dict: "release_current_branch": "my_feature", "release_primary_build_file": "./package.json", "release_secondary_build_file": [], + "release_artifacts": [], + "release_artifact_server_url": None, + "release_organisation": None, + "release_repository_name": None, "credentials_mappings": [ { "gopass_path": "a/path", diff --git a/src/test/python/domain/test_release.py b/src/test/python/domain/test_release.py index c23bc39..48b520a 100644 --- a/src/test/python/domain/test_release.py +++ b/src/test/python/domain/test_release.py @@ -1,3 +1,4 @@ +import pytest from pybuilder.core import Project from pathlib import Path from src.main.python.ddadevops.domain import ( @@ -61,3 +62,48 @@ def test_sould_calculate_build_files(): Version.from_str("1.3.1-SNAPSHOT", "SNAPSHOT"), ) assert ["project.clj", "package.json"] == sut.build_files() + + +def test_should_calculate_forgejo_release_api_endpoint(): + sut = Release( + devops_config( + { + "release_artifact_server_url": "https://repo.prod.meissa.de", + "release_organisation": "meissa", + "release_repository_name": "provs", + } + ), + Version.from_str("1.3.1-SNAPSHOT", "SNAPSHOT"), + ) + assert ( + "https://repo.prod.meissa.de/api/v1/repos/meissa/provs/releases" + == sut.forgejo_release_api_endpoint() + ) + + sut = Release( + devops_config( + { + "release_artifact_server_url": "https://repo.prod.meissa.de/", + "release_organisation": "/meissa/", + "release_repository_name": "provs", + } + ), + Version.from_str("1.3.1-SNAPSHOT", "SNAPSHOT"), + ) + assert ( + "https://repo.prod.meissa.de/api/v1/repos/meissa/provs/releases" + == sut.forgejo_release_api_endpoint() + ) + + with pytest.raises(Exception): + sut = Release( + devops_config( + { + "release_artifact_server_url": "https://repo.prod.meissa.de", + "release_organisation": None, + "release_repository_name": "provs", + } + ), + Version.from_str("1.3.1-SNAPSHOT", "SNAPSHOT"), + ) + sut.forgejo_release_api_endpoint() From f4be6e0c8ba9fd39d18610b213913d9fa7306703 Mon Sep 17 00:00:00 2001 From: erik Date: Fri, 11 Aug 2023 15:26:59 +0200 Subject: [PATCH 19/97] Implement calculation of forgejo release api endpoint url --- .../python/ddadevops/application/release_mixin_services.py | 2 +- src/main/python/ddadevops/domain/release.py | 6 +++++- src/test/python/domain/test_release.py | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/python/ddadevops/application/release_mixin_services.py b/src/main/python/ddadevops/application/release_mixin_services.py index b15f260..19e167e 100644 --- a/src/main/python/ddadevops/application/release_mixin_services.py +++ b/src/main/python/ddadevops/application/release_mixin_services.py @@ -63,7 +63,7 @@ class ReleaseService: def publish_artifacts(self, release: Release): for artifact_path in release.release_artifacts: self.artifact_deployment_api.calculate_checksums(artifact_path) - self.artifact_deployment_api.post_release(release) # create release + self.artifact_deployment_api.create_forgejo_release(release.forgejo_release_api_endpoint) # create release # add artifacts to release pass diff --git a/src/main/python/ddadevops/domain/release.py b/src/main/python/ddadevops/domain/release.py index b8c64ec..7679ff8 100644 --- a/src/main/python/ddadevops/domain/release.py +++ b/src/main/python/ddadevops/domain/release.py @@ -70,4 +70,8 @@ class Release(Validateable): def forgejo_release_api_endpoint(self): if self.release_artifact_server_url == None or self.release_organisation == None or self.release_repository_name == None: raise RuntimeError("when doing artifact release, release_artifact_server_url, release_organisation, release_repository_name may not be None.") - return f"{self.release_artifact_server_url}/api/v1/repos/{self.release_organisation}/{self.release_repository_name}/releases" + + server_url = self.release_artifact_server_url.removeprefix("/").removesuffix("/") + organisation = self.release_organisation.removeprefix("/").removesuffix("/") + repository = self.release_repository_name.removeprefix("/").removesuffix("/") + return f"{server_url}/api/v1/repos/{organisation}/{repository}/releases" diff --git a/src/test/python/domain/test_release.py b/src/test/python/domain/test_release.py index 48b520a..ffd1ffb 100644 --- a/src/test/python/domain/test_release.py +++ b/src/test/python/domain/test_release.py @@ -94,6 +94,10 @@ def test_should_calculate_forgejo_release_api_endpoint(): "https://repo.prod.meissa.de/api/v1/repos/meissa/provs/releases" == sut.forgejo_release_api_endpoint() ) + assert( + "/meissa/" + == sut.release_organisation + ) with pytest.raises(Exception): sut = Release( From db8b41be19983632ec845a04bb6b156c0d36a02f Mon Sep 17 00:00:00 2001 From: erik Date: Fri, 11 Aug 2023 15:29:07 +0200 Subject: [PATCH 20/97] Add comments for moving functionality --- .../python/ddadevops/application/artifact_deployment_service.py | 1 + src/main/python/ddadevops/artifact_deployment_mixin.py | 2 +- src/main/python/ddadevops/domain/artifact_deployment.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/python/ddadevops/application/artifact_deployment_service.py b/src/main/python/ddadevops/application/artifact_deployment_service.py index a53a9cf..3d8a3b4 100644 --- a/src/main/python/ddadevops/application/artifact_deployment_service.py +++ b/src/main/python/ddadevops/application/artifact_deployment_service.py @@ -1,6 +1,7 @@ from ..infrastructure import GitApi, ArtifactDeploymentApi from ..domain import Credentials +# This will be moved to release mixin class ArtifactDeploymentService: def __init__(self, git_api: GitApi, artifact_deployment_api: ArtifactDeploymentApi): self.git_api = git_api diff --git a/src/main/python/ddadevops/artifact_deployment_mixin.py b/src/main/python/ddadevops/artifact_deployment_mixin.py index d48e91c..77a373c 100644 --- a/src/main/python/ddadevops/artifact_deployment_mixin.py +++ b/src/main/python/ddadevops/artifact_deployment_mixin.py @@ -51,7 +51,7 @@ from .domain import MixinType # """ - +# This will be moved to release mixin class ArtifactDeploymentMixin(DevopsBuild): def __init__(self, project: Project, inp: dict): super().__init__(project, inp) diff --git a/src/main/python/ddadevops/domain/artifact_deployment.py b/src/main/python/ddadevops/domain/artifact_deployment.py index 64905cc..4d0976f 100644 --- a/src/main/python/ddadevops/domain/artifact_deployment.py +++ b/src/main/python/ddadevops/domain/artifact_deployment.py @@ -6,7 +6,7 @@ from .common import ( Devops, ) - +# This will be moved to release mixin class ArtifactDeployment(Validateable, CredentialMappingDefault): def __init__(self, inp: dict): self.name = inp.get("name") From cb41ad0719f1816cadc9deffa87653746bcceb2a Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 11 Aug 2023 15:37:07 +0200 Subject: [PATCH 21/97] update domain doc --- doc/architecture/Domain.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/architecture/Domain.md b/doc/architecture/Domain.md index a865a1e..1f4bb88 100644 --- a/doc/architecture/Domain.md +++ b/doc/architecture/Domain.md @@ -89,6 +89,9 @@ classDiagram release_main_branch release_current_branch release_artifacts + release_artifact_server_url + release_organisation + release_repository_name } class Credentials { <> From 5d2596bd3f33a0eaa636a8e448cfdd9897a6901d Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 11 Aug 2023 15:49:25 +0200 Subject: [PATCH 22/97] improve some linting --- .../application/release_mixin_services.py | 7 +- src/main/python/ddadevops/domain/release.py | 25 ++++-- .../infrastructure/infrastructure.py | 79 ++++++++++++------- 3 files changed, 72 insertions(+), 39 deletions(-) diff --git a/src/main/python/ddadevops/application/release_mixin_services.py b/src/main/python/ddadevops/application/release_mixin_services.py index 19e167e..db0a8f8 100644 --- a/src/main/python/ddadevops/application/release_mixin_services.py +++ b/src/main/python/ddadevops/application/release_mixin_services.py @@ -8,8 +8,8 @@ class ReleaseService: def __init__( self, git_api: GitApi, - build_file_repository: BuildFileRepository, artifact_deployment_api: ArtifactDeploymentApi, + build_file_repository: BuildFileRepository, ): self.git_api = git_api self.artifact_deployment_api = artifact_deployment_api @@ -63,7 +63,10 @@ class ReleaseService: def publish_artifacts(self, release: Release): for artifact_path in release.release_artifacts: self.artifact_deployment_api.calculate_checksums(artifact_path) - self.artifact_deployment_api.create_forgejo_release(release.forgejo_release_api_endpoint) # create release + self.artifact_deployment_api.create_forgejo_release( + release.forgejo_release_api_endpoint(), + ) + # create release # add artifacts to release pass diff --git a/src/main/python/ddadevops/domain/release.py b/src/main/python/ddadevops/domain/release.py index 7679ff8..8d50eec 100644 --- a/src/main/python/ddadevops/domain/release.py +++ b/src/main/python/ddadevops/domain/release.py @@ -17,9 +17,7 @@ class Release(Validateable): self.release_primary_build_file = inp.get( "release_primary_build_file", "./project.clj" ) - self.release_artifacts = inp.get( - "release_artifacts", [] - ) + self.release_artifacts = inp.get("release_artifacts", []) self.release_secondary_build_files = inp.get( "release_secondary_build_files", [] ) @@ -59,7 +57,9 @@ class Release(Validateable): 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}") + result.append( + f"Releases are allowed only on {self.release_main_branch}" + ) return result def build_files(self) -> List[str]: @@ -68,10 +68,19 @@ class Release(Validateable): return result def forgejo_release_api_endpoint(self): - if self.release_artifact_server_url == None or self.release_organisation == None or self.release_repository_name == None: - raise RuntimeError("when doing artifact release, release_artifact_server_url, release_organisation, release_repository_name may not be None.") - - server_url = self.release_artifact_server_url.removeprefix("/").removesuffix("/") + if ( + self.release_artifact_server_url is None + or self.release_organisation is None + or self.release_repository_name is None + ): + raise RuntimeError( + "when doing artifact release, release_artifact_server_url, "+ + "release_organisation, release_repository_name may not be None." + ) + + server_url = self.release_artifact_server_url.removeprefix("/").removesuffix( + "/" + ) organisation = self.release_organisation.removeprefix("/").removesuffix("/") repository = self.release_repository_name.removeprefix("/").removesuffix("/") return f"{server_url}/api/v1/repos/{organisation}/{repository}/releases" diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index 0a41221..5aaf88e 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -65,16 +65,12 @@ class ImageApi: def dockerhub_login(self, username: str, password: str): self.execution_api.execute_secure( f"docker login --username {username} --password {password}", - "docker login --username ***** --password *****" + "docker login --username ***** --password *****", ) def dockerhub_publish(self, name: str, username: str, tag: str): - self.execution_api.execute_live( - f"docker tag {name} {username}/{name}:{tag}" - ) - self.execution_api.execute_live( - f"docker push {username}/{name}:{tag}" - ) + self.execution_api.execute_live(f"docker tag {name} {username}/{name}:{tag}") + self.execution_api.execute_live(f"docker push {username}/{name}:{tag}") def test(self, name: str, path: Path): self.execution_api.execute_live( @@ -95,14 +91,24 @@ class ExecutionApi: check=check, stdout=PIPE, stderr=PIPE, - text=True).stdout + text=True, + ).stdout output = output.rstrip() except CalledProcessError as exc: - print(f"Command failed with code: {exc.returncode} and message: {exc.stderr}") + print( + f"Command failed with code: {exc.returncode} and message: {exc.stderr}" + ) raise exc return output - def execute_secure(self, command: str, sanitized_command: str, dry_run=False, shell=True, check=True): + def execute_secure( + self, + command: str, + sanitized_command: str, + dry_run=False, + shell=True, + check=True, + ): try: output = self.execute(command, dry_run, shell, check) return output @@ -213,25 +219,40 @@ class ArtifactDeploymentApi: self.execution_api = ExecutionApi() def create_forgejo_release(self, target_url: str, tag: str, token: str): - return self.execution_api.execute_secure(f'curl -X "POST" "{target_url}" ' - + '-H "accept: application/json" -H "Content-Type: application/json" ' - + f'-d "{{ "body": "Provides files for release {tag} Attention: The "Source Code"-files below are not up-to-date!", "tag_name": "{tag}"}}" ' # noqa: E501 - + f'-H "Authorization: token {token}"', - sanitized_command=f'curl -X "POST" "{target_url}" ' - + '-H "accept: application/json" -H "Content-Type: application/json" ' - + f'-d "{{ "body": "Provides files for release {tag} Attention: The "Source Code"-files below are not up-to-date!", "tag_name": "{tag}"}}" ') # noqa: E501 - - def post_asset(self, target_url: str, release_id: str, attachment: str, attachment_type: str, token: str): - return self.execution_api.execute_secure(f'curl -X "POST" "{target_url}/{release_id}/assets" ' # {target_url}/{release_id}/assets move to Domain - + f'-H "accept: application/json" -H "Authorization: token {token}" ' - + '-H "Content-Type: multipart/form-data" ' - + f'-F "attachment=@{attachment};type={attachment_type}"', - sanitized_command=f'curl -X "POST" "{target_url}/{release_id}/assets" ' # see above - + '-H "accept: application/json" ' - + '-H "Content-Type: multipart/form-data" ' - + f'-F "attachment=@{attachment};type={attachment_type}"') + return self.execution_api.execute_secure( + f'curl -X "POST" "{target_url}" ' + + '-H "accept: application/json" -H "Content-Type: application/json" ' + + f'-d "{{ "body": "Provides files for release {tag} Attention: The "Source Code"-files below are not up-to-date!", "tag_name": "{tag}"}}" ' # noqa: E501 + + f'-H "Authorization: token {token}"', + sanitized_command=f'curl -X "POST" "{target_url}" ' + + '-H "accept: application/json" -H "Content-Type: application/json" ' + + f'-d "{{ "body": "Provides files for release {tag} Attention: The "Source Code"-files below are not up-to-date!", "tag_name": "{tag}"}}" ', + ) # noqa: E501 + + def post_asset( + self, + target_url: str, + release_id: str, + attachment: str, + attachment_type: str, + token: str, + ): + return self.execution_api.execute_secure( + f'curl -X "POST" "{target_url}/{release_id}/assets" ' # {target_url}/{release_id}/assets move to Domain + + f'-H "accept: application/json" -H "Authorization: token {token}" ' + + '-H "Content-Type: multipart/form-data" ' + + f'-F "attachment=@{attachment};type={attachment_type}"', + sanitized_command=f'curl -X "POST" "{target_url}/{release_id}/assets" ' # see above + + '-H "accept: application/json" ' + + '-H "Content-Type: multipart/form-data" ' + + f'-F "attachment=@{attachment};type={attachment_type}"', + ) def calculate_checksums(self, artifact_path: str): # self.execution_api.execute(f"find {artifact_path} -type f -exec sha256sum {{}}; | sort > {artifact_path} sha256sum.lst") relevant für provs - self.execution_api(f"sha256sum {artifact_path} > {artifact_path}.sha256",) - self.execution_api(f"sha512sum {artifact_path} > {artifact_path}.sha512",) + self.execution_api( + f"sha256sum {artifact_path} > {artifact_path}.sha256", + ) + self.execution_api( + f"sha512sum {artifact_path} > {artifact_path}.sha512", + ) From 3cfb453454f7d1df32f3d1136b522dca7abefe0c Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 11 Aug 2023 15:54:15 +0200 Subject: [PATCH 23/97] improve some linting --- src/main/python/ddadevops/domain/release.py | 4 ++-- src/main/python/ddadevops/infrastructure/infrastructure.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/python/ddadevops/domain/release.py b/src/main/python/ddadevops/domain/release.py index 8d50eec..b28e5da 100644 --- a/src/main/python/ddadevops/domain/release.py +++ b/src/main/python/ddadevops/domain/release.py @@ -74,8 +74,8 @@ class Release(Validateable): or self.release_repository_name is None ): raise RuntimeError( - "when doing artifact release, release_artifact_server_url, "+ - "release_organisation, release_repository_name may not be None." + "when doing artifact release, release_artifact_server_url, " + + "release_organisation, release_repository_name may not be None." ) server_url = self.release_artifact_server_url.removeprefix("/").removesuffix( diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index 5aaf88e..1da56bb 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -249,7 +249,9 @@ class ArtifactDeploymentApi: ) def calculate_checksums(self, artifact_path: str): - # self.execution_api.execute(f"find {artifact_path} -type f -exec sha256sum {{}}; | sort > {artifact_path} sha256sum.lst") relevant für provs + # self.execution_api.execute(f"find {artifact_path} -type f + # -exec sha256sum {{}}; | sort > {artifact_path} sha256sum.lst") + # relevant für provs self.execution_api( f"sha256sum {artifact_path} > {artifact_path}.sha256", ) From 2217e5c8d1e5d2b2d64818cb9b5177d2e1ab7fa8 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 11 Aug 2023 16:16:03 +0200 Subject: [PATCH 24/97] add token & improve artifact validation --- src/main/python/ddadevops/domain/release.py | 33 ++++++++++++++------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/src/main/python/ddadevops/domain/release.py b/src/main/python/ddadevops/domain/release.py index b28e5da..29f78c1 100644 --- a/src/main/python/ddadevops/domain/release.py +++ b/src/main/python/ddadevops/domain/release.py @@ -1,4 +1,4 @@ -from typing import Optional, List +from typing import Optional, List, Dict from pathlib import Path from .common import ( Validateable, @@ -25,6 +25,7 @@ class Release(Validateable): 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") + self.release_artifact_token = inp.get("release_artifact_token") def update_release_type(self, release_type: ReleaseType): self.release_type = release_type @@ -62,21 +63,24 @@ class Release(Validateable): ) return result + def validate_for_artifact(self): + result = [] + result += self.__validate_is_not_empty__("release_artifact_server_url") + result += self.__validate_is_not_empty__("release_organisation") + result += self.__validate_is_not_empty__("release_repository_name") + result += self.__validate_is_not_empty__("release_artifacts") + result += self.__validate_is_not_empty__("release_artifact_token") + return result + def build_files(self) -> List[str]: result = [self.release_primary_build_file] result += self.release_secondary_build_files return result def forgejo_release_api_endpoint(self): - if ( - self.release_artifact_server_url is None - or self.release_organisation is None - or self.release_repository_name is None - ): - raise RuntimeError( - "when doing artifact release, release_artifact_server_url, " - + "release_organisation, release_repository_name may not be None." - ) + validation = self.validate_for_artifact() + if validation != []: + raise RuntimeError(f"not valid for creating artifacts: {validation}") server_url = self.release_artifact_server_url.removeprefix("/").removesuffix( "/" @@ -84,3 +88,12 @@ class Release(Validateable): organisation = self.release_organisation.removeprefix("/").removesuffix("/") repository = self.release_repository_name.removeprefix("/").removesuffix("/") return f"{server_url}/api/v1/repos/{organisation}/{repository}/releases" + + @classmethod + def get_mapping_default(cls) -> List[Dict[str, str]]: + return [ + { + "gopass_path": "server/meissa/repo/buero-rw", + "name": "release_artifact_token", + } + ] From f30609288a412be1f2e121f7d073c3ebc7b34671 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 11 Aug 2023 16:16:25 +0200 Subject: [PATCH 25/97] add token & improve artifact validation --- src/test/python/domain/test_release.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/test/python/domain/test_release.py b/src/test/python/domain/test_release.py index ffd1ffb..42f8699 100644 --- a/src/test/python/domain/test_release.py +++ b/src/test/python/domain/test_release.py @@ -68,6 +68,8 @@ def test_should_calculate_forgejo_release_api_endpoint(): sut = Release( devops_config( { + "release_artifacts": ["x"], + "release_artifact_token": "y", "release_artifact_server_url": "https://repo.prod.meissa.de", "release_organisation": "meissa", "release_repository_name": "provs", @@ -83,6 +85,8 @@ def test_should_calculate_forgejo_release_api_endpoint(): sut = Release( devops_config( { + "release_artifacts": ["x"], + "release_artifact_token": "y", "release_artifact_server_url": "https://repo.prod.meissa.de/", "release_organisation": "/meissa/", "release_repository_name": "provs", From ee58151a8df2a900ae1161211175320b7d6ae711 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 11 Aug 2023 16:17:07 +0200 Subject: [PATCH 26/97] initialize default credentials --- src/main/python/ddadevops/domain/init_service.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/python/ddadevops/domain/init_service.py b/src/main/python/ddadevops/domain/init_service.py index 2d5ab56..1afa1f3 100644 --- a/src/main/python/ddadevops/domain/init_service.py +++ b/src/main/python/ddadevops/domain/init_service.py @@ -8,7 +8,7 @@ from .provider_digitalocean import Digitalocean from .provider_hetzner import Hetzner from .c4k import C4k from .image import Image -from .release import ReleaseType +from .release import ReleaseType, Release from ..infrastructure import BuildFileRepository, CredentialsApi, EnvironmentApi, GitApi @@ -69,6 +69,7 @@ class InitService: Path(primary_build_file_id) ) version = primary_build_file.get_version() + default_mappings += Release.get_mapping_default() credentials = Credentials(inp, default_mappings) authorization = self.authorization(credentials) From 700a0a2f4f6d4e09991c2f2db9fef444dc415cc8 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 11 Aug 2023 16:17:42 +0200 Subject: [PATCH 27/97] add missing informations for creating release --- src/main/python/ddadevops/application/release_mixin_services.py | 2 ++ src/test/python/domain/helper.py | 1 + 2 files changed, 3 insertions(+) diff --git a/src/main/python/ddadevops/application/release_mixin_services.py b/src/main/python/ddadevops/application/release_mixin_services.py index db0a8f8..5e657cc 100644 --- a/src/main/python/ddadevops/application/release_mixin_services.py +++ b/src/main/python/ddadevops/application/release_mixin_services.py @@ -65,6 +65,8 @@ class ReleaseService: self.artifact_deployment_api.calculate_checksums(artifact_path) self.artifact_deployment_api.create_forgejo_release( release.forgejo_release_api_endpoint(), + release.version.to_string(), + release.release_artifact_token ) # create release # add artifacts to release diff --git a/src/test/python/domain/helper.py b/src/test/python/domain/helper.py index 31a8911..5311703 100644 --- a/src/test/python/domain/helper.py +++ b/src/test/python/domain/helper.py @@ -54,6 +54,7 @@ def devops_config(overrides: dict) -> dict: "release_primary_build_file": "./package.json", "release_secondary_build_file": [], "release_artifacts": [], + "release_artifact_token": "release_artifact_token", "release_artifact_server_url": None, "release_organisation": None, "release_repository_name": None, From b861087e9db33f7067b45cc395f1a397d8c73fc6 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Mon, 14 Aug 2023 08:24:42 +0200 Subject: [PATCH 28/97] fix test no longer needs gopass --- src/test/python/test_release_mixin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/python/test_release_mixin.py b/src/test/python/test_release_mixin.py index 291eb73..a2539a6 100644 --- a/src/test/python/test_release_mixin.py +++ b/src/test/python/test_release_mixin.py @@ -14,6 +14,8 @@ def test_release_mixin(tmp_path): copy_resource(Path("package.json"), tmp_path) project = Project(str_tmp_path, name="name") + os.environ["RELEASE_ARTIFACT_TOKEN"] = "ratoken" + sut = ReleaseMixin( project, devops_config( From e0150e6fcced43e06c9739b11632524dce757b3f Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Mon, 14 Aug 2023 08:59:45 +0200 Subject: [PATCH 29/97] parse the release_id from create response --- .../application/release_mixin_services.py | 23 ++++++++++++------- .../infrastructure/infrastructure.py | 2 +- .../test_release_mixin_services.py | 23 +++++++++++++++++-- src/test/python/domain/helper.py | 20 ++++++++++------ 4 files changed, 50 insertions(+), 18 deletions(-) diff --git a/src/main/python/ddadevops/application/release_mixin_services.py b/src/main/python/ddadevops/application/release_mixin_services.py index 5e657cc..2b094a8 100644 --- a/src/main/python/ddadevops/application/release_mixin_services.py +++ b/src/main/python/ddadevops/application/release_mixin_services.py @@ -1,3 +1,4 @@ +import json from typing import List from pathlib import Path from ..infrastructure import GitApi, ArtifactDeploymentApi, BuildFileRepository @@ -61,16 +62,22 @@ class ReleaseService: self.git_api.push_follow_tags() def publish_artifacts(self, release: Release): + release_response = json.loads( + self.artifact_deployment_api.create_forgejo_release( + release.forgejo_release_api_endpoint(), + release.version.to_string(), + release.release_artifact_token, + ) + ) for artifact_path in release.release_artifacts: self.artifact_deployment_api.calculate_checksums(artifact_path) - self.artifact_deployment_api.create_forgejo_release( - release.forgejo_release_api_endpoint(), - release.version.to_string(), - release.release_artifact_token - ) - # create release - # add artifacts to release - pass + self.artifact_deployment_api.add_asset_to_release( + "todo", + release_response["id"], + "todo", + "todo", + release.release_artifact_token, + ) def __set_version_and_commit__( self, version: Version, build_file_ids: List[str], message: str diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index 1da56bb..cd5f946 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -229,7 +229,7 @@ class ArtifactDeploymentApi: + f'-d "{{ "body": "Provides files for release {tag} Attention: The "Source Code"-files below are not up-to-date!", "tag_name": "{tag}"}}" ', ) # noqa: E501 - def post_asset( + def add_asset_to_release( self, target_url: str, release_id: str, diff --git a/src/test/python/application/test_release_mixin_services.py b/src/test/python/application/test_release_mixin_services.py index b6fbe02..8e1d786 100644 --- a/src/test/python/application/test_release_mixin_services.py +++ b/src/test/python/application/test_release_mixin_services.py @@ -1,7 +1,7 @@ import pytest from pathlib import Path from src.main.python.ddadevops.domain import ( - ReleaseType, + ReleaseType, MixinType, ) from src.test.python.domain.helper import ( @@ -12,8 +12,11 @@ from src.test.python.domain.helper import ( ) from src.main.python.ddadevops.application import ReleaseService + def test_sould_update_release_type(): - sut = ReleaseService(GitApiMock(), ArtifactDeploymentApiMock(), BuildFileRepositoryMock("build.py")) + sut = ReleaseService( + GitApiMock(), ArtifactDeploymentApiMock(), BuildFileRepositoryMock("build.py") + ) devops = build_devops({}) release = devops.mixins[MixinType.RELEASE] sut.update_release_type(release, "MAJOR") @@ -21,3 +24,19 @@ def test_sould_update_release_type(): with pytest.raises(Exception): sut.update_release_type(release, "NOT_EXISTING") + + +def test_sould_publish_artifacts(): + mock = ArtifactDeploymentApiMock(release='{"id": 2345}') + sut = ReleaseService(GitApiMock(), mock, BuildFileRepositoryMock()) + devops = build_devops( + { + "release_artifacts": ["target/art"], + "release_artifact_server_url": "http://repo.test/", + "release_organisation": "orga", + "release_repository_name": "repo", + } + ) + release = devops.mixins[MixinType.RELEASE] + sut.publish_artifacts(release) + assert 2345 == mock.add_asset_to_release_id diff --git a/src/test/python/domain/helper.py b/src/test/python/domain/helper.py index 5311703..321e6a7 100644 --- a/src/test/python/domain/helper.py +++ b/src/test/python/domain/helper.py @@ -158,13 +158,19 @@ class GitApiMock: class ArtifactDeploymentApiMock: - def __init__(self): - pass - - def post_release(self, target_url: str, tag: str, token: str): - pass - - def post_asset(self, target_url: str, release_id: str, attachment: str, attachment_type: str, token: str): + def __init__(self, release=""): + self.release = release + self.create_forgejo_release_count = 0 + self.add_asset_to_release_count = 0 + self.add_asset_to_release_id = "" + + def create_forgejo_release(self, target_url: str, tag: str, token: str): + self.create_forgejo_release_count += 1 + return self.release + + def add_asset_to_release(self, target_url: str, release_id: str, attachment: str, attachment_type: str, token: str): + self.add_asset_to_release_count += 1 + self.add_asset_to_release_id = release_id pass def calculate_checksums(self, build_path: str): From a876fdc799b89938f6ae3d559b645992bb4d7478 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Mon, 14 Aug 2023 09:10:31 +0200 Subject: [PATCH 30/97] add error handling for release_id parsing --- .../application/release_mixin_services.py | 8 +++++-- .../infrastructure/infrastructure.py | 6 +++--- .../test_release_mixin_services.py | 21 +++++++++++++++++++ 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/main/python/ddadevops/application/release_mixin_services.py b/src/main/python/ddadevops/application/release_mixin_services.py index 2b094a8..546d93e 100644 --- a/src/main/python/ddadevops/application/release_mixin_services.py +++ b/src/main/python/ddadevops/application/release_mixin_services.py @@ -62,7 +62,7 @@ class ReleaseService: self.git_api.push_follow_tags() def publish_artifacts(self, release: Release): - release_response = json.loads( + release_id = self.__parse_forgejo_release_id__( self.artifact_deployment_api.create_forgejo_release( release.forgejo_release_api_endpoint(), release.version.to_string(), @@ -73,12 +73,16 @@ class ReleaseService: self.artifact_deployment_api.calculate_checksums(artifact_path) self.artifact_deployment_api.add_asset_to_release( "todo", - release_response["id"], + release_id, "todo", "todo", release.release_artifact_token, ) + def __parse_forgejo_release_id__(self, release_response: str) -> int: + parsed = json.loads(release_response) + return parsed["id"] + def __set_version_and_commit__( self, version: Version, build_file_ids: List[str], message: str ): diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index cd5f946..d86e029 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -218,13 +218,13 @@ class ArtifactDeploymentApi: def __init__(self): self.execution_api = ExecutionApi() - def create_forgejo_release(self, target_url: str, tag: str, token: str): + def create_forgejo_release(self, api_endpoint_url: str, tag: str, token: str): return self.execution_api.execute_secure( - f'curl -X "POST" "{target_url}" ' + f'curl -X "POST" "{api_endpoint_url}" ' + '-H "accept: application/json" -H "Content-Type: application/json" ' + f'-d "{{ "body": "Provides files for release {tag} Attention: The "Source Code"-files below are not up-to-date!", "tag_name": "{tag}"}}" ' # noqa: E501 + f'-H "Authorization: token {token}"', - sanitized_command=f'curl -X "POST" "{target_url}" ' + sanitized_command=f'curl -X "POST" "{api_endpoint_url}" ' + '-H "accept: application/json" -H "Content-Type: application/json" ' + f'-d "{{ "body": "Provides files for release {tag} Attention: The "Source Code"-files below are not up-to-date!", "tag_name": "{tag}"}}" ', ) # noqa: E501 diff --git a/src/test/python/application/test_release_mixin_services.py b/src/test/python/application/test_release_mixin_services.py index 8e1d786..56f9ddf 100644 --- a/src/test/python/application/test_release_mixin_services.py +++ b/src/test/python/application/test_release_mixin_services.py @@ -40,3 +40,24 @@ def test_sould_publish_artifacts(): release = devops.mixins[MixinType.RELEASE] sut.publish_artifacts(release) assert 2345 == mock.add_asset_to_release_id + +def test_sould_throw_exception_if_there_was_an_error_in_publish_artifacts(): + devops = build_devops( + { + "release_artifacts": ["target/art"], + "release_artifact_server_url": "http://repo.test/", + "release_organisation": "orga", + "release_repository_name": "repo", + } + ) + release = devops.mixins[MixinType.RELEASE] + + with pytest.raises(Exception): + mock = ArtifactDeploymentApiMock(release='') + sut = ReleaseService(GitApiMock(), mock, BuildFileRepositoryMock()) + sut.publish_artifacts(release) + + with pytest.raises(Exception): + mock = ArtifactDeploymentApiMock(release='{"message": "there was an error", "url":"some-url"}') + sut = ReleaseService(GitApiMock(), mock, BuildFileRepositoryMock()) + sut.publish_artifacts(release) From caaf804fd32f643e687453170930c1e93bd5a886 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Mon, 14 Aug 2023 09:15:46 +0200 Subject: [PATCH 31/97] add release-endpoint-calculation to domain object --- src/main/python/ddadevops/domain/release.py | 5 ++++- src/test/python/domain/test_release.py | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/main/python/ddadevops/domain/release.py b/src/main/python/ddadevops/domain/release.py index 29f78c1..f3516cd 100644 --- a/src/main/python/ddadevops/domain/release.py +++ b/src/main/python/ddadevops/domain/release.py @@ -77,7 +77,7 @@ class Release(Validateable): result += self.release_secondary_build_files return result - def forgejo_release_api_endpoint(self): + def forgejo_release_api_endpoint(self) -> str: validation = self.validate_for_artifact() if validation != []: raise RuntimeError(f"not valid for creating artifacts: {validation}") @@ -89,6 +89,9 @@ class Release(Validateable): repository = self.release_repository_name.removeprefix("/").removesuffix("/") return f"{server_url}/api/v1/repos/{organisation}/{repository}/releases" + def forgejo_release_asset_api_endpoint(self, id: int) -> str: + return f"{self.forgejo_release_api_endpoint()}/{id}/assets" + @classmethod def get_mapping_default(cls) -> List[Dict[str, str]]: return [ diff --git a/src/test/python/domain/test_release.py b/src/test/python/domain/test_release.py index 42f8699..efa82a6 100644 --- a/src/test/python/domain/test_release.py +++ b/src/test/python/domain/test_release.py @@ -115,3 +115,21 @@ def test_should_calculate_forgejo_release_api_endpoint(): Version.from_str("1.3.1-SNAPSHOT", "SNAPSHOT"), ) sut.forgejo_release_api_endpoint() + +def test_should_calculate_forgejo_release_asset_api_endpoint(): + sut = Release( + devops_config( + { + "release_artifacts": ["x"], + "release_artifact_token": "y", + "release_artifact_server_url": "https://repo.prod.meissa.de", + "release_organisation": "meissa", + "release_repository_name": "provs", + } + ), + Version.from_str("1.3.1-SNAPSHOT", "SNAPSHOT"), + ) + assert ( + "https://repo.prod.meissa.de/api/v1/repos/meissa/provs/releases/123/assets" + == sut.forgejo_release_asset_api_endpoint(123) + ) From bfcdcbb78a08dced67dcdaeaa3e558959cde7476 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Mon, 14 Aug 2023 09:31:01 +0200 Subject: [PATCH 32/97] wip: prepare ataching artifacts --- .../application/release_mixin_services.py | 22 +++++++++++++++++-- .../infrastructure/infrastructure.py | 7 +++--- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/main/python/ddadevops/application/release_mixin_services.py b/src/main/python/ddadevops/application/release_mixin_services.py index 546d93e..8dccb2d 100644 --- a/src/main/python/ddadevops/application/release_mixin_services.py +++ b/src/main/python/ddadevops/application/release_mixin_services.py @@ -69,11 +69,29 @@ class ReleaseService: release.release_artifact_token, ) ) + + artifacts_to_attach = [] for artifact_path in release.release_artifacts: self.artifact_deployment_api.calculate_checksums(artifact_path) + # TODO: make api more explizit to have the path calculation & decision which shas to take clear + artifacts_to_attach += [{ + "path": artifact_path, + # TODO: it will not always be a jar file -> move type to release input-side. + "type": "application/x-java-archive", + }, + { + "path": f"{artifact_path}.sha256", + "type": "text/plain", + }, + { + "path": f"{artifact_path}.sha512", + "type": "text/plain", + }] + + # TODO: use structure created above + for artifact in artifacts_to_attach: self.artifact_deployment_api.add_asset_to_release( - "todo", - release_id, + release.forgejo_release_asset_api_endpoint(release_id), "todo", "todo", release.release_artifact_token, diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index d86e029..9708cc6 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -231,18 +231,17 @@ class ArtifactDeploymentApi: def add_asset_to_release( self, - target_url: str, - release_id: str, + api_endpoint_url: str, attachment: str, attachment_type: str, token: str, ): return self.execution_api.execute_secure( - f'curl -X "POST" "{target_url}/{release_id}/assets" ' # {target_url}/{release_id}/assets move to Domain + f'curl -X "POST" "{api_endpoint_url}" ' + f'-H "accept: application/json" -H "Authorization: token {token}" ' + '-H "Content-Type: multipart/form-data" ' + f'-F "attachment=@{attachment};type={attachment_type}"', - sanitized_command=f'curl -X "POST" "{target_url}/{release_id}/assets" ' # see above + sanitized_command=f'curl -X "POST" "{api_endpoint_url}" ' + '-H "accept: application/json" ' + '-H "Content-Type: multipart/form-data" ' + f'-F "attachment=@{attachment};type={attachment_type}"', From 45884d10322531ad07b190d062594f98d05ee2ff Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Mon, 14 Aug 2023 09:40:25 +0200 Subject: [PATCH 33/97] wip: prepare ataching artifacts - fix the test --- .../python/application/test_release_mixin_services.py | 2 +- src/test/python/domain/helper.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/python/application/test_release_mixin_services.py b/src/test/python/application/test_release_mixin_services.py index 56f9ddf..976d7c5 100644 --- a/src/test/python/application/test_release_mixin_services.py +++ b/src/test/python/application/test_release_mixin_services.py @@ -39,7 +39,7 @@ def test_sould_publish_artifacts(): ) release = devops.mixins[MixinType.RELEASE] sut.publish_artifacts(release) - assert 2345 == mock.add_asset_to_release_id + assert "http://repo.test/api/v1/repos/orga/repo/releases/2345/assets" == mock.add_asset_to_release_api_endpoint def test_sould_throw_exception_if_there_was_an_error_in_publish_artifacts(): devops = build_devops( diff --git a/src/test/python/domain/helper.py b/src/test/python/domain/helper.py index 321e6a7..1740624 100644 --- a/src/test/python/domain/helper.py +++ b/src/test/python/domain/helper.py @@ -162,15 +162,15 @@ class ArtifactDeploymentApiMock: self.release = release self.create_forgejo_release_count = 0 self.add_asset_to_release_count = 0 - self.add_asset_to_release_id = "" + self.add_asset_to_release_api_endpoint = "" - def create_forgejo_release(self, target_url: str, tag: str, token: str): + def create_forgejo_release(self, api_endpoint: str, tag: str, token: str): self.create_forgejo_release_count += 1 return self.release - def add_asset_to_release(self, target_url: str, release_id: str, attachment: str, attachment_type: str, token: str): + def add_asset_to_release(self, api_endpoint: str, attachment: str, attachment_type: str, token: str): + self.add_asset_to_release_api_endpoint = api_endpoint self.add_asset_to_release_count += 1 - self.add_asset_to_release_id = release_id pass def calculate_checksums(self, build_path: str): From 7aa45910e9deb78e07e42c1e159820d52158d46d Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Mon, 14 Aug 2023 18:55:30 +0200 Subject: [PATCH 34/97] finish register artifacts --- .../python/ddadevops/application/release_mixin_services.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/python/ddadevops/application/release_mixin_services.py b/src/main/python/ddadevops/application/release_mixin_services.py index 8dccb2d..dd9d0d5 100644 --- a/src/main/python/ddadevops/application/release_mixin_services.py +++ b/src/main/python/ddadevops/application/release_mixin_services.py @@ -88,12 +88,11 @@ class ReleaseService: "type": "text/plain", }] - # TODO: use structure created above for artifact in artifacts_to_attach: self.artifact_deployment_api.add_asset_to_release( release.forgejo_release_asset_api_endpoint(release_id), - "todo", - "todo", + artifact["path"], + artifact["type"], release.release_artifact_token, ) From f9daf87262188ad4ec1b5d89c5b67b164ff2d5bc Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Mon, 14 Aug 2023 18:58:51 +0200 Subject: [PATCH 35/97] remove no longer neede artifact deployment --- .../artifact_deployment_service.py | 27 -------- .../ddadevops/artifact_deployment_mixin.py | 61 ------------------- .../ddadevops/domain/artifact_deployment.py | 40 ------------ 3 files changed, 128 deletions(-) delete mode 100644 src/main/python/ddadevops/application/artifact_deployment_service.py delete mode 100644 src/main/python/ddadevops/artifact_deployment_mixin.py delete mode 100644 src/main/python/ddadevops/domain/artifact_deployment.py diff --git a/src/main/python/ddadevops/application/artifact_deployment_service.py b/src/main/python/ddadevops/application/artifact_deployment_service.py deleted file mode 100644 index 3d8a3b4..0000000 --- a/src/main/python/ddadevops/application/artifact_deployment_service.py +++ /dev/null @@ -1,27 +0,0 @@ -from ..infrastructure import GitApi, ArtifactDeploymentApi -from ..domain import Credentials - -# This will be moved to release mixin -class ArtifactDeploymentService: - def __init__(self, git_api: GitApi, artifact_deployment_api: ArtifactDeploymentApi): - self.git_api = git_api - self.artifact_deployment_api = artifact_deployment_api - - @classmethod - def prod(cls): - return cls( - GitApi(), - ArtifactDeploymentApi(), - ) - - def post_release(self, target_url: str, tag: str, credentials: Credentials): - response = self.artifact_deployment_api.post_release(target_url, tag, credentials.mappings["token"]) - # Get release id from response - - def post_asset(self, target_url: str, release_id: str, attachment: str, attachment_type: str, token: str): - self.artifact_deployment_api.post_asset(target_url, release_id, attachment, attachment_type, token) - - def calculate_checksums(self, build_path: str): - self.artifact_deployment_api.calculate_checksums(build_path) - - # ToDo: Update release Id as in release_mixin_services.py diff --git a/src/main/python/ddadevops/artifact_deployment_mixin.py b/src/main/python/ddadevops/artifact_deployment_mixin.py deleted file mode 100644 index 77a373c..0000000 --- a/src/main/python/ddadevops/artifact_deployment_mixin.py +++ /dev/null @@ -1,61 +0,0 @@ -from pybuilder.core import Project -from .devops_build import DevopsBuild -from .domain import MixinType - -# """ -# Functional Req: - -# General process for deploying prebuilt (meissa) binaries to our own repo server. - -# [-1] -# Building is handled by other entities -# is another pybuilder task -# the binary is reachable with devops.build_path() -# we might need to establish a "build" that does lein builds for us -# we might need to establish a "build" that does gradlew build for us -# same for all other projects that produce binaries -# currently the c4k_build.py just creates the auth and config yamls - -# [0] -# get artifact deployment url -# Base url: https://repo.prod.meissa.de/api/v1/repos/ -# Changeable: /meissa/provs/ -# persitent suffix to url: releases -# name is accessible from input - -# [1] -# get release token -# could be an api token for repo.prod.meissa.de -# credential mapping as described in the docs - -# [2] -# get release tag -# is the version of the project -# get from gitApi - -# [3] -# post a json message containting [2] to [0], watching stdout for answers -# authorized by [1] -# validate if [3] was successful by reading stdout -# or create error message containing ID of release - -# [4] -# get release-id from stdout of [3] -# print release-id - -# [5] -# generate sha256 sums & generate sha512 sums of results of [-1] - -# [6] -# push results of [-1] & [5] to [0]/[4]/assets - -# """ - -# This will be moved to release mixin -class ArtifactDeploymentMixin(DevopsBuild): - def __init__(self, project: Project, inp: dict): - super().__init__(project, inp) - devops = self.devops_repo.get_devops(self.project) - if MixinType.ARTIFACT_DEPLOYMENT not in devops.mixins: # TODO: Check for Release mixin as well - raise ValueError("ArtifactDeploymentMixin requires MixinType.ARTIFACT_DEPLOYMENT") - self.base_url = 'https://repo.prod.meissa.de/api/v1/repos/' diff --git a/src/main/python/ddadevops/domain/artifact_deployment.py b/src/main/python/ddadevops/domain/artifact_deployment.py deleted file mode 100644 index 4d0976f..0000000 --- a/src/main/python/ddadevops/domain/artifact_deployment.py +++ /dev/null @@ -1,40 +0,0 @@ -from typing import List, Dict, Optional -from .common import ( - Validateable, - CredentialMappingDefault, - DnsRecord, - Devops, -) - -# This will be moved to release mixin -class ArtifactDeployment(Validateable, CredentialMappingDefault): - def __init__(self, inp: dict): - self.name = inp.get("name") - self.artifact_base_url = inp.get("artifact_base_url") - self.organization = inp.get("organization") - - def get_artifact_release_url(self) -> str: - return f"{self.artifact_base_url}/{self.organization}/{self.name}/releases" - - def get_artifact_asset_url(self, release_id: str) -> str: - return f"{self.get_artifact_release_url}/{release_id}/assets" - - def update_runtime_config(self, dns_record: DnsRecord): - self.dns_record = dns_record - self.throw_if_invalid() - - def validate(self) -> List[str]: - result = [] - result += self.__validate_is_not_empty__("name") - result += self.__validate_is_not_empty__("artifact_base_url") - return result - - @classmethod - def get_mapping_default(cls) -> List[Dict[str, str]]: - return [ # ToDo: Adapt for token - { - "gopass_path": "server/meissa/grafana-cloud", - "gopass_field": "grafana-cloud-user", - "name": "c4k_grafana_cloud_user", - } - ] From d555b34eef9fa352925ab2fd77e2edd821e8b81a Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Mon, 14 Aug 2023 19:06:57 +0200 Subject: [PATCH 36/97] add artifact to domain --- doc/architecture/Domain.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/architecture/Domain.md b/doc/architecture/Domain.md index 1f4bb88..fde909f 100644 --- a/doc/architecture/Domain.md +++ b/doc/architecture/Domain.md @@ -88,10 +88,14 @@ classDiagram release_type release_main_branch release_current_branch - release_artifacts release_artifact_server_url release_organisation release_repository_name + release_artifact_token + } + class Artifact { + release_artifact_path + release_artifact_type } class Credentials { <> @@ -134,6 +138,7 @@ classDiagram TerraformDomain *-- "0..1" ProviderAws: providers Release o-- "0..1" BuildFile: primary_build_file Release o-- "0..n" BuildFile: secondary_build_files + Release "1" *-- "0..n" Artifact: release_artifacts Release "1" *-- "1" Version: version BuildFile *-- "1" Version: version C4k *-- DnsRecord: dns_record From 2e24e79a4ca8a63d16596e668e49c6c7aca3f3b4 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Mon, 14 Aug 2023 20:39:59 +0200 Subject: [PATCH 37/97] introduce artifact class --- doc/architecture/Domain.md | 5 ++- .../application/release_mixin_services.py | 33 ++++++-------- src/main/python/ddadevops/domain/__init__.py | 1 + src/main/python/ddadevops/domain/artifact.py | 43 +++++++++++++++++++ src/main/python/ddadevops/domain/release.py | 7 ++- src/main/python/ddadevops/domain/version.py | 12 +++--- .../infrastructure/infrastructure.py | 15 ++++--- src/test/python/domain/helper.py | 11 +++-- src/test/python/domain/test_artifact.py | 29 +++++++++++++ src/test/python/domain/test_devops_factory.py | 26 +++++++++++ 10 files changed, 143 insertions(+), 39 deletions(-) create mode 100644 src/main/python/ddadevops/domain/artifact.py create mode 100644 src/test/python/domain/test_artifact.py diff --git a/doc/architecture/Domain.md b/doc/architecture/Domain.md index fde909f..3ba7c0b 100644 --- a/doc/architecture/Domain.md +++ b/doc/architecture/Domain.md @@ -94,8 +94,9 @@ classDiagram release_artifact_token } class Artifact { - release_artifact_path - release_artifact_type + path_str + path() + type() } class Credentials { <> diff --git a/src/main/python/ddadevops/application/release_mixin_services.py b/src/main/python/ddadevops/application/release_mixin_services.py index dd9d0d5..0c40e98 100644 --- a/src/main/python/ddadevops/application/release_mixin_services.py +++ b/src/main/python/ddadevops/application/release_mixin_services.py @@ -2,7 +2,7 @@ import json from typing import List from pathlib import Path from ..infrastructure import GitApi, ArtifactDeploymentApi, BuildFileRepository -from ..domain import Version, Release, ReleaseType +from ..domain import Version, Release, ReleaseType, Artifact class ReleaseService: @@ -70,29 +70,20 @@ class ReleaseService: ) ) - artifacts_to_attach = [] - for artifact_path in release.release_artifacts: - self.artifact_deployment_api.calculate_checksums(artifact_path) - # TODO: make api more explizit to have the path calculation & decision which shas to take clear - artifacts_to_attach += [{ - "path": artifact_path, - # TODO: it will not always be a jar file -> move type to release input-side. - "type": "application/x-java-archive", - }, - { - "path": f"{artifact_path}.sha256", - "type": "text/plain", - }, - { - "path": f"{artifact_path}.sha512", - "type": "text/plain", - }] + artifacts_sums = [] + for artifact in release.release_artifacts: + sha256 = self.artifact_deployment_api.calculate_sha256(artifact.path()) + sha512 = self.artifact_deployment_api.calculate_sha512(artifact.path()) + artifacts_sums += [Artifact(sha256), Artifact(sha512)] - for artifact in artifacts_to_attach: + artifacts = release.release_artifacts + artifacts_sums + print(artifacts) + for artifact in artifacts: + print(str) self.artifact_deployment_api.add_asset_to_release( release.forgejo_release_asset_api_endpoint(release_id), - artifact["path"], - artifact["type"], + artifact.path(), + artifact.type(), release.release_artifact_token, ) diff --git a/src/main/python/ddadevops/domain/__init__.py b/src/main/python/ddadevops/domain/__init__.py index 234c48b..6bff258 100644 --- a/src/main/python/ddadevops/domain/__init__.py +++ b/src/main/python/ddadevops/domain/__init__.py @@ -17,6 +17,7 @@ from .provider_hetzner import Hetzner from .provider_aws import Aws from .provs_k3s import K3s from .release import Release +from .artifact import Artifact from .credentials import Credentials, CredentialMapping, GopassType from .version import Version from .build_file import BuildFileType, BuildFile diff --git a/src/main/python/ddadevops/domain/artifact.py b/src/main/python/ddadevops/domain/artifact.py new file mode 100644 index 0000000..fc1d221 --- /dev/null +++ b/src/main/python/ddadevops/domain/artifact.py @@ -0,0 +1,43 @@ +from enum import Enum +from pathlib import Path +from .common import ( + Validateable, +) + +class ArtifactType(Enum): + TEXT = 0 + JAR = 1 + +class Artifact(Validateable): + def __init__(self, path: str): + self.path_str = path + + def path(self) -> Path: + return Path(self.path_str) + + def type(self) -> str: + suffix = self.path().suffix + match suffix: + case ".jar": + return "application/x-java-archive" + case _: + return "text/plain" + + def validate(self): + result = [] + result += self.__validate_is_not_empty__("path_str") + try: + Path(self.path_str) + except Exception as e: + result += [f"path was not a valid: {e}"] + return result + + def __str__(self): + return str(self.path()) + + def __eq__(self, other): + return other and self.__str__() == other.__str__() + + def __hash__(self) -> int: + return self.__str__().__hash__() + diff --git a/src/main/python/ddadevops/domain/release.py b/src/main/python/ddadevops/domain/release.py index f3516cd..e08ae6e 100644 --- a/src/main/python/ddadevops/domain/release.py +++ b/src/main/python/ddadevops/domain/release.py @@ -7,6 +7,9 @@ from .common import ( from .version import ( Version, ) +from .artifact import ( + Artifact, +) class Release(Validateable): @@ -17,7 +20,6 @@ class Release(Validateable): self.release_primary_build_file = inp.get( "release_primary_build_file", "./project.clj" ) - self.release_artifacts = inp.get("release_artifacts", []) self.release_secondary_build_files = inp.get( "release_secondary_build_files", [] ) @@ -26,6 +28,9 @@ class Release(Validateable): self.release_organisation = inp.get("release_organisation") self.release_repository_name = inp.get("release_repository_name") self.release_artifact_token = inp.get("release_artifact_token") + self.release_artifacts = [] + for a in inp.get("release_artifacts", []): + self.release_artifacts.append(Artifact(a)) def update_release_type(self, release_type: ReleaseType): self.release_type = release_type diff --git a/src/main/python/ddadevops/domain/version.py b/src/main/python/ddadevops/domain/version.py index 2f2096a..3c9ac0e 100644 --- a/src/main/python/ddadevops/domain/version.py +++ b/src/main/python/ddadevops/domain/version.py @@ -32,12 +32,6 @@ class Version(Validateable): self.snapshot_suffix = snapshot_suffix self.default_snapshot_suffix = default_snapshot_suffix - def __eq__(self, other): - return other and self.to_string() == other.to_string() - - def __hash__(self) -> int: - return self.to_string().__hash__() - def is_snapshot(self): return self.snapshot_suffix is not None @@ -139,3 +133,9 @@ class Version(Validateable): snapshot_suffix=None, version_str=None, ) + + def __eq__(self, other): + return other and self.to_string() == other.to_string() + + def __hash__(self) -> int: + return self.to_string().__hash__() diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index 9708cc6..e94fab9 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -247,13 +247,16 @@ class ArtifactDeploymentApi: + f'-F "attachment=@{attachment};type={attachment_type}"', ) - def calculate_checksums(self, artifact_path: str): - # self.execution_api.execute(f"find {artifact_path} -type f - # -exec sha256sum {{}}; | sort > {artifact_path} sha256sum.lst") - # relevant für provs + def calculate_sha256(self, path: Path): + sum = f"{path}.sha256" self.execution_api( - f"sha256sum {artifact_path} > {artifact_path}.sha256", + f"sha256sum {path} > {sum}", ) + return sum + + def calculate_sha512(self, path: Path): + sum = f"{path}.sha512" self.execution_api( - f"sha512sum {artifact_path} > {artifact_path}.sha512", + f"sha512sum {path} > {sum}", ) + return sum diff --git a/src/test/python/domain/helper.py b/src/test/python/domain/helper.py index 1740624..7855dc3 100644 --- a/src/test/python/domain/helper.py +++ b/src/test/python/domain/helper.py @@ -168,10 +168,15 @@ class ArtifactDeploymentApiMock: self.create_forgejo_release_count += 1 return self.release - def add_asset_to_release(self, api_endpoint: str, attachment: str, attachment_type: str, token: str): + def add_asset_to_release( + self, api_endpoint: str, attachment: str, attachment_type: str, token: str + ): self.add_asset_to_release_api_endpoint = api_endpoint self.add_asset_to_release_count += 1 pass - def calculate_checksums(self, build_path: str): - pass + def calculate_sha256(self, path: Path): + return f"{path}.sha256" + + def calculate_sha512(self, path: Path): + return f"{path}.sha512" diff --git a/src/test/python/domain/test_artifact.py b/src/test/python/domain/test_artifact.py new file mode 100644 index 0000000..e454c5c --- /dev/null +++ b/src/test/python/domain/test_artifact.py @@ -0,0 +1,29 @@ +import pytest +from pybuilder.core import Project +from pathlib import Path +from src.main.python.ddadevops.domain import ( + Validateable, + DnsRecord, + Devops, + BuildType, + MixinType, + Artifact, + Image, +) +from .helper import build_devops, devops_config + + +def test_sould_validate_release(): + sut = Artifact("x") + assert sut.is_valid() + + sut = Artifact(None) + assert not sut.is_valid() + +def test_should_calculate_type(): + sut = Artifact("x.jar") + assert "application/x-java-archive" == sut.type() + + sut = Artifact("x.jar.sha256") + assert "text/plain" == sut.type() + diff --git a/src/test/python/domain/test_devops_factory.py b/src/test/python/domain/test_devops_factory.py index b9f4008..26cc319 100644 --- a/src/test/python/domain/test_devops_factory.py +++ b/src/test/python/domain/test_devops_factory.py @@ -4,6 +4,7 @@ from src.main.python.ddadevops.domain import ( Version, BuildType, MixinType, + Artifact, ) @@ -50,6 +51,7 @@ def test_devops_creation(): assert sut is not None assert sut.specialized_builds[BuildType.C4K] is not None +def test_release_devops_creation(): sut = DevopsFactory().build_devops( { "stage": "test", @@ -67,6 +69,30 @@ def test_devops_creation(): assert sut is not None assert sut.mixins[MixinType.RELEASE] is not None + sut = DevopsFactory().build_devops( + { + "stage": "test", + "name": "mybuild", + "module": "test_image", + "project_root_path": "../../..", + "build_types": [], + "mixin_types": ["RELEASE"], + "release_main_branch": "main", + "release_current_branch": "my_feature", + "release_config_file": "project.clj", + "release_artifacts": ["x.jar"], + "release_artifact_token": "y", + "release_artifact_server_url": "https://repo.prod.meissa.de", + "release_organisation": "meissa", + "release_repository_name": "provs", + }, + Version.from_str("1.0.0", "SNAPSHOT"), + ) + + release = sut.mixins[MixinType.RELEASE] + assert release is not None + assert Artifact("x.jar") == release.release_artifacts[0] + def test_on_merge_input_should_win(): sut = DevopsFactory() From 7d2d197cbb31b906e1ccaec159e40b4a7c723fa7 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Mon, 14 Aug 2023 20:41:04 +0200 Subject: [PATCH 38/97] fix some linting --- src/main/python/ddadevops/domain/artifact.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/python/ddadevops/domain/artifact.py b/src/main/python/ddadevops/domain/artifact.py index fc1d221..e6d5904 100644 --- a/src/main/python/ddadevops/domain/artifact.py +++ b/src/main/python/ddadevops/domain/artifact.py @@ -4,10 +4,12 @@ from .common import ( Validateable, ) + class ArtifactType(Enum): TEXT = 0 JAR = 1 + class Artifact(Validateable): def __init__(self, path: str): self.path_str = path @@ -22,7 +24,7 @@ class Artifact(Validateable): return "application/x-java-archive" case _: return "text/plain" - + def validate(self): result = [] result += self.__validate_is_not_empty__("path_str") @@ -40,4 +42,3 @@ class Artifact(Validateable): def __hash__(self) -> int: return self.__str__().__hash__() - From 2be0a44aa8168c5ee6ebafef84eeff74b73a7b8e Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Tue, 15 Aug 2023 08:09:27 +0200 Subject: [PATCH 39/97] add js --- src/main/python/ddadevops/domain/artifact.py | 2 ++ src/test/python/domain/test_artifact.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/main/python/ddadevops/domain/artifact.py b/src/main/python/ddadevops/domain/artifact.py index e6d5904..f7ae720 100644 --- a/src/main/python/ddadevops/domain/artifact.py +++ b/src/main/python/ddadevops/domain/artifact.py @@ -22,6 +22,8 @@ class Artifact(Validateable): match suffix: case ".jar": return "application/x-java-archive" + case ".js": + return "application/x-javascript" case _: return "text/plain" diff --git a/src/test/python/domain/test_artifact.py b/src/test/python/domain/test_artifact.py index e454c5c..86e5324 100644 --- a/src/test/python/domain/test_artifact.py +++ b/src/test/python/domain/test_artifact.py @@ -24,6 +24,9 @@ def test_should_calculate_type(): sut = Artifact("x.jar") assert "application/x-java-archive" == sut.type() + sut = Artifact("x.js") + assert "application/x-javascript" == sut.type() + sut = Artifact("x.jar.sha256") assert "text/plain" == sut.type() From ab8bb7f400e57dae29428ba737ca9947e6c72a09 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Tue, 15 Aug 2023 08:21:06 +0200 Subject: [PATCH 40/97] allow empty artifacts --- .gitlab-ci.yml | 1 - build.py | 12 ++++++++++-- src/main/python/ddadevops/domain/release.py | 1 - src/test/python/domain/test_release.py | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a6570fa..312e95a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -59,7 +59,6 @@ clj-image-publish: script: - cd infrastructure/clj && pyb image publish - python-image-publish: <<: *img <<: *tag_only diff --git a/build.py b/build.py index c0377b4..c7487bb 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.3.2-dev" +version = "4.3.2-dev1" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] @@ -103,6 +103,10 @@ def initialize(project): "infrastructure/clj-cljs/build.py", "infrastructure/clj/build.py", ], + "release_artifacts": [], + "release_artifact_server_url": "https://repo.prod.meissa.de", + "release_organisation": "meissa", + "release_repository_name": "dda-devops-build", } build = ReleaseMixin(project, input) @@ -176,7 +180,11 @@ def prepare(project): def tag(project): build = get_devops_build(project) build.tag_bump_and_push_release() - #TODO: build.publish_artifacts() + + +@task +def publish_artifacts(project): + build.publish_artifacts() def release(project): diff --git a/src/main/python/ddadevops/domain/release.py b/src/main/python/ddadevops/domain/release.py index e08ae6e..99fa091 100644 --- a/src/main/python/ddadevops/domain/release.py +++ b/src/main/python/ddadevops/domain/release.py @@ -73,7 +73,6 @@ class Release(Validateable): result += self.__validate_is_not_empty__("release_artifact_server_url") result += self.__validate_is_not_empty__("release_organisation") result += self.__validate_is_not_empty__("release_repository_name") - result += self.__validate_is_not_empty__("release_artifacts") result += self.__validate_is_not_empty__("release_artifact_token") return result diff --git a/src/test/python/domain/test_release.py b/src/test/python/domain/test_release.py index efa82a6..968ce69 100644 --- a/src/test/python/domain/test_release.py +++ b/src/test/python/domain/test_release.py @@ -68,7 +68,7 @@ def test_should_calculate_forgejo_release_api_endpoint(): sut = Release( devops_config( { - "release_artifacts": ["x"], + "release_artifacts": [], "release_artifact_token": "y", "release_artifact_server_url": "https://repo.prod.meissa.de", "release_organisation": "meissa", From 1fff46986e4f5303373b5072715308d242745218 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Tue, 15 Aug 2023 08:23:00 +0200 Subject: [PATCH 41/97] create an empty release --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 312e95a..01a4e4a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -43,7 +43,7 @@ pypi-stable: <<: *tag_only stage: upload script: - - pyb -P version=$CI_COMMIT_TAG publish upload + - pyb -P version=$CI_COMMIT_TAG publish upload publish_artifacts clj-cljs-image-publish: <<: *img From 06a650fd7773dab300c069c55987a045e6a73a1d Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Tue, 15 Aug 2023 08:28:15 +0200 Subject: [PATCH 42/97] use new version for ci --- .gitlab-ci.yml | 2 +- infrastructure/python/image/Dockerfile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 01a4e4a..52ccd7d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ stages: - image .py: &py - image: "domaindrivenarchitecture/ddadevops-python:4.1.0" + image: "domaindrivenarchitecture/ddadevops-python:4.3.2-dev2023-08-15-08-26-54" before_script: - python --version - pip install -r requirements.txt diff --git a/infrastructure/python/image/Dockerfile b/infrastructure/python/image/Dockerfile index 3d49141..57d756c 100644 --- a/infrastructure/python/image/Dockerfile +++ b/infrastructure/python/image/Dockerfile @@ -5,3 +5,4 @@ RUN apk add --no-cache build-base rust python3 python3-dev py3-pip py3-setuptool RUN python3 -m pip install -U pip; RUN pip3 install pybuilder ddadevops deprecation dda-python-terraform boto3 pyyaml inflection; RUN pip3 install coverage flake8 flake8-polyfill mypy mypy-extensions pycodestyle pyflakes pylint pytest pytest-cov pytest-datafiles types-setuptools types-PyYAML; +RUN pip3 install --upgrade ddadevops --pre From dea2d7f3ed508e08e03dcd6a9d140e1bb0133c3f Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 16 Aug 2023 10:30:58 +0200 Subject: [PATCH 43/97] Ignore line too long --- src/main/python/ddadevops/infrastructure/infrastructure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index e94fab9..48959c2 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -226,7 +226,7 @@ class ArtifactDeploymentApi: + f'-H "Authorization: token {token}"', sanitized_command=f'curl -X "POST" "{api_endpoint_url}" ' + '-H "accept: application/json" -H "Content-Type: application/json" ' - + f'-d "{{ "body": "Provides files for release {tag} Attention: The "Source Code"-files below are not up-to-date!", "tag_name": "{tag}"}}" ', + + f'-d "{{ "body": "Provides files for release {tag} Attention: The "Source Code"-files below are not up-to-date!", "tag_name": "{tag}"}}" ', # noqa: E501 ) # noqa: E501 def add_asset_to_release( From 46c8a1751c77672c77fa846ff3ac3a7fdff599a3 Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 16 Aug 2023 12:09:06 +0200 Subject: [PATCH 44/97] Rename var --- src/main/python/ddadevops/domain/release.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/python/ddadevops/domain/release.py b/src/main/python/ddadevops/domain/release.py index 99fa091..490db9b 100644 --- a/src/main/python/ddadevops/domain/release.py +++ b/src/main/python/ddadevops/domain/release.py @@ -93,8 +93,8 @@ class Release(Validateable): repository = self.release_repository_name.removeprefix("/").removesuffix("/") return f"{server_url}/api/v1/repos/{organisation}/{repository}/releases" - def forgejo_release_asset_api_endpoint(self, id: int) -> str: - return f"{self.forgejo_release_api_endpoint()}/{id}/assets" + def forgejo_release_asset_api_endpoint(self, release_id: int) -> str: + return f"{self.forgejo_release_api_endpoint()}/{release_id}/assets" @classmethod def get_mapping_default(cls) -> List[Dict[str, str]]: From a9d01c59070249eecf8b971f1d8a774f07bee699 Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 16 Aug 2023 12:10:02 +0200 Subject: [PATCH 45/97] Assert that token is a string --- .../python/ddadevops/application/release_mixin_services.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/python/ddadevops/application/release_mixin_services.py b/src/main/python/ddadevops/application/release_mixin_services.py index 0c40e98..bc3ab0a 100644 --- a/src/main/python/ddadevops/application/release_mixin_services.py +++ b/src/main/python/ddadevops/application/release_mixin_services.py @@ -66,7 +66,7 @@ class ReleaseService: self.artifact_deployment_api.create_forgejo_release( release.forgejo_release_api_endpoint(), release.version.to_string(), - release.release_artifact_token, + str(release.release_artifact_token), ) ) @@ -84,7 +84,7 @@ class ReleaseService: release.forgejo_release_asset_api_endpoint(release_id), artifact.path(), artifact.type(), - release.release_artifact_token, + str(release.release_artifact_token), ) def __parse_forgejo_release_id__(self, release_response: str) -> int: From ddb173af46c94c5d7abf39f0dcd6923f01696482 Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 16 Aug 2023 12:10:47 +0200 Subject: [PATCH 46/97] Change attachment type to path --- src/main/python/ddadevops/infrastructure/infrastructure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index 48959c2..ed80da0 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -232,7 +232,7 @@ class ArtifactDeploymentApi: def add_asset_to_release( self, api_endpoint_url: str, - attachment: str, + attachment: Path, attachment_type: str, token: str, ): From 57b88664d2da8c6685f3d4cf0555e4cc0880bf92 Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 16 Aug 2023 12:11:08 +0200 Subject: [PATCH 47/97] Rename vars --- .../ddadevops/infrastructure/infrastructure.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index ed80da0..fda7c90 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -248,15 +248,15 @@ class ArtifactDeploymentApi: ) def calculate_sha256(self, path: Path): - sum = f"{path}.sha256" - self.execution_api( - f"sha256sum {path} > {sum}", + shasum = f"{path}.sha256" + self.execution_api.execute( + f"sha256sum {path} > {shasum}", ) - return sum + return shasum def calculate_sha512(self, path: Path): - sum = f"{path}.sha512" - self.execution_api( - f"sha512sum {path} > {sum}", + shasum = f"{path}.sha512" + self.execution_api.execute( + f"sha512sum {path} > {shasum}", ) - return sum + return shasum From 25887841a2937a0ee1f564c922a29e85907fc891 Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 16 Aug 2023 12:48:37 +0200 Subject: [PATCH 48/97] Add missing var def --- build.py | 1 + 1 file changed, 1 insertion(+) diff --git a/build.py b/build.py index c7487bb..c36c659 100644 --- a/build.py +++ b/build.py @@ -184,6 +184,7 @@ def tag(project): @task def publish_artifacts(project): + build = get_devops_build(project) build.publish_artifacts() From dce22ba7b3fb87cb4e175a681aa9f900e0c91005 Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 16 Aug 2023 13:54:28 +0200 Subject: [PATCH 49/97] Remove publish_artifact task for test purpose --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 52ccd7d..22a5221 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -43,7 +43,7 @@ pypi-stable: <<: *tag_only stage: upload script: - - pyb -P version=$CI_COMMIT_TAG publish upload publish_artifacts + - pyb -P version=$CI_COMMIT_TAG publish upload clj-cljs-image-publish: <<: *img From 66691c9ee9bb057c7cd7bb6982fb92d3e97531e7 Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 16 Aug 2023 13:57:15 +0200 Subject: [PATCH 50/97] Add task publish artifacts --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 22a5221..52ccd7d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -43,7 +43,7 @@ pypi-stable: <<: *tag_only stage: upload script: - - pyb -P version=$CI_COMMIT_TAG publish upload + - pyb -P version=$CI_COMMIT_TAG publish upload publish_artifacts clj-cljs-image-publish: <<: *img From 1f2e1d956902376055e7aeeb6487e0ce16209a2f Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 16 Aug 2023 14:07:52 +0200 Subject: [PATCH 51/97] Use v4.2.0 --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 52ccd7d..1bd6609 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ stages: - image .py: &py - image: "domaindrivenarchitecture/ddadevops-python:4.3.2-dev2023-08-15-08-26-54" + image: "domaindrivenarchitecture/ddadevops-python:4.2.0" before_script: - python --version - pip install -r requirements.txt From d160c551e185dedeaeb63dfbeceeb0a2f9f5e917 Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 16 Aug 2023 14:13:15 +0200 Subject: [PATCH 52/97] Use v4.3.0 --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1bd6609..4ea93f7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ stages: - image .py: &py - image: "domaindrivenarchitecture/ddadevops-python:4.2.0" + image: "domaindrivenarchitecture/ddadevops-python:4.3.0" before_script: - python --version - pip install -r requirements.txt From 46b8172f11a4dba20d2b03040a1cbde6ac302ca3 Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 16 Aug 2023 14:15:38 +0200 Subject: [PATCH 53/97] Use v4.3.1 --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4ea93f7..911e93c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ stages: - image .py: &py - image: "domaindrivenarchitecture/ddadevops-python:4.3.0" + image: "domaindrivenarchitecture/ddadevops-python:4.3.1" before_script: - python --version - pip install -r requirements.txt From b6b2e6d9b5e4faf0b09fd900dd075e7ee377a12f Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 16 Aug 2023 15:25:57 +0200 Subject: [PATCH 54/97] add env for all jobs --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 911e93c..61f75b3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,7 @@ stages: .py: &py image: "domaindrivenarchitecture/ddadevops-python:4.3.1" before_script: + - export RELEASE_ARTIFACT_TOKEN=$RELEASE_ARTIFACT_TOKEN - python --version - pip install -r requirements.txt From ec0844d53b7ecad8ba5483898d7dc15e4d3603dc Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 16 Aug 2023 15:42:59 +0200 Subject: [PATCH 55/97] use new ddadevops --- .gitlab-ci.yml | 2 +- build.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 61f75b3..2ac01a9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ stages: - image .py: &py - image: "domaindrivenarchitecture/ddadevops-python:4.3.1" + image: "domaindrivenarchitecture/ddadevops-python:4.3.2-dev2023-08-16-15-37-46" before_script: - export RELEASE_ARTIFACT_TOKEN=$RELEASE_ARTIFACT_TOKEN - python --version diff --git a/build.py b/build.py index c36c659..f6db68d 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.3.2-dev1" +version = "4.3.2-dev2" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] From 17ae55f3c072ed8bcf5cb3e6afdfa21f991b84b6 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 16 Aug 2023 16:10:56 +0200 Subject: [PATCH 56/97] fix drun & improve env rekognition --- build.py | 2 +- src/main/python/ddadevops/domain/init_service.py | 5 ++--- .../python/ddadevops/infrastructure/infrastructure.py | 9 +++++++-- src/test/python/domain/helper.py | 3 +++ 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index f6db68d..f32588d 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.3.2-dev2" +version = "4.3.2-dev6" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/src/main/python/ddadevops/domain/init_service.py b/src/main/python/ddadevops/domain/init_service.py index 1afa1f3..8529665 100644 --- a/src/main/python/ddadevops/domain/init_service.py +++ b/src/main/python/ddadevops/domain/init_service.py @@ -112,9 +112,8 @@ class InitService: result = {} for name in credentials.mappings.keys(): mapping = credentials.mappings[name] - env_value = self.environment_api.get(mapping.name_for_environment()) - if env_value: - result[name] = env_value + if self.environment_api.is_defined(mapping.name_for_environment()): + result[name] = self.environment_api.get(mapping.name_for_environment()) else: if mapping.gopass_type() == GopassType.FIELD: result[name] = self.credentials_api.gopass_field_from_path( diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index fda7c90..847bc57 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -58,8 +58,10 @@ class ImageApi: ) def drun(self, name: str): - self.execution_api.execute_live( - f'docker run -it --entrypoint="" {name} /bin/bash' + run( + f'docker run -it --entrypoint="" {name} /bin/bash', + shell=True, + check=True, ) def dockerhub_login(self, username: str, password: str): @@ -134,6 +136,9 @@ class EnvironmentApi: def get(self, key): return environ.get(key) + def is_defined(self, key): + return key in environ + class CredentialsApi: def __init__(self): diff --git a/src/test/python/domain/helper.py b/src/test/python/domain/helper.py index 7855dc3..7c6df4c 100644 --- a/src/test/python/domain/helper.py +++ b/src/test/python/domain/helper.py @@ -104,6 +104,9 @@ class EnvironmentApiMock: def get(self, key): return self.mappings.get(key, None) + def is_defined(self, key): + return key in self.mappings + class CredentialsApiMock: def __init__(self, mappings): From 898b8e89004a9d0ed638a8cbd0d6d8d4691eb777 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 16 Aug 2023 16:21:12 +0200 Subject: [PATCH 57/97] use new version --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2ac01a9..67cf964 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ stages: - image .py: &py - image: "domaindrivenarchitecture/ddadevops-python:4.3.2-dev2023-08-16-15-37-46" + image: "domaindrivenarchitecture/ddadevops-python:4.3.2-dev2023-08-16-16-16-48" before_script: - export RELEASE_ARTIFACT_TOKEN=$RELEASE_ARTIFACT_TOKEN - python --version From 509216c001486ff5c0f7476ce62ca47dd49d8de8 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 16 Aug 2023 16:31:55 +0200 Subject: [PATCH 58/97] release: 4.4.0 --- build.py | 2 +- infrastructure/clj-cljs/build.py | 2 +- infrastructure/clj/build.py | 2 +- infrastructure/ddadevops/build.py | 2 +- infrastructure/dind/build.py | 2 +- infrastructure/python/build.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index f32588d..bf2ec3a 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.3.2-dev6" +version = "4.4.0" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/infrastructure/clj-cljs/build.py b/infrastructure/clj-cljs/build.py index 3b07801..dccffc4 100644 --- a/infrastructure/clj-cljs/build.py +++ b/infrastructure/clj-cljs/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj-cljs" PROJECT_ROOT_PATH = "../.." -version = "4.3.2-dev" +version = "4.4.0" @init def initialize(project): diff --git a/infrastructure/clj/build.py b/infrastructure/clj/build.py index d0fd84d..d6fb9d3 100644 --- a/infrastructure/clj/build.py +++ b/infrastructure/clj/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj" PROJECT_ROOT_PATH = "../.." -version = "4.3.2-dev" +version = "4.4.0" @init def initialize(project): diff --git a/infrastructure/ddadevops/build.py b/infrastructure/ddadevops/build.py index 302af91..d20881d 100644 --- a/infrastructure/ddadevops/build.py +++ b/infrastructure/ddadevops/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "ddadevops" PROJECT_ROOT_PATH = "../.." -version = "4.3.2-dev" +version = "4.4.0" @init diff --git a/infrastructure/dind/build.py b/infrastructure/dind/build.py index 2227a5c..b21d1cb 100644 --- a/infrastructure/dind/build.py +++ b/infrastructure/dind/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "dind" PROJECT_ROOT_PATH = "../.." -version = "4.3.2-dev" +version = "4.4.0" @init diff --git a/infrastructure/python/build.py b/infrastructure/python/build.py index 8a931ac..a32e724 100644 --- a/infrastructure/python/build.py +++ b/infrastructure/python/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "python" PROJECT_ROOT_PATH = "../.." -version = "4.3.2-dev" +version = "4.4.0" @init From ad6287aafe339c0f73e512befdb4ef3e610da2e8 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 16 Aug 2023 16:31:56 +0200 Subject: [PATCH 59/97] bump version to: 4.4.1-dev --- build.py | 2 +- infrastructure/clj-cljs/build.py | 2 +- infrastructure/clj/build.py | 2 +- infrastructure/ddadevops/build.py | 2 +- infrastructure/dind/build.py | 2 +- infrastructure/python/build.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index bf2ec3a..6026f64 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.4.0" +version = "4.4.1-dev" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/infrastructure/clj-cljs/build.py b/infrastructure/clj-cljs/build.py index dccffc4..9bdc510 100644 --- a/infrastructure/clj-cljs/build.py +++ b/infrastructure/clj-cljs/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj-cljs" PROJECT_ROOT_PATH = "../.." -version = "4.4.0" +version = "4.4.1-dev" @init def initialize(project): diff --git a/infrastructure/clj/build.py b/infrastructure/clj/build.py index d6fb9d3..8459886 100644 --- a/infrastructure/clj/build.py +++ b/infrastructure/clj/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj" PROJECT_ROOT_PATH = "../.." -version = "4.4.0" +version = "4.4.1-dev" @init def initialize(project): diff --git a/infrastructure/ddadevops/build.py b/infrastructure/ddadevops/build.py index d20881d..bfd6f92 100644 --- a/infrastructure/ddadevops/build.py +++ b/infrastructure/ddadevops/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "ddadevops" PROJECT_ROOT_PATH = "../.." -version = "4.4.0" +version = "4.4.1-dev" @init diff --git a/infrastructure/dind/build.py b/infrastructure/dind/build.py index b21d1cb..e78fddc 100644 --- a/infrastructure/dind/build.py +++ b/infrastructure/dind/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "dind" PROJECT_ROOT_PATH = "../.." -version = "4.4.0" +version = "4.4.1-dev" @init diff --git a/infrastructure/python/build.py b/infrastructure/python/build.py index a32e724..77733c8 100644 --- a/infrastructure/python/build.py +++ b/infrastructure/python/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "python" PROJECT_ROOT_PATH = "../.." -version = "4.4.0" +version = "4.4.1-dev" @init From fea084c09ad2df438cbd4a25f15931428eac0d88 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 16 Aug 2023 17:09:24 +0200 Subject: [PATCH 60/97] fix escaping --- build.py | 2 +- src/main/python/ddadevops/infrastructure/infrastructure.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.py b/build.py index 6026f64..8020581 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.4.1-dev" +version = "4.4.1-dev0" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index 847bc57..210e415 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -227,11 +227,11 @@ class ArtifactDeploymentApi: return self.execution_api.execute_secure( f'curl -X "POST" "{api_endpoint_url}" ' + '-H "accept: application/json" -H "Content-Type: application/json" ' - + f'-d "{{ "body": "Provides files for release {tag} Attention: The "Source Code"-files below are not up-to-date!", "tag_name": "{tag}"}}" ' # noqa: E501 + + f'-d \'{{ "body": "Provides files for release {tag}", "tag_name": "{tag}"}}\' ' # noqa: E501 + f'-H "Authorization: token {token}"', sanitized_command=f'curl -X "POST" "{api_endpoint_url}" ' + '-H "accept: application/json" -H "Content-Type: application/json" ' - + f'-d "{{ "body": "Provides files for release {tag} Attention: The "Source Code"-files below are not up-to-date!", "tag_name": "{tag}"}}" ', # noqa: E501 + + f'-d \'{{ "body": "Provides files for release {tag}", "tag_name": "{tag}"}}\' ', # noqa: E501 ) # noqa: E501 def add_asset_to_release( From 8132958b16fbb909452bc2a30264ae9788bd0a1d Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 16 Aug 2023 17:45:21 +0200 Subject: [PATCH 61/97] preparing bugfix release --- .gitlab-ci.yml | 2 +- build.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 67cf964..10f6e53 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ stages: - image .py: &py - image: "domaindrivenarchitecture/ddadevops-python:4.3.2-dev2023-08-16-16-16-48" + image: "domaindrivenarchitecture/ddadevops-python:4.4.1-dev2023-08-16-17-33-56" before_script: - export RELEASE_ARTIFACT_TOKEN=$RELEASE_ARTIFACT_TOKEN - python --version diff --git a/build.py b/build.py index 8020581..fcea257 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.4.1-dev0" +version = "4.4.1-dev1" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] From 1a946151b7c9d69c769bdf2e3b21ea823399f79a Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 16 Aug 2023 17:45:51 +0200 Subject: [PATCH 62/97] release: 4.5.0 --- build.py | 2 +- infrastructure/clj-cljs/build.py | 2 +- infrastructure/clj/build.py | 2 +- infrastructure/ddadevops/build.py | 2 +- infrastructure/dind/build.py | 2 +- infrastructure/python/build.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index fcea257..8d28d7f 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.4.1-dev1" +version = "4.5.0" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/infrastructure/clj-cljs/build.py b/infrastructure/clj-cljs/build.py index 9bdc510..7d46e2a 100644 --- a/infrastructure/clj-cljs/build.py +++ b/infrastructure/clj-cljs/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj-cljs" PROJECT_ROOT_PATH = "../.." -version = "4.4.1-dev" +version = "4.5.0" @init def initialize(project): diff --git a/infrastructure/clj/build.py b/infrastructure/clj/build.py index 8459886..21a2808 100644 --- a/infrastructure/clj/build.py +++ b/infrastructure/clj/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj" PROJECT_ROOT_PATH = "../.." -version = "4.4.1-dev" +version = "4.5.0" @init def initialize(project): diff --git a/infrastructure/ddadevops/build.py b/infrastructure/ddadevops/build.py index bfd6f92..b7563fb 100644 --- a/infrastructure/ddadevops/build.py +++ b/infrastructure/ddadevops/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "ddadevops" PROJECT_ROOT_PATH = "../.." -version = "4.4.1-dev" +version = "4.5.0" @init diff --git a/infrastructure/dind/build.py b/infrastructure/dind/build.py index e78fddc..aa88980 100644 --- a/infrastructure/dind/build.py +++ b/infrastructure/dind/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "dind" PROJECT_ROOT_PATH = "../.." -version = "4.4.1-dev" +version = "4.5.0" @init diff --git a/infrastructure/python/build.py b/infrastructure/python/build.py index 77733c8..2c0fcf6 100644 --- a/infrastructure/python/build.py +++ b/infrastructure/python/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "python" PROJECT_ROOT_PATH = "../.." -version = "4.4.1-dev" +version = "4.5.0" @init From 951e66776d46cf3534d0686fb69434b1c53ddf1e Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 16 Aug 2023 17:45:51 +0200 Subject: [PATCH 63/97] bump version to: 4.5.1-dev --- build.py | 2 +- infrastructure/clj-cljs/build.py | 2 +- infrastructure/clj/build.py | 2 +- infrastructure/ddadevops/build.py | 2 +- infrastructure/dind/build.py | 2 +- infrastructure/python/build.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index 8d28d7f..79e7bd3 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.5.0" +version = "4.5.1-dev" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/infrastructure/clj-cljs/build.py b/infrastructure/clj-cljs/build.py index 7d46e2a..38661d7 100644 --- a/infrastructure/clj-cljs/build.py +++ b/infrastructure/clj-cljs/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj-cljs" PROJECT_ROOT_PATH = "../.." -version = "4.5.0" +version = "4.5.1-dev" @init def initialize(project): diff --git a/infrastructure/clj/build.py b/infrastructure/clj/build.py index 21a2808..4a5c12e 100644 --- a/infrastructure/clj/build.py +++ b/infrastructure/clj/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj" PROJECT_ROOT_PATH = "../.." -version = "4.5.0" +version = "4.5.1-dev" @init def initialize(project): diff --git a/infrastructure/ddadevops/build.py b/infrastructure/ddadevops/build.py index b7563fb..befd865 100644 --- a/infrastructure/ddadevops/build.py +++ b/infrastructure/ddadevops/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "ddadevops" PROJECT_ROOT_PATH = "../.." -version = "4.5.0" +version = "4.5.1-dev" @init diff --git a/infrastructure/dind/build.py b/infrastructure/dind/build.py index aa88980..1cedcb4 100644 --- a/infrastructure/dind/build.py +++ b/infrastructure/dind/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "dind" PROJECT_ROOT_PATH = "../.." -version = "4.5.0" +version = "4.5.1-dev" @init diff --git a/infrastructure/python/build.py b/infrastructure/python/build.py index 2c0fcf6..67ce408 100644 --- a/infrastructure/python/build.py +++ b/infrastructure/python/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "python" PROJECT_ROOT_PATH = "../.." -version = "4.5.0" +version = "4.5.1-dev" @init From b77a8fd67dfbaacb1a8ca9e50f1559b9dface0e1 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 16 Aug 2023 17:57:21 +0200 Subject: [PATCH 64/97] add curl to py build image --- .gitlab-ci.yml | 2 +- infrastructure/python/image/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 10f6e53..e8e528a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ stages: - image .py: &py - image: "domaindrivenarchitecture/ddadevops-python:4.4.1-dev2023-08-16-17-33-56" + image: "domaindrivenarchitecture/ddadevops-python:4.5.1-dev2023-08-16-17-49-58" before_script: - export RELEASE_ARTIFACT_TOKEN=$RELEASE_ARTIFACT_TOKEN - python --version diff --git a/infrastructure/python/image/Dockerfile b/infrastructure/python/image/Dockerfile index 57d756c..c335e5f 100644 --- a/infrastructure/python/image/Dockerfile +++ b/infrastructure/python/image/Dockerfile @@ -1,7 +1,7 @@ FROM python:3.10-alpine RUN set -eux; -RUN apk add --no-cache build-base rust python3 python3-dev py3-pip py3-setuptools py3-wheel libffi-dev openssl-dev cargo bash git; +RUN apk add --no-cache build-base rust python3 python3-dev py3-pip py3-setuptools py3-wheel libffi-dev openssl-dev cargo bash git curl; RUN python3 -m pip install -U pip; RUN pip3 install pybuilder ddadevops deprecation dda-python-terraform boto3 pyyaml inflection; RUN pip3 install coverage flake8 flake8-polyfill mypy mypy-extensions pycodestyle pyflakes pylint pytest pytest-cov pytest-datafiles types-setuptools types-PyYAML; From 6dc10b77e769584f2fcf1f1dff0882fda39a95e0 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 16 Aug 2023 17:57:45 +0200 Subject: [PATCH 65/97] release: 4.5.1 --- build.py | 2 +- infrastructure/clj-cljs/build.py | 2 +- infrastructure/clj/build.py | 2 +- infrastructure/ddadevops/build.py | 2 +- infrastructure/dind/build.py | 2 +- infrastructure/python/build.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index 79e7bd3..d3ab323 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.5.1-dev" +version = "4.5.1" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/infrastructure/clj-cljs/build.py b/infrastructure/clj-cljs/build.py index 38661d7..4032ef4 100644 --- a/infrastructure/clj-cljs/build.py +++ b/infrastructure/clj-cljs/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj-cljs" PROJECT_ROOT_PATH = "../.." -version = "4.5.1-dev" +version = "4.5.1" @init def initialize(project): diff --git a/infrastructure/clj/build.py b/infrastructure/clj/build.py index 4a5c12e..4aa5510 100644 --- a/infrastructure/clj/build.py +++ b/infrastructure/clj/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj" PROJECT_ROOT_PATH = "../.." -version = "4.5.1-dev" +version = "4.5.1" @init def initialize(project): diff --git a/infrastructure/ddadevops/build.py b/infrastructure/ddadevops/build.py index befd865..e995eb2 100644 --- a/infrastructure/ddadevops/build.py +++ b/infrastructure/ddadevops/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "ddadevops" PROJECT_ROOT_PATH = "../.." -version = "4.5.1-dev" +version = "4.5.1" @init diff --git a/infrastructure/dind/build.py b/infrastructure/dind/build.py index 1cedcb4..a105778 100644 --- a/infrastructure/dind/build.py +++ b/infrastructure/dind/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "dind" PROJECT_ROOT_PATH = "../.." -version = "4.5.1-dev" +version = "4.5.1" @init diff --git a/infrastructure/python/build.py b/infrastructure/python/build.py index 67ce408..10f11d0 100644 --- a/infrastructure/python/build.py +++ b/infrastructure/python/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "python" PROJECT_ROOT_PATH = "../.." -version = "4.5.1-dev" +version = "4.5.1" @init From d67dfb7378a80ddf4c23401bda41cd21e0dd5593 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 16 Aug 2023 17:57:45 +0200 Subject: [PATCH 66/97] bump version to: 4.5.2-dev --- build.py | 2 +- infrastructure/clj-cljs/build.py | 2 +- infrastructure/clj/build.py | 2 +- infrastructure/ddadevops/build.py | 2 +- infrastructure/dind/build.py | 2 +- infrastructure/python/build.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index d3ab323..5bc81c9 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.5.1" +version = "4.5.2-dev" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/infrastructure/clj-cljs/build.py b/infrastructure/clj-cljs/build.py index 4032ef4..58d49eb 100644 --- a/infrastructure/clj-cljs/build.py +++ b/infrastructure/clj-cljs/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj-cljs" PROJECT_ROOT_PATH = "../.." -version = "4.5.1" +version = "4.5.2-dev" @init def initialize(project): diff --git a/infrastructure/clj/build.py b/infrastructure/clj/build.py index 4aa5510..1e87233 100644 --- a/infrastructure/clj/build.py +++ b/infrastructure/clj/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj" PROJECT_ROOT_PATH = "../.." -version = "4.5.1" +version = "4.5.2-dev" @init def initialize(project): diff --git a/infrastructure/ddadevops/build.py b/infrastructure/ddadevops/build.py index e995eb2..6a68fb0 100644 --- a/infrastructure/ddadevops/build.py +++ b/infrastructure/ddadevops/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "ddadevops" PROJECT_ROOT_PATH = "../.." -version = "4.5.1" +version = "4.5.2-dev" @init diff --git a/infrastructure/dind/build.py b/infrastructure/dind/build.py index a105778..7a4a160 100644 --- a/infrastructure/dind/build.py +++ b/infrastructure/dind/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "dind" PROJECT_ROOT_PATH = "../.." -version = "4.5.1" +version = "4.5.2-dev" @init diff --git a/infrastructure/python/build.py b/infrastructure/python/build.py index 10f11d0..b2695c0 100644 --- a/infrastructure/python/build.py +++ b/infrastructure/python/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "python" PROJECT_ROOT_PATH = "../.." -version = "4.5.1" +version = "4.5.2-dev" @init From f8ec35860aada7977f9e84c02d20b27cfaa921a7 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 16 Aug 2023 18:18:40 +0200 Subject: [PATCH 67/97] add more debugging info --- .gitlab-ci.yml | 2 +- .../python/ddadevops/application/release_mixin_services.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e8e528a..260e36a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ stages: - image .py: &py - image: "domaindrivenarchitecture/ddadevops-python:4.5.1-dev2023-08-16-17-49-58" + image: "domaindrivenarchitecture/ddadevops-python:4.5.2-dev2023-08-16-18-10-19" before_script: - export RELEASE_ARTIFACT_TOKEN=$RELEASE_ARTIFACT_TOKEN - python --version diff --git a/src/main/python/ddadevops/application/release_mixin_services.py b/src/main/python/ddadevops/application/release_mixin_services.py index bc3ab0a..12c3932 100644 --- a/src/main/python/ddadevops/application/release_mixin_services.py +++ b/src/main/python/ddadevops/application/release_mixin_services.py @@ -89,7 +89,11 @@ class ReleaseService: def __parse_forgejo_release_id__(self, release_response: str) -> int: parsed = json.loads(release_response) - return parsed["id"] + try: + result = parsed["id"] + except: + raise RuntimeError(str(parsed)) + return result def __set_version_and_commit__( self, version: Version, build_file_ids: List[str], message: str From 954a2f735b7d56cee4d9d5308dada153f630849d Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 16 Aug 2023 18:19:16 +0200 Subject: [PATCH 68/97] release: 4.5.2 --- build.py | 2 +- infrastructure/clj-cljs/build.py | 2 +- infrastructure/clj/build.py | 2 +- infrastructure/ddadevops/build.py | 2 +- infrastructure/dind/build.py | 2 +- infrastructure/python/build.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index 5bc81c9..5e8f258 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.5.2-dev" +version = "4.5.2" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/infrastructure/clj-cljs/build.py b/infrastructure/clj-cljs/build.py index 58d49eb..9c33fd3 100644 --- a/infrastructure/clj-cljs/build.py +++ b/infrastructure/clj-cljs/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj-cljs" PROJECT_ROOT_PATH = "../.." -version = "4.5.2-dev" +version = "4.5.2" @init def initialize(project): diff --git a/infrastructure/clj/build.py b/infrastructure/clj/build.py index 1e87233..ec1f8be 100644 --- a/infrastructure/clj/build.py +++ b/infrastructure/clj/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj" PROJECT_ROOT_PATH = "../.." -version = "4.5.2-dev" +version = "4.5.2" @init def initialize(project): diff --git a/infrastructure/ddadevops/build.py b/infrastructure/ddadevops/build.py index 6a68fb0..d2859b5 100644 --- a/infrastructure/ddadevops/build.py +++ b/infrastructure/ddadevops/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "ddadevops" PROJECT_ROOT_PATH = "../.." -version = "4.5.2-dev" +version = "4.5.2" @init diff --git a/infrastructure/dind/build.py b/infrastructure/dind/build.py index 7a4a160..b0e3d8e 100644 --- a/infrastructure/dind/build.py +++ b/infrastructure/dind/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "dind" PROJECT_ROOT_PATH = "../.." -version = "4.5.2-dev" +version = "4.5.2" @init diff --git a/infrastructure/python/build.py b/infrastructure/python/build.py index b2695c0..a3c68c0 100644 --- a/infrastructure/python/build.py +++ b/infrastructure/python/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "python" PROJECT_ROOT_PATH = "../.." -version = "4.5.2-dev" +version = "4.5.2" @init From bf74fd1a730dec704cb4910f4db04d6fe380374c Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 16 Aug 2023 18:19:16 +0200 Subject: [PATCH 69/97] bump version to: 4.5.3-dev --- build.py | 2 +- infrastructure/clj-cljs/build.py | 2 +- infrastructure/clj/build.py | 2 +- infrastructure/ddadevops/build.py | 2 +- infrastructure/dind/build.py | 2 +- infrastructure/python/build.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index 5e8f258..183bdbc 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.5.2" +version = "4.5.3-dev" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/infrastructure/clj-cljs/build.py b/infrastructure/clj-cljs/build.py index 9c33fd3..b7409f1 100644 --- a/infrastructure/clj-cljs/build.py +++ b/infrastructure/clj-cljs/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj-cljs" PROJECT_ROOT_PATH = "../.." -version = "4.5.2" +version = "4.5.3-dev" @init def initialize(project): diff --git a/infrastructure/clj/build.py b/infrastructure/clj/build.py index ec1f8be..82c2d91 100644 --- a/infrastructure/clj/build.py +++ b/infrastructure/clj/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj" PROJECT_ROOT_PATH = "../.." -version = "4.5.2" +version = "4.5.3-dev" @init def initialize(project): diff --git a/infrastructure/ddadevops/build.py b/infrastructure/ddadevops/build.py index d2859b5..2e41fa0 100644 --- a/infrastructure/ddadevops/build.py +++ b/infrastructure/ddadevops/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "ddadevops" PROJECT_ROOT_PATH = "../.." -version = "4.5.2" +version = "4.5.3-dev" @init diff --git a/infrastructure/dind/build.py b/infrastructure/dind/build.py index b0e3d8e..536a554 100644 --- a/infrastructure/dind/build.py +++ b/infrastructure/dind/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "dind" PROJECT_ROOT_PATH = "../.." -version = "4.5.2" +version = "4.5.3-dev" @init diff --git a/infrastructure/python/build.py b/infrastructure/python/build.py index a3c68c0..4c52b52 100644 --- a/infrastructure/python/build.py +++ b/infrastructure/python/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "python" PROJECT_ROOT_PATH = "../.." -version = "4.5.2" +version = "4.5.3-dev" @init From e7000ec408deebb362f30381f3d701cfdc081200 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 16 Aug 2023 18:29:54 +0200 Subject: [PATCH 70/97] Handover the corect token? --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 260e36a..fbfbdab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ stages: .py: &py image: "domaindrivenarchitecture/ddadevops-python:4.5.2-dev2023-08-16-18-10-19" before_script: - - export RELEASE_ARTIFACT_TOKEN=$RELEASE_ARTIFACT_TOKEN + - export RELEASE_ARTIFACT_TOKEN=$MEISSA_REPO_BUERO_RW - python --version - pip install -r requirements.txt From 3d83ec19e1b549866f88cde5187ba377a78f3b49 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 16 Aug 2023 18:30:56 +0200 Subject: [PATCH 71/97] release: 4.5.3 --- build.py | 2 +- infrastructure/clj-cljs/build.py | 2 +- infrastructure/clj/build.py | 2 +- infrastructure/ddadevops/build.py | 2 +- infrastructure/dind/build.py | 2 +- infrastructure/python/build.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index 183bdbc..1c09644 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.5.3-dev" +version = "4.5.3" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/infrastructure/clj-cljs/build.py b/infrastructure/clj-cljs/build.py index b7409f1..4bee221 100644 --- a/infrastructure/clj-cljs/build.py +++ b/infrastructure/clj-cljs/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj-cljs" PROJECT_ROOT_PATH = "../.." -version = "4.5.3-dev" +version = "4.5.3" @init def initialize(project): diff --git a/infrastructure/clj/build.py b/infrastructure/clj/build.py index 82c2d91..bf910e9 100644 --- a/infrastructure/clj/build.py +++ b/infrastructure/clj/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj" PROJECT_ROOT_PATH = "../.." -version = "4.5.3-dev" +version = "4.5.3" @init def initialize(project): diff --git a/infrastructure/ddadevops/build.py b/infrastructure/ddadevops/build.py index 2e41fa0..970d6f7 100644 --- a/infrastructure/ddadevops/build.py +++ b/infrastructure/ddadevops/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "ddadevops" PROJECT_ROOT_PATH = "../.." -version = "4.5.3-dev" +version = "4.5.3" @init diff --git a/infrastructure/dind/build.py b/infrastructure/dind/build.py index 536a554..5c72491 100644 --- a/infrastructure/dind/build.py +++ b/infrastructure/dind/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "dind" PROJECT_ROOT_PATH = "../.." -version = "4.5.3-dev" +version = "4.5.3" @init diff --git a/infrastructure/python/build.py b/infrastructure/python/build.py index 4c52b52..3f4516b 100644 --- a/infrastructure/python/build.py +++ b/infrastructure/python/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "python" PROJECT_ROOT_PATH = "../.." -version = "4.5.3-dev" +version = "4.5.3" @init From b3841a6801a54d39ce12bc6afc73bc4a8ce0c2df Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 16 Aug 2023 18:30:56 +0200 Subject: [PATCH 72/97] bump version to: 4.5.4-dev --- build.py | 2 +- infrastructure/clj-cljs/build.py | 2 +- infrastructure/clj/build.py | 2 +- infrastructure/ddadevops/build.py | 2 +- infrastructure/dind/build.py | 2 +- infrastructure/python/build.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index 1c09644..ef710ef 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.5.3" +version = "4.5.4-dev" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/infrastructure/clj-cljs/build.py b/infrastructure/clj-cljs/build.py index 4bee221..1076571 100644 --- a/infrastructure/clj-cljs/build.py +++ b/infrastructure/clj-cljs/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj-cljs" PROJECT_ROOT_PATH = "../.." -version = "4.5.3" +version = "4.5.4-dev" @init def initialize(project): diff --git a/infrastructure/clj/build.py b/infrastructure/clj/build.py index bf910e9..6f6c29d 100644 --- a/infrastructure/clj/build.py +++ b/infrastructure/clj/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj" PROJECT_ROOT_PATH = "../.." -version = "4.5.3" +version = "4.5.4-dev" @init def initialize(project): diff --git a/infrastructure/ddadevops/build.py b/infrastructure/ddadevops/build.py index 970d6f7..4892000 100644 --- a/infrastructure/ddadevops/build.py +++ b/infrastructure/ddadevops/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "ddadevops" PROJECT_ROOT_PATH = "../.." -version = "4.5.3" +version = "4.5.4-dev" @init diff --git a/infrastructure/dind/build.py b/infrastructure/dind/build.py index 5c72491..74fda6f 100644 --- a/infrastructure/dind/build.py +++ b/infrastructure/dind/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "dind" PROJECT_ROOT_PATH = "../.." -version = "4.5.3" +version = "4.5.4-dev" @init diff --git a/infrastructure/python/build.py b/infrastructure/python/build.py index 3f4516b..cac0159 100644 --- a/infrastructure/python/build.py +++ b/infrastructure/python/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "python" PROJECT_ROOT_PATH = "../.." -version = "4.5.3" +version = "4.5.4-dev" @init From d15195a8e0c461886333d21f3ae1df8e22220293 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 16 Aug 2023 18:36:30 +0200 Subject: [PATCH 73/97] release: 4.5.4 --- build.py | 2 +- infrastructure/clj-cljs/build.py | 2 +- infrastructure/clj/build.py | 2 +- infrastructure/ddadevops/build.py | 2 +- infrastructure/dind/build.py | 2 +- infrastructure/python/build.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index ef710ef..7fa8d14 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.5.4-dev" +version = "4.5.4" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/infrastructure/clj-cljs/build.py b/infrastructure/clj-cljs/build.py index 1076571..5a8cd2c 100644 --- a/infrastructure/clj-cljs/build.py +++ b/infrastructure/clj-cljs/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj-cljs" PROJECT_ROOT_PATH = "../.." -version = "4.5.4-dev" +version = "4.5.4" @init def initialize(project): diff --git a/infrastructure/clj/build.py b/infrastructure/clj/build.py index 6f6c29d..16a09e3 100644 --- a/infrastructure/clj/build.py +++ b/infrastructure/clj/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj" PROJECT_ROOT_PATH = "../.." -version = "4.5.4-dev" +version = "4.5.4" @init def initialize(project): diff --git a/infrastructure/ddadevops/build.py b/infrastructure/ddadevops/build.py index 4892000..a67de18 100644 --- a/infrastructure/ddadevops/build.py +++ b/infrastructure/ddadevops/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "ddadevops" PROJECT_ROOT_PATH = "../.." -version = "4.5.4-dev" +version = "4.5.4" @init diff --git a/infrastructure/dind/build.py b/infrastructure/dind/build.py index 74fda6f..5b0750f 100644 --- a/infrastructure/dind/build.py +++ b/infrastructure/dind/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "dind" PROJECT_ROOT_PATH = "../.." -version = "4.5.4-dev" +version = "4.5.4" @init diff --git a/infrastructure/python/build.py b/infrastructure/python/build.py index cac0159..55e66fd 100644 --- a/infrastructure/python/build.py +++ b/infrastructure/python/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "python" PROJECT_ROOT_PATH = "../.." -version = "4.5.4-dev" +version = "4.5.4" @init From 95ca351ae8a23850e5a10a8a60c7e35651834278 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 16 Aug 2023 18:36:31 +0200 Subject: [PATCH 74/97] bump version to: 4.5.5-dev --- build.py | 2 +- infrastructure/clj-cljs/build.py | 2 +- infrastructure/clj/build.py | 2 +- infrastructure/ddadevops/build.py | 2 +- infrastructure/dind/build.py | 2 +- infrastructure/python/build.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index 7fa8d14..581ac16 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.5.4" +version = "4.5.5-dev" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/infrastructure/clj-cljs/build.py b/infrastructure/clj-cljs/build.py index 5a8cd2c..181a8eb 100644 --- a/infrastructure/clj-cljs/build.py +++ b/infrastructure/clj-cljs/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj-cljs" PROJECT_ROOT_PATH = "../.." -version = "4.5.4" +version = "4.5.5-dev" @init def initialize(project): diff --git a/infrastructure/clj/build.py b/infrastructure/clj/build.py index 16a09e3..637fcdf 100644 --- a/infrastructure/clj/build.py +++ b/infrastructure/clj/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj" PROJECT_ROOT_PATH = "../.." -version = "4.5.4" +version = "4.5.5-dev" @init def initialize(project): diff --git a/infrastructure/ddadevops/build.py b/infrastructure/ddadevops/build.py index a67de18..3e4ed57 100644 --- a/infrastructure/ddadevops/build.py +++ b/infrastructure/ddadevops/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "ddadevops" PROJECT_ROOT_PATH = "../.." -version = "4.5.4" +version = "4.5.5-dev" @init diff --git a/infrastructure/dind/build.py b/infrastructure/dind/build.py index 5b0750f..6a80d98 100644 --- a/infrastructure/dind/build.py +++ b/infrastructure/dind/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "dind" PROJECT_ROOT_PATH = "../.." -version = "4.5.4" +version = "4.5.5-dev" @init diff --git a/infrastructure/python/build.py b/infrastructure/python/build.py index 55e66fd..a8f0766 100644 --- a/infrastructure/python/build.py +++ b/infrastructure/python/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "python" PROJECT_ROOT_PATH = "../.." -version = "4.5.4" +version = "4.5.5-dev" @init From 17d93c34ec68429cb45a1f2ab20cf2a15a9374fc Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Thu, 17 Aug 2023 17:10:13 +0200 Subject: [PATCH 75/97] adjust for buildtest --- infrastructure/ddadevops/image/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/infrastructure/ddadevops/image/Dockerfile b/infrastructure/ddadevops/image/Dockerfile index 833fa70..f284a2d 100644 --- a/infrastructure/ddadevops/image/Dockerfile +++ b/infrastructure/ddadevops/image/Dockerfile @@ -1,6 +1,7 @@ FROM python:3.10-alpine RUN set -eux; -RUN apk add --no-cache python3 py3-pip openssl-dev bash git; +RUN apk add --no-cache python3 py3-pip openssl-dev bash git curl; RUN python3 -m pip install -U pip; RUN pip3 install pybuilder ddadevops deprecation dda-python-terraform boto3 pyyaml inflection; +RUN pip3 install --upgrade ddadevops --pre From 686c703f7d18882155f3d7aa57ccbe5c92e5372f Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Thu, 17 Aug 2023 17:10:29 +0200 Subject: [PATCH 76/97] minor cleanup --- .../ddadevops/infrastructure/infrastructure.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index 210e415..c6b36bd 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -224,15 +224,15 @@ class ArtifactDeploymentApi: self.execution_api = ExecutionApi() def create_forgejo_release(self, api_endpoint_url: str, tag: str, token: str): - return self.execution_api.execute_secure( + sanitized_command = ( f'curl -X "POST" "{api_endpoint_url}" ' + '-H "accept: application/json" -H "Content-Type: application/json" ' - + f'-d \'{{ "body": "Provides files for release {tag}", "tag_name": "{tag}"}}\' ' # noqa: E501 - + f'-H "Authorization: token {token}"', - sanitized_command=f'curl -X "POST" "{api_endpoint_url}" ' - + '-H "accept: application/json" -H "Content-Type: application/json" ' - + f'-d \'{{ "body": "Provides files for release {tag}", "tag_name": "{tag}"}}\' ', # noqa: E501 + + f'-d \'{{ "body": "Provides files for release {tag}", "tag_name": "{tag}"}}\' ' ) # noqa: E501 + command = sanitized_command + f'-H "Authorization: token {token}"' + return self.execution_api.execute_secure( + command=command, sanitized_command=sanitized_command + ) def add_asset_to_release( self, From 3ccac186c9a0550603362f37a550ba58170372ca Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Thu, 17 Aug 2023 17:14:27 +0200 Subject: [PATCH 77/97] release: 4.6.0 --- build.py | 2 +- infrastructure/clj-cljs/build.py | 2 +- infrastructure/clj/build.py | 2 +- infrastructure/ddadevops/build.py | 2 +- infrastructure/dind/build.py | 2 +- infrastructure/python/build.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index 581ac16..7b65025 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.5.5-dev" +version = "4.6.0" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/infrastructure/clj-cljs/build.py b/infrastructure/clj-cljs/build.py index 181a8eb..e822941 100644 --- a/infrastructure/clj-cljs/build.py +++ b/infrastructure/clj-cljs/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj-cljs" PROJECT_ROOT_PATH = "../.." -version = "4.5.5-dev" +version = "4.6.0" @init def initialize(project): diff --git a/infrastructure/clj/build.py b/infrastructure/clj/build.py index 637fcdf..72899fa 100644 --- a/infrastructure/clj/build.py +++ b/infrastructure/clj/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj" PROJECT_ROOT_PATH = "../.." -version = "4.5.5-dev" +version = "4.6.0" @init def initialize(project): diff --git a/infrastructure/ddadevops/build.py b/infrastructure/ddadevops/build.py index 3e4ed57..58e9150 100644 --- a/infrastructure/ddadevops/build.py +++ b/infrastructure/ddadevops/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "ddadevops" PROJECT_ROOT_PATH = "../.." -version = "4.5.5-dev" +version = "4.6.0" @init diff --git a/infrastructure/dind/build.py b/infrastructure/dind/build.py index 6a80d98..66dad43 100644 --- a/infrastructure/dind/build.py +++ b/infrastructure/dind/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "dind" PROJECT_ROOT_PATH = "../.." -version = "4.5.5-dev" +version = "4.6.0" @init diff --git a/infrastructure/python/build.py b/infrastructure/python/build.py index a8f0766..3031c64 100644 --- a/infrastructure/python/build.py +++ b/infrastructure/python/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "python" PROJECT_ROOT_PATH = "../.." -version = "4.5.5-dev" +version = "4.6.0" @init From 63a043dfee5407812c65f95acb170edb363245fc Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Thu, 17 Aug 2023 17:14:27 +0200 Subject: [PATCH 78/97] bump version to: 4.6.1-dev --- build.py | 2 +- infrastructure/clj-cljs/build.py | 2 +- infrastructure/clj/build.py | 2 +- infrastructure/ddadevops/build.py | 2 +- infrastructure/dind/build.py | 2 +- infrastructure/python/build.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index 7b65025..92ca697 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.6.0" +version = "4.6.1-dev" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/infrastructure/clj-cljs/build.py b/infrastructure/clj-cljs/build.py index e822941..d4eb583 100644 --- a/infrastructure/clj-cljs/build.py +++ b/infrastructure/clj-cljs/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj-cljs" PROJECT_ROOT_PATH = "../.." -version = "4.6.0" +version = "4.6.1-dev" @init def initialize(project): diff --git a/infrastructure/clj/build.py b/infrastructure/clj/build.py index 72899fa..05a540a 100644 --- a/infrastructure/clj/build.py +++ b/infrastructure/clj/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj" PROJECT_ROOT_PATH = "../.." -version = "4.6.0" +version = "4.6.1-dev" @init def initialize(project): diff --git a/infrastructure/ddadevops/build.py b/infrastructure/ddadevops/build.py index 58e9150..e3565c3 100644 --- a/infrastructure/ddadevops/build.py +++ b/infrastructure/ddadevops/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "ddadevops" PROJECT_ROOT_PATH = "../.." -version = "4.6.0" +version = "4.6.1-dev" @init diff --git a/infrastructure/dind/build.py b/infrastructure/dind/build.py index 66dad43..b7dbd67 100644 --- a/infrastructure/dind/build.py +++ b/infrastructure/dind/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "dind" PROJECT_ROOT_PATH = "../.." -version = "4.6.0" +version = "4.6.1-dev" @init diff --git a/infrastructure/python/build.py b/infrastructure/python/build.py index 3031c64..33208a6 100644 --- a/infrastructure/python/build.py +++ b/infrastructure/python/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "python" PROJECT_ROOT_PATH = "../.." -version = "4.6.0" +version = "4.6.1-dev" @init From d5c711fa889a3319bed4b39620a8e5f2c25ad8df Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Thu, 17 Aug 2023 17:14:59 +0200 Subject: [PATCH 79/97] use current build container --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fbfbdab..5c78507 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ stages: - image .py: &py - image: "domaindrivenarchitecture/ddadevops-python:4.5.2-dev2023-08-16-18-10-19" + image: "domaindrivenarchitecture/ddadevops-python:4.5.5-dev2023-08-17-17-07-54" before_script: - export RELEASE_ARTIFACT_TOKEN=$MEISSA_REPO_BUERO_RW - python --version From 22397a369e5fdbf4edde6798d96d406122d2a915 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Thu, 17 Aug 2023 17:15:18 +0200 Subject: [PATCH 80/97] release: 4.7.0 --- build.py | 2 +- infrastructure/clj-cljs/build.py | 2 +- infrastructure/clj/build.py | 2 +- infrastructure/ddadevops/build.py | 2 +- infrastructure/dind/build.py | 2 +- infrastructure/python/build.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index 92ca697..db3367d 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.6.1-dev" +version = "4.7.0" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/infrastructure/clj-cljs/build.py b/infrastructure/clj-cljs/build.py index d4eb583..3620aca 100644 --- a/infrastructure/clj-cljs/build.py +++ b/infrastructure/clj-cljs/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj-cljs" PROJECT_ROOT_PATH = "../.." -version = "4.6.1-dev" +version = "4.7.0" @init def initialize(project): diff --git a/infrastructure/clj/build.py b/infrastructure/clj/build.py index 05a540a..1a9cd42 100644 --- a/infrastructure/clj/build.py +++ b/infrastructure/clj/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj" PROJECT_ROOT_PATH = "../.." -version = "4.6.1-dev" +version = "4.7.0" @init def initialize(project): diff --git a/infrastructure/ddadevops/build.py b/infrastructure/ddadevops/build.py index e3565c3..f6a6748 100644 --- a/infrastructure/ddadevops/build.py +++ b/infrastructure/ddadevops/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "ddadevops" PROJECT_ROOT_PATH = "../.." -version = "4.6.1-dev" +version = "4.7.0" @init diff --git a/infrastructure/dind/build.py b/infrastructure/dind/build.py index b7dbd67..57f45ab 100644 --- a/infrastructure/dind/build.py +++ b/infrastructure/dind/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "dind" PROJECT_ROOT_PATH = "../.." -version = "4.6.1-dev" +version = "4.7.0" @init diff --git a/infrastructure/python/build.py b/infrastructure/python/build.py index 33208a6..bf8c364 100644 --- a/infrastructure/python/build.py +++ b/infrastructure/python/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "python" PROJECT_ROOT_PATH = "../.." -version = "4.6.1-dev" +version = "4.7.0" @init From c669d8f7b5652d2bdf18b3bc81c7caac2bc26668 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Thu, 17 Aug 2023 17:15:18 +0200 Subject: [PATCH 81/97] bump version to: 4.7.1-dev --- build.py | 2 +- infrastructure/clj-cljs/build.py | 2 +- infrastructure/clj/build.py | 2 +- infrastructure/ddadevops/build.py | 2 +- infrastructure/dind/build.py | 2 +- infrastructure/python/build.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index db3367d..d480966 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.7.0" +version = "4.7.1-dev" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/infrastructure/clj-cljs/build.py b/infrastructure/clj-cljs/build.py index 3620aca..3bdfb68 100644 --- a/infrastructure/clj-cljs/build.py +++ b/infrastructure/clj-cljs/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj-cljs" PROJECT_ROOT_PATH = "../.." -version = "4.7.0" +version = "4.7.1-dev" @init def initialize(project): diff --git a/infrastructure/clj/build.py b/infrastructure/clj/build.py index 1a9cd42..d427a1a 100644 --- a/infrastructure/clj/build.py +++ b/infrastructure/clj/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj" PROJECT_ROOT_PATH = "../.." -version = "4.7.0" +version = "4.7.1-dev" @init def initialize(project): diff --git a/infrastructure/ddadevops/build.py b/infrastructure/ddadevops/build.py index f6a6748..785d3f5 100644 --- a/infrastructure/ddadevops/build.py +++ b/infrastructure/ddadevops/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "ddadevops" PROJECT_ROOT_PATH = "../.." -version = "4.7.0" +version = "4.7.1-dev" @init diff --git a/infrastructure/dind/build.py b/infrastructure/dind/build.py index 57f45ab..b8302e4 100644 --- a/infrastructure/dind/build.py +++ b/infrastructure/dind/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "dind" PROJECT_ROOT_PATH = "../.." -version = "4.7.0" +version = "4.7.1-dev" @init diff --git a/infrastructure/python/build.py b/infrastructure/python/build.py index bf8c364..d3619a5 100644 --- a/infrastructure/python/build.py +++ b/infrastructure/python/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "python" PROJECT_ROOT_PATH = "../.." -version = "4.7.0" +version = "4.7.1-dev" @init From a5923aef5f876d0e97a9444003792f2cc7c146bf Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Thu, 17 Aug 2023 17:25:42 +0200 Subject: [PATCH 82/97] use released build-container --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5c78507..e5cbeae 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,14 +4,14 @@ stages: - image .py: &py - image: "domaindrivenarchitecture/ddadevops-python:4.5.5-dev2023-08-17-17-07-54" + image: "domaindrivenarchitecture/ddadevops-python:4.7.0" before_script: - export RELEASE_ARTIFACT_TOKEN=$MEISSA_REPO_BUERO_RW - python --version - pip install -r requirements.txt .img: &img - image: "domaindrivenarchitecture/ddadevops-dind:4.1.0" + image: "domaindrivenarchitecture/ddadevops-dind:4.7.0" services: - docker:dind before_script: From 1afa34dba312f990edb4322976c0247a2b6d7ae8 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Thu, 17 Aug 2023 17:25:55 +0200 Subject: [PATCH 83/97] required for releasing --- build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.py b/build.py index d480966..f219e27 100644 --- a/build.py +++ b/build.py @@ -46,7 +46,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") + project.build_depends_on("ddadevops>=4.7.0") project.set_property("verbose", True) project.get_property("filter_resources_glob").append( From d8396402b52327ed4a84e19cc6371549cdca3b23 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Thu, 17 Aug 2023 17:28:01 +0200 Subject: [PATCH 84/97] bootstrap with dev no longer needed --- infrastructure/clj-cljs/image/resources/install.sh | 2 +- infrastructure/clj/image/resources/install.sh | 2 +- infrastructure/ddadevops/image/Dockerfile | 1 - infrastructure/python/image/Dockerfile | 1 - 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/infrastructure/clj-cljs/image/resources/install.sh b/infrastructure/clj-cljs/image/resources/install.sh index aab2448..1167e3a 100755 --- a/infrastructure/clj-cljs/image/resources/install.sh +++ b/infrastructure/clj-cljs/image/resources/install.sh @@ -23,7 +23,7 @@ function main() { #install pyb apt -qqy install python3 python3-pip git; - pip3 install pybuilder 'ddadevops>=4.2.0' deprecation dda-python-terraform boto3 pyyaml inflection --break-system-packages; + pip3 install pybuilder 'ddadevops>=4.7.0' deprecation dda-python-terraform boto3 pyyaml inflection --break-system-packages; cleanupDocker } diff --git a/infrastructure/clj/image/resources/install.sh b/infrastructure/clj/image/resources/install.sh index 987cf0a..6694783 100755 --- a/infrastructure/clj/image/resources/install.sh +++ b/infrastructure/clj/image/resources/install.sh @@ -29,7 +29,7 @@ function main() { #install pyb apt -qqy install python3 python3-pip; - pip3 install pybuilder 'ddadevops>=4.2.0' deprecation dda-python-terraform boto3 pyyaml inflection --break-system-packages; + pip3 install pybuilder 'ddadevops>=4.7.0' deprecation dda-python-terraform boto3 pyyaml inflection --break-system-packages; cleanupDocker } diff --git a/infrastructure/ddadevops/image/Dockerfile b/infrastructure/ddadevops/image/Dockerfile index f284a2d..3ec73d0 100644 --- a/infrastructure/ddadevops/image/Dockerfile +++ b/infrastructure/ddadevops/image/Dockerfile @@ -4,4 +4,3 @@ RUN set -eux; RUN apk add --no-cache python3 py3-pip openssl-dev bash git curl; RUN python3 -m pip install -U pip; RUN pip3 install pybuilder ddadevops deprecation dda-python-terraform boto3 pyyaml inflection; -RUN pip3 install --upgrade ddadevops --pre diff --git a/infrastructure/python/image/Dockerfile b/infrastructure/python/image/Dockerfile index c335e5f..bae55e0 100644 --- a/infrastructure/python/image/Dockerfile +++ b/infrastructure/python/image/Dockerfile @@ -5,4 +5,3 @@ RUN apk add --no-cache build-base rust python3 python3-dev py3-pip py3-setuptool RUN python3 -m pip install -U pip; RUN pip3 install pybuilder ddadevops deprecation dda-python-terraform boto3 pyyaml inflection; RUN pip3 install coverage flake8 flake8-polyfill mypy mypy-extensions pycodestyle pyflakes pylint pytest pytest-cov pytest-datafiles types-setuptools types-PyYAML; -RUN pip3 install --upgrade ddadevops --pre From cea54b094569c183e7b6c11b55fe888a8f644311 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Thu, 17 Aug 2023 18:23:33 +0200 Subject: [PATCH 85/97] added doc for creating artifacts --- README.md | 5 -- doc/ReleaseMixin.md | 117 ++++++++++++++++++++++++++++++++++++++------ 2 files changed, 102 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index aac6210..1a3c411 100644 --- a/README.md +++ b/README.md @@ -205,8 +205,3 @@ For more details about our repository model see: https://repo.prod.meissa.de/mei Copyright © 2021 meissa GmbH Licensed under the [Apache License, Version 2.0](LICENSE) (the "License") - -## License - -Copyright © 2023 meissa GmbH -Licensed under the [Apache License, Version 2.0](LICENSE) (the "License") diff --git a/doc/ReleaseMixin.md b/doc/ReleaseMixin.md index aa4e419..15e21c9 100644 --- a/doc/ReleaseMixin.md +++ b/doc/ReleaseMixin.md @@ -1,5 +1,15 @@ # ReleaseMixin +- [ReleaseMixin](#releasemixin) + - [Input](#input) + - [Example Usage just for creating releases](#example-usage-just-for-creating-releases) + - [build.py](#buildpy) + - [call the build for creating a major release](#call-the-build-for-creating-a-major-release) + - [Example Usage for creating a release on forgejo / gitea \& upload the generated artifacts](#example-usage-for-creating-a-release-on-forgejo--gitea--upload-the-generated-artifacts) + - [build.py](#buildpy-1) + - [call the build](#call-the-build) + + Support for releases following the trunk-based-release flow (see https://trunkbaseddevelopment.com/) ```mermaid @@ -20,8 +30,12 @@ classDiagram | release_main_branch | the name of your trank | "main" | | release_primary_build_file | path to the build file having the leading version info (read & write). Valid extensions are .clj, .json, .gradle, .py | "./project.clj" | | release_secondary_build_files | list of secondary build files, version is written in. | [] | +| release_artifact_server_url | Optional: The base url of your forgejo/gitea instance to publish a release tode | | +| 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 | [] | -## Example Usage +## Example Usage just for creating releases ### build.py @@ -36,7 +50,7 @@ PROJECT_ROOT_PATH = '..' @init def initialize(project): - project.build_depends_on("ddadevops>=4.0.0") + project.build_depends_on("ddadevops>=4.7.0") input = { "name": name, @@ -48,35 +62,108 @@ def initialize(project): "release_type": "MINOR", "release_primary_build_file": "project.clj", "release_secondary_build_files": ["package.json"], - } - - roject.build_depends_on("ddadevops>=4.0.0-dev") - + } build = ReleaseMixin(project, input) build.initialize_build_dir() @task -def prepare_release(project): - build = get_devops_build(project) - build.prepare_release() +def patch(project): + linttest(project, "PATCH") + release(project) + @task -def build(project): - print("do the build") +def minor(project): + linttest(project, "MINOR") + release(project) + @task -def publish(project): - print("publish your artefacts") +def major(project): + linttest(project, "MAJOR") + release(project) + + +@task +def dev(project): + linttest(project, "NONE") + + +@task +def prepare(project): + build = get_devops_build(project) + build.prepare_release() + @task -def after_publish(project): +def tag(project): build = get_devops_build(project) build.tag_bump_and_push_release() + + +def release(project): + prepare(project) + tag(project) + + +def linttest(project, release_type): + build = get_devops_build(project) + build.update_release_type(release_type) + #test(project) + #lint(project) +``` + +### call the build for creating a major release + +```bash +pyb major +``` + +## Example Usage for creating a release on forgejo / gitea & upload the generated artifacts + +### build.py + +```python +rom os import environ +from pybuilder.core import task, init +from ddadevops import * + +name = 'my-project' +MODULE = 'my-module' +PROJECT_ROOT_PATH = '..' + +@init +def initialize(project): + project.build_depends_on("ddadevops>=4.7.0") + + input = { + "name": name, + "module": MODULE, + "stage": "notused", + "project_root_path": PROJECT_ROOT_PATH, + "build_types": [], + "mixin_types": ["RELEASE"], + "release_type": "MINOR", + "release_primary_build_file": "project.clj", + "release_secondary_build_files": ["package.json"], + "release_artifact_server_url": "https://repo.prod.meissa.de", + "release_organisation": "meissa", + "release_repository_name": "dda-devops-build", + "release_artifacts": ["target/doc.zip"], + } + build = ReleaseMixin(project, input) + build.initialize_build_dir() + +@task +def publish_artifacts(project): + build = get_devops_build(project) + build.publish_artifacts() ``` ### call the build ```bash -pyb prepare_release build publish after_publish +git checkout "4.7.0" +pyb publish_artifacts ``` From 331c57a952632a1b6aac7fc8367c29d72c8e7022 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Thu, 17 Aug 2023 18:25:59 +0200 Subject: [PATCH 86/97] gitlab ci is no longer used --- .github/workflows/stable.yml | 42 ---------------------------------- .github/workflows/unstable.yml | 30 ------------------------ 2 files changed, 72 deletions(-) delete mode 100644 .github/workflows/stable.yml delete mode 100644 .github/workflows/unstable.yml diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml deleted file mode 100644 index 0436fda..0000000 --- a/.github/workflows/stable.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: stable -on: - push: - tags: - - '[0-9]+.[0-9]+.[0-9]+' - -jobs: - build: - name: stable build - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Use python 3.x - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - - name: install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: build stable release - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_DDA }} - run: | - pyb -P version=${{ github.ref }} publish upload - - - name: Create GH Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - draft: false - prerelease: false - \ No newline at end of file diff --git a/.github/workflows/unstable.yml b/.github/workflows/unstable.yml deleted file mode 100644 index d7fd8b4..0000000 --- a/.github/workflows/unstable.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: unstable -on: - push: - tags: - - '![0-9]+.[0-9]+.[0-9]+' - -jobs: - build: - name: unstable - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Use python 3.x - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - - name: install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: build unstable release - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_DDA }} - run: | - pyb publish upload From bdca4f224f6fdc87cc110a4dcb51d4bd33a342b5 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Thu, 17 Aug 2023 18:28:17 +0200 Subject: [PATCH 87/97] add new function to doc --- doc/ReleaseMixin.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/ReleaseMixin.md b/doc/ReleaseMixin.md index 15e21c9..6b4bbb6 100644 --- a/doc/ReleaseMixin.md +++ b/doc/ReleaseMixin.md @@ -18,6 +18,7 @@ classDiagram prepare_release() - adjust all build files to carry the correct version & commit locally tag_and_push_release() - tag the git repo and push changes to origin update_release_type (release_type) - change the release type during run time + publish_artifacts() - publish release & artifacts to forgejo/gitea } ``` From d3e8c19f02ca3fa363553fcd4b8497dfd83726b2 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 22 Sep 2023 17:38:34 +0200 Subject: [PATCH 88/97] release: 4.7.1 --- build.py | 2 +- infrastructure/clj-cljs/build.py | 2 +- infrastructure/clj/build.py | 2 +- infrastructure/ddadevops/build.py | 2 +- infrastructure/dind/build.py | 2 +- infrastructure/python/build.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index f219e27..fe31022 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.7.1-dev" +version = "4.7.1" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/infrastructure/clj-cljs/build.py b/infrastructure/clj-cljs/build.py index 3bdfb68..c83af35 100644 --- a/infrastructure/clj-cljs/build.py +++ b/infrastructure/clj-cljs/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj-cljs" PROJECT_ROOT_PATH = "../.." -version = "4.7.1-dev" +version = "4.7.1" @init def initialize(project): diff --git a/infrastructure/clj/build.py b/infrastructure/clj/build.py index d427a1a..404cec2 100644 --- a/infrastructure/clj/build.py +++ b/infrastructure/clj/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj" PROJECT_ROOT_PATH = "../.." -version = "4.7.1-dev" +version = "4.7.1" @init def initialize(project): diff --git a/infrastructure/ddadevops/build.py b/infrastructure/ddadevops/build.py index 785d3f5..e50bead 100644 --- a/infrastructure/ddadevops/build.py +++ b/infrastructure/ddadevops/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "ddadevops" PROJECT_ROOT_PATH = "../.." -version = "4.7.1-dev" +version = "4.7.1" @init diff --git a/infrastructure/dind/build.py b/infrastructure/dind/build.py index b8302e4..6f8a4df 100644 --- a/infrastructure/dind/build.py +++ b/infrastructure/dind/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "dind" PROJECT_ROOT_PATH = "../.." -version = "4.7.1-dev" +version = "4.7.1" @init diff --git a/infrastructure/python/build.py b/infrastructure/python/build.py index d3619a5..abebd0d 100644 --- a/infrastructure/python/build.py +++ b/infrastructure/python/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "python" PROJECT_ROOT_PATH = "../.." -version = "4.7.1-dev" +version = "4.7.1" @init From 58bfd98af911188b1275f1813051b7d3316072fc Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 22 Sep 2023 17:38:34 +0200 Subject: [PATCH 89/97] bump version to: 4.7.2-dev --- build.py | 2 +- infrastructure/clj-cljs/build.py | 2 +- infrastructure/clj/build.py | 2 +- infrastructure/ddadevops/build.py | 2 +- infrastructure/dind/build.py | 2 +- infrastructure/python/build.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index fe31022..67b7558 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.7.1" +version = "4.7.2-dev" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/infrastructure/clj-cljs/build.py b/infrastructure/clj-cljs/build.py index c83af35..d0d1195 100644 --- a/infrastructure/clj-cljs/build.py +++ b/infrastructure/clj-cljs/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj-cljs" PROJECT_ROOT_PATH = "../.." -version = "4.7.1" +version = "4.7.2-dev" @init def initialize(project): diff --git a/infrastructure/clj/build.py b/infrastructure/clj/build.py index 404cec2..202d755 100644 --- a/infrastructure/clj/build.py +++ b/infrastructure/clj/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj" PROJECT_ROOT_PATH = "../.." -version = "4.7.1" +version = "4.7.2-dev" @init def initialize(project): diff --git a/infrastructure/ddadevops/build.py b/infrastructure/ddadevops/build.py index e50bead..9705126 100644 --- a/infrastructure/ddadevops/build.py +++ b/infrastructure/ddadevops/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "ddadevops" PROJECT_ROOT_PATH = "../.." -version = "4.7.1" +version = "4.7.2-dev" @init diff --git a/infrastructure/dind/build.py b/infrastructure/dind/build.py index 6f8a4df..1ffce00 100644 --- a/infrastructure/dind/build.py +++ b/infrastructure/dind/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "dind" PROJECT_ROOT_PATH = "../.." -version = "4.7.1" +version = "4.7.2-dev" @init diff --git a/infrastructure/python/build.py b/infrastructure/python/build.py index abebd0d..937372b 100644 --- a/infrastructure/python/build.py +++ b/infrastructure/python/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "python" PROJECT_ROOT_PATH = "../.." -version = "4.7.1" +version = "4.7.2-dev" @init From 1db263d13f9a728e320ed5804dee548348aee2e6 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 22 Sep 2023 17:46:58 +0200 Subject: [PATCH 90/97] release: 4.7.2 --- build.py | 2 +- infrastructure/clj-cljs/build.py | 2 +- infrastructure/clj/build.py | 2 +- infrastructure/ddadevops/build.py | 2 +- infrastructure/dind/build.py | 2 +- infrastructure/python/build.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index 67b7558..d80db62 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.7.2-dev" +version = "4.7.2" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/infrastructure/clj-cljs/build.py b/infrastructure/clj-cljs/build.py index d0d1195..27d436f 100644 --- a/infrastructure/clj-cljs/build.py +++ b/infrastructure/clj-cljs/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj-cljs" PROJECT_ROOT_PATH = "../.." -version = "4.7.2-dev" +version = "4.7.2" @init def initialize(project): diff --git a/infrastructure/clj/build.py b/infrastructure/clj/build.py index 202d755..e705679 100644 --- a/infrastructure/clj/build.py +++ b/infrastructure/clj/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj" PROJECT_ROOT_PATH = "../.." -version = "4.7.2-dev" +version = "4.7.2" @init def initialize(project): diff --git a/infrastructure/ddadevops/build.py b/infrastructure/ddadevops/build.py index 9705126..5a121a4 100644 --- a/infrastructure/ddadevops/build.py +++ b/infrastructure/ddadevops/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "ddadevops" PROJECT_ROOT_PATH = "../.." -version = "4.7.2-dev" +version = "4.7.2" @init diff --git a/infrastructure/dind/build.py b/infrastructure/dind/build.py index 1ffce00..57c0a5d 100644 --- a/infrastructure/dind/build.py +++ b/infrastructure/dind/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "dind" PROJECT_ROOT_PATH = "../.." -version = "4.7.2-dev" +version = "4.7.2" @init diff --git a/infrastructure/python/build.py b/infrastructure/python/build.py index 937372b..0b71c43 100644 --- a/infrastructure/python/build.py +++ b/infrastructure/python/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "python" PROJECT_ROOT_PATH = "../.." -version = "4.7.2-dev" +version = "4.7.2" @init From 4c0524aafee09d794419e525cb304c5cfc8083bc Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 22 Sep 2023 17:46:58 +0200 Subject: [PATCH 91/97] bump version to: 4.7.3-dev --- build.py | 2 +- infrastructure/clj-cljs/build.py | 2 +- infrastructure/clj/build.py | 2 +- infrastructure/ddadevops/build.py | 2 +- infrastructure/dind/build.py | 2 +- infrastructure/python/build.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index d80db62..40a9546 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.7.2" +version = "4.7.3-dev" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/infrastructure/clj-cljs/build.py b/infrastructure/clj-cljs/build.py index 27d436f..64b0d9d 100644 --- a/infrastructure/clj-cljs/build.py +++ b/infrastructure/clj-cljs/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj-cljs" PROJECT_ROOT_PATH = "../.." -version = "4.7.2" +version = "4.7.3-dev" @init def initialize(project): diff --git a/infrastructure/clj/build.py b/infrastructure/clj/build.py index e705679..2fca432 100644 --- a/infrastructure/clj/build.py +++ b/infrastructure/clj/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj" PROJECT_ROOT_PATH = "../.." -version = "4.7.2" +version = "4.7.3-dev" @init def initialize(project): diff --git a/infrastructure/ddadevops/build.py b/infrastructure/ddadevops/build.py index 5a121a4..af46cb0 100644 --- a/infrastructure/ddadevops/build.py +++ b/infrastructure/ddadevops/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "ddadevops" PROJECT_ROOT_PATH = "../.." -version = "4.7.2" +version = "4.7.3-dev" @init diff --git a/infrastructure/dind/build.py b/infrastructure/dind/build.py index 57c0a5d..8304dc8 100644 --- a/infrastructure/dind/build.py +++ b/infrastructure/dind/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "dind" PROJECT_ROOT_PATH = "../.." -version = "4.7.2" +version = "4.7.3-dev" @init diff --git a/infrastructure/python/build.py b/infrastructure/python/build.py index 0b71c43..90b7c9e 100644 --- a/infrastructure/python/build.py +++ b/infrastructure/python/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "python" PROJECT_ROOT_PATH = "../.." -version = "4.7.2" +version = "4.7.3-dev" @init From d643bba3257961d18515e22f5b0b9bf1b4034e43 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 22 Sep 2023 17:49:37 +0200 Subject: [PATCH 92/97] add some cleanup --- .../application/release_mixin_services.py | 5 ++-- .../infrastructure/infrastructure.py | 28 ++++++++++--------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/main/python/ddadevops/application/release_mixin_services.py b/src/main/python/ddadevops/application/release_mixin_services.py index 12c3932..6c96c07 100644 --- a/src/main/python/ddadevops/application/release_mixin_services.py +++ b/src/main/python/ddadevops/application/release_mixin_services.py @@ -62,11 +62,12 @@ class ReleaseService: self.git_api.push_follow_tags() def publish_artifacts(self, release: Release): + token = str(release.release_artifact_token) release_id = self.__parse_forgejo_release_id__( self.artifact_deployment_api.create_forgejo_release( release.forgejo_release_api_endpoint(), release.version.to_string(), - str(release.release_artifact_token), + token, ) ) @@ -84,7 +85,7 @@ class ReleaseService: release.forgejo_release_asset_api_endpoint(release_id), artifact.path(), artifact.type(), - str(release.release_artifact_token), + token, ) def __parse_forgejo_release_id__(self, release_response: str) -> int: diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index c6b36bd..4a65c63 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -224,14 +224,15 @@ class ArtifactDeploymentApi: self.execution_api = ExecutionApi() def create_forgejo_release(self, api_endpoint_url: str, tag: str, token: str): - sanitized_command = ( + command = ( f'curl -X "POST" "{api_endpoint_url}" ' - + '-H "accept: application/json" -H "Content-Type: application/json" ' - + f'-d \'{{ "body": "Provides files for release {tag}", "tag_name": "{tag}"}}\' ' + + ' -H "accept: application/json" -H "Content-Type: application/json"' + + f' -d \'{{ "body": "Provides files for release {tag}", "tag_name": "{tag}"}}\'' ) # noqa: E501 - command = sanitized_command + f'-H "Authorization: token {token}"' + print(command + ' -H "Authorization: token xxxx"') return self.execution_api.execute_secure( - command=command, sanitized_command=sanitized_command + command=command + f' -H "Authorization: token {token}"', + sanitized_command=command + ' -H "Authorization: token xxxx"', ) def add_asset_to_release( @@ -241,15 +242,16 @@ class ArtifactDeploymentApi: attachment_type: str, token: str, ): + command = ( + f'curl -X "POST" "{api_endpoint_url}"' + + ' -H "accept: application/json"' + + ' -H "Content-Type: multipart/form-data"' + + f' -F "attachment=@{attachment};type={attachment_type}"' + ) # noqa: E501 + print(command + ' -H "Authorization: token xxxx"') return self.execution_api.execute_secure( - f'curl -X "POST" "{api_endpoint_url}" ' - + f'-H "accept: application/json" -H "Authorization: token {token}" ' - + '-H "Content-Type: multipart/form-data" ' - + f'-F "attachment=@{attachment};type={attachment_type}"', - sanitized_command=f'curl -X "POST" "{api_endpoint_url}" ' - + '-H "accept: application/json" ' - + '-H "Content-Type: multipart/form-data" ' - + f'-F "attachment=@{attachment};type={attachment_type}"', + command=command + f' -H "Authorization: token {token}"', + sanitized_command=command + ' -H "Authorization: token xxxx"', ) def calculate_sha256(self, path: Path): From 5d8190387000ce0814c4c42d38139b1006bd7684 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 22 Sep 2023 18:08:42 +0200 Subject: [PATCH 93/97] release: 4.7.3 --- build.py | 2 +- infrastructure/clj-cljs/build.py | 2 +- infrastructure/clj/build.py | 2 +- infrastructure/ddadevops/build.py | 2 +- infrastructure/dind/build.py | 2 +- infrastructure/python/build.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index 40a9546..a02a249 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.7.3-dev" +version = "4.7.3" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/infrastructure/clj-cljs/build.py b/infrastructure/clj-cljs/build.py index 64b0d9d..077f940 100644 --- a/infrastructure/clj-cljs/build.py +++ b/infrastructure/clj-cljs/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj-cljs" PROJECT_ROOT_PATH = "../.." -version = "4.7.3-dev" +version = "4.7.3" @init def initialize(project): diff --git a/infrastructure/clj/build.py b/infrastructure/clj/build.py index 2fca432..d0699b1 100644 --- a/infrastructure/clj/build.py +++ b/infrastructure/clj/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj" PROJECT_ROOT_PATH = "../.." -version = "4.7.3-dev" +version = "4.7.3" @init def initialize(project): diff --git a/infrastructure/ddadevops/build.py b/infrastructure/ddadevops/build.py index af46cb0..feb371f 100644 --- a/infrastructure/ddadevops/build.py +++ b/infrastructure/ddadevops/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "ddadevops" PROJECT_ROOT_PATH = "../.." -version = "4.7.3-dev" +version = "4.7.3" @init diff --git a/infrastructure/dind/build.py b/infrastructure/dind/build.py index 8304dc8..212d3b3 100644 --- a/infrastructure/dind/build.py +++ b/infrastructure/dind/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "dind" PROJECT_ROOT_PATH = "../.." -version = "4.7.3-dev" +version = "4.7.3" @init diff --git a/infrastructure/python/build.py b/infrastructure/python/build.py index 90b7c9e..6f96d1f 100644 --- a/infrastructure/python/build.py +++ b/infrastructure/python/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "python" PROJECT_ROOT_PATH = "../.." -version = "4.7.3-dev" +version = "4.7.3" @init From 9fdd81d4b0e8c1b2b071c1d5d9802eb1db4a0579 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 22 Sep 2023 18:08:43 +0200 Subject: [PATCH 94/97] bump version to: 4.7.4-dev --- build.py | 2 +- infrastructure/clj-cljs/build.py | 2 +- infrastructure/clj/build.py | 2 +- infrastructure/ddadevops/build.py | 2 +- infrastructure/dind/build.py | 2 +- infrastructure/python/build.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index a02a249..35eb388 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.7.3" +version = "4.7.4-dev" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/infrastructure/clj-cljs/build.py b/infrastructure/clj-cljs/build.py index 077f940..4b892e9 100644 --- a/infrastructure/clj-cljs/build.py +++ b/infrastructure/clj-cljs/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj-cljs" PROJECT_ROOT_PATH = "../.." -version = "4.7.3" +version = "4.7.4-dev" @init def initialize(project): diff --git a/infrastructure/clj/build.py b/infrastructure/clj/build.py index d0699b1..30c85c2 100644 --- a/infrastructure/clj/build.py +++ b/infrastructure/clj/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj" PROJECT_ROOT_PATH = "../.." -version = "4.7.3" +version = "4.7.4-dev" @init def initialize(project): diff --git a/infrastructure/ddadevops/build.py b/infrastructure/ddadevops/build.py index feb371f..4c5e151 100644 --- a/infrastructure/ddadevops/build.py +++ b/infrastructure/ddadevops/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "ddadevops" PROJECT_ROOT_PATH = "../.." -version = "4.7.3" +version = "4.7.4-dev" @init diff --git a/infrastructure/dind/build.py b/infrastructure/dind/build.py index 212d3b3..560c8eb 100644 --- a/infrastructure/dind/build.py +++ b/infrastructure/dind/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "dind" PROJECT_ROOT_PATH = "../.." -version = "4.7.3" +version = "4.7.4-dev" @init diff --git a/infrastructure/python/build.py b/infrastructure/python/build.py index 6f96d1f..ce06047 100644 --- a/infrastructure/python/build.py +++ b/infrastructure/python/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "python" PROJECT_ROOT_PATH = "../.." -version = "4.7.3" +version = "4.7.4-dev" @init From 7e5e66d933969026055c5c106eec3b3a2a6b2c87 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 29 Sep 2023 09:52:37 +0200 Subject: [PATCH 95/97] fix doc --- doc/DevopsBuild.md | 5 +---- doc/DevopsImageBuild.md | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/doc/DevopsBuild.md b/doc/DevopsBuild.md index 9056dbd..0e81948 100644 --- a/doc/DevopsBuild.md +++ b/doc/DevopsBuild.md @@ -23,12 +23,9 @@ classDiagram | build_dir_name | name of dir, build is executed in | target | | build_types | list of special builds used. Valid values are ["IMAGE", "C4K", "K3S", "TERRAFORM"] | [] | | mixin_types | mixins are orthoganl to builds and represent additional capabilities. Valid Values are ["RELEASE"] | [] | -| module | module name - may result in a hierarchy like name/module | | -| name | dedicated name of the build | module | -| project_root_path | relative path to projects root. Is used to locate the target dir | | -| stage | sth. like test, int, acc or prod | | ## Example Usage + ### build.py ```python diff --git a/doc/DevopsImageBuild.md b/doc/DevopsImageBuild.md index d260631..1eb38b1 100644 --- a/doc/DevopsImageBuild.md +++ b/doc/DevopsImageBuild.md @@ -30,7 +30,7 @@ classDiagram | image_dockerhub_user | user to access docker-hub | IMAGE_DOCKERHUB_USER from env or credentials from gopass | | image_dockerhub_password | password to access docker-hub | IMAGE_DOCKERHUB_PASSWORD from env or credentials from gopass | | image_tag | tag for publishing the image | IMAGE_TAG from env | - +| image_naming | Strategy for calculate the image name. Posible values are [NAME_ONLY,NAME_AND_MODULE] |NAME_ONLY | ### Credentials Mapping defaults From fc92260a43de71fc3ec1a4564dfb27aefb0bb294 Mon Sep 17 00:00:00 2001 From: Clemens Date: Fri, 13 Oct 2023 09:51:23 +0200 Subject: [PATCH 96/97] release: 4.7.4 --- build.py | 2 +- infrastructure/clj-cljs/build.py | 2 +- infrastructure/clj/build.py | 2 +- infrastructure/ddadevops/build.py | 2 +- infrastructure/dind/build.py | 2 +- infrastructure/python/build.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index 35eb388..997cd2f 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.7.4-dev" +version = "4.7.4" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/infrastructure/clj-cljs/build.py b/infrastructure/clj-cljs/build.py index 4b892e9..f513a28 100644 --- a/infrastructure/clj-cljs/build.py +++ b/infrastructure/clj-cljs/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj-cljs" PROJECT_ROOT_PATH = "../.." -version = "4.7.4-dev" +version = "4.7.4" @init def initialize(project): diff --git a/infrastructure/clj/build.py b/infrastructure/clj/build.py index 30c85c2..d0bb1e6 100644 --- a/infrastructure/clj/build.py +++ b/infrastructure/clj/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj" PROJECT_ROOT_PATH = "../.." -version = "4.7.4-dev" +version = "4.7.4" @init def initialize(project): diff --git a/infrastructure/ddadevops/build.py b/infrastructure/ddadevops/build.py index 4c5e151..37c3d8f 100644 --- a/infrastructure/ddadevops/build.py +++ b/infrastructure/ddadevops/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "ddadevops" PROJECT_ROOT_PATH = "../.." -version = "4.7.4-dev" +version = "4.7.4" @init diff --git a/infrastructure/dind/build.py b/infrastructure/dind/build.py index 560c8eb..5e34b47 100644 --- a/infrastructure/dind/build.py +++ b/infrastructure/dind/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "dind" PROJECT_ROOT_PATH = "../.." -version = "4.7.4-dev" +version = "4.7.4" @init diff --git a/infrastructure/python/build.py b/infrastructure/python/build.py index ce06047..4ccfd5e 100644 --- a/infrastructure/python/build.py +++ b/infrastructure/python/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "python" PROJECT_ROOT_PATH = "../.." -version = "4.7.4-dev" +version = "4.7.4" @init From edd2ae574342488ed6d105ab41e2744fbca4985b Mon Sep 17 00:00:00 2001 From: Clemens Date: Fri, 13 Oct 2023 09:51:23 +0200 Subject: [PATCH 97/97] bump version to: 4.7.5-dev --- build.py | 2 +- infrastructure/clj-cljs/build.py | 2 +- infrastructure/clj/build.py | 2 +- infrastructure/ddadevops/build.py | 2 +- infrastructure/dind/build.py | 2 +- infrastructure/python/build.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.py b/build.py index 997cd2f..7b91d00 100644 --- a/build.py +++ b/build.py @@ -33,7 +33,7 @@ default_task = "dev" name = "ddadevops" MODULE = "not-used" PROJECT_ROOT_PATH = "." -version = "4.7.4" +version = "4.7.5-dev" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/infrastructure/clj-cljs/build.py b/infrastructure/clj-cljs/build.py index f513a28..6d06890 100644 --- a/infrastructure/clj-cljs/build.py +++ b/infrastructure/clj-cljs/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj-cljs" PROJECT_ROOT_PATH = "../.." -version = "4.7.4" +version = "4.7.5-dev" @init def initialize(project): diff --git a/infrastructure/clj/build.py b/infrastructure/clj/build.py index d0bb1e6..6093263 100644 --- a/infrastructure/clj/build.py +++ b/infrastructure/clj/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "clj" PROJECT_ROOT_PATH = "../.." -version = "4.7.4" +version = "4.7.5-dev" @init def initialize(project): diff --git a/infrastructure/ddadevops/build.py b/infrastructure/ddadevops/build.py index 37c3d8f..da14d36 100644 --- a/infrastructure/ddadevops/build.py +++ b/infrastructure/ddadevops/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "ddadevops" PROJECT_ROOT_PATH = "../.." -version = "4.7.4" +version = "4.7.5-dev" @init diff --git a/infrastructure/dind/build.py b/infrastructure/dind/build.py index 5e34b47..aac3c14 100644 --- a/infrastructure/dind/build.py +++ b/infrastructure/dind/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "dind" PROJECT_ROOT_PATH = "../.." -version = "4.7.4" +version = "4.7.5-dev" @init diff --git a/infrastructure/python/build.py b/infrastructure/python/build.py index 4ccfd5e..fd453d4 100644 --- a/infrastructure/python/build.py +++ b/infrastructure/python/build.py @@ -6,7 +6,7 @@ from ddadevops import * name = "ddadevops" MODULE = "python" PROJECT_ROOT_PATH = "../.." -version = "4.7.4" +version = "4.7.5-dev" @init