Skip to content

Commit 78bd7a6

Browse files
authored
Added option to clean repository before packaging (#28)
1 parent f3207e5 commit 78bd7a6

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

continuous_delivery_scripts/plugins/golang.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,7 @@ def get_current_spdx_project(self) -> Optional[SpdxProject]:
124124
"""Gets current SPDX description."""
125125
# TODO
126126
return None
127+
128+
def should_clean_before_packaging(self) -> bool:
129+
"""States whether the repository must be cleaned before packaging happens."""
130+
return True

continuous_delivery_scripts/tag_and_release.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def tag_and_release(mode: CommitType, current_branch: Optional[str] = None) -> N
5050
insert_licence_header(0)
5151
_update_repository(mode, is_new_version, version, current_branch)
5252
if is_new_version:
53-
_clean_repository()
53+
if get_language_specifics().should_clean_before_packaging():
54+
_clean_repository()
5455
if spdx_project and get_language_specifics().should_include_spdx_in_package():
5556
_generate_spdx_reports(spdx_project)
5657
get_language_specifics().package_software(version)
@@ -94,9 +95,6 @@ def _update_repository(mode: CommitType, is_new_version: bool, version: str, cur
9495
logger.info("Tagging commit")
9596
git.create_tag(get_language_specifics().get_version_tag(version), message=f"release {version}")
9697
git.force_push_tag()
97-
git.fetch()
98-
git.pull()
99-
git.clean()
10098

10199

102100
def _clean_repository() -> None:

continuous_delivery_scripts/utils/language_specifics_base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ def should_include_spdx_in_package(self) -> bool:
6969
"""States whether the SPDX documents should be included in the package."""
7070
return False
7171

72+
def should_clean_before_packaging(self) -> bool:
73+
"""States whether the repository must be cleaned before packaging happens."""
74+
return False
75+
7276
@abstractmethod
7377
def generate_code_documentation(self, output_directory: Path, module_to_document: str) -> None:
7478
"""Generates the code documentation."""

news/202108242145.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added a language specific option to clean repository before packaging

0 commit comments

Comments
 (0)