diff --git a/.changelog/40.changed.md b/.changelog/40.changed.md new file mode 100644 index 0000000..68d671e --- /dev/null +++ b/.changelog/40.changed.md @@ -0,0 +1 @@ +Updated usage of rotate_archives to use source and destination directories instead of renaming the folder in place diff --git a/src/generator/features/archive.py b/src/generator/features/archive.py index 4313c9d..f517559 100644 --- a/src/generator/features/archive.py +++ b/src/generator/features/archive.py @@ -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 @@ -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", diff --git a/src/generator/templates/archive.mako b/src/generator/templates/archive.mako index 32451fc..38e9bea 100644 --- a/src/generator/templates/archive.mako +++ b/src/generator/templates/archive.mako @@ -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}" """