Compare commits

..

No commits in common. "074e77196e320f74a9ec48d83b4c940f2f9c2cc8" and "0952ec57a87c07bbeade33cc43dd1fad816c74a1" have entirely different histories.

7 changed files with 4 additions and 39 deletions

View file

@ -176,7 +176,6 @@ def prepare(project):
def tag(project):
build = get_devops_build(project)
build.tag_bump_and_push_release()
#TODO: build.publish_artifacts()
def release(project):

View file

@ -1,25 +1,18 @@
from typing import List
from pathlib import Path
from ..infrastructure import GitApi, ArtifactDeploymentApi, BuildFileRepository
from ..infrastructure import GitApi, BuildFileRepository
from ..domain import Version, Release, ReleaseType
class ReleaseService:
def __init__(
self,
git_api: GitApi,
build_file_repository: BuildFileRepository,
artifact_deployment_api: ArtifactDeploymentApi,
):
def __init__(self, git_api: GitApi, build_file_repository: BuildFileRepository):
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),
)
@ -60,12 +53,6 @@ class ReleaseService:
)
self.git_api.push_follow_tags()
def publish_artifacts(self, release: Release):
self.artifact_deployment_api.calculate_checksums(artifact_path=)
# create release
# add artifacts to release
pass
def __set_version_and_commit__(
self, version: Version, build_file_ids: List[str], message: str
):

View file

@ -7,6 +7,5 @@ from .infrastructure import (
CredentialsApi,
GitApi,
TerraformApi,
ArtifactDeploymentApi,
)
from .repository import DevopsRepository, BuildFileRepository

View file

@ -231,6 +231,6 @@ class ArtifactDeploymentApi:
+ '-H "Content-Type: multipart/form-data" '
+ f'-F "attachment=@{attachment};type={attachment_type}"')
def calculate_checksums(self, artifact_path: str):
def calculate_checksums(self, build_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")

View file

@ -26,8 +26,3 @@ 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)

View file

@ -7,13 +7,12 @@ 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(), ArtifactDeploymentApiMock(), BuildFileRepositoryMock("build.py"))
sut = ReleaseService(GitApiMock(), BuildFileRepositoryMock("build.py"))
devops = build_devops({})
release = devops.mixins[MixinType.RELEASE]
sut.update_release_type(release, "MAJOR")

View file

@ -150,17 +150,3 @@ 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