Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changelog/40.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated usage of rotate_archives to use source and destination directories instead of renaming the folder in place
7 changes: 6 additions & 1 deletion src/generator/features/archive.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""Archive feature for the Jenkins File Generator.
This feature allows to archive the artifacts or build products created by the jenkins pipeline.
It also allows to upload the archives to an S3 bucket.
It requires the python feature to work, and that you have in the requirements of your python folder in the project
a reference to the package GameDevTools.

Both actions have the same behavior:
1. The local folder will be copied over to the shared folder / s3 bucket with the current date
Expand Down Expand Up @@ -41,7 +43,10 @@ class RotateArchivesConfig(BaseModel):
default=False,
description="Enable or disable the action of rotating the archives",
)
directory_path: Path = Field(description="Path to the directory to rename with the current date")
source_directory: Path = Field(description="Path to the source directory where to move the files from")
destination_directory: Path = Field(
description="Path to the destination directory where to move the files to (in a new folder based on the current date"
)
keep_count: int = Field(
default=10,
description="Number of directories to keep in the parent folder after directory_path has been renamed",
Expand Down
3 changes: 2 additions & 1 deletion src/generator/templates/archive.mako
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def archivePackages() {
def rotate_archives_output_file_path = "${feature_config.rotate_archives.folder_output_file_name.as_posix()}"

stage ( "Rotate Archives" ) {
def properties = """--directory_path="${feature_config.rotate_archives.directory_path.as_posix()}" `
def properties = """--source_directory="${feature_config.rotate_archives.source_directory.as_posix()}" `
--destination_directory="${feature_config.rotate_archives.destination_directory.as_posix()}" `
--keep_count="${feature_config.rotate_archives.keep_count}" `
<%text>--folder_output_file_name="${rotate_archives_output_file_path}"</%text>
"""
Expand Down
Loading