Compressionο
Compression module to create zip file to be used as artifact.
- compression.compress(path, ignore_files=None)ο
Creates compressed zip of the files in path.
- Parameters:
path (str) β Path of the folder to create zip file.
ignore_files (Optional[list[str]]) β Ignorefiles to use when creating zip file.
- Yields:
Iterator[tempfile.SpooledTemporaryFile[bytes]] β Bytes of the zip file in chunks.
- Raises:
InvalidPathException β Given path is invalid and cannot be traversed.
FileLimitExceededException β Compressed directory size exceeded the max limits.
- Return type:
Iterator[SpooledTemporaryFile[bytes]]
- compression.get_files_to_include(path, ignore_files=None)ο
Get a list of file paths to be included.
- Parameters:
path (str) β Root path from where to start the traversal.
ignore_files (Optional[list[str]]) β Path of ignorefiles to use, defaults to .dockerignore.
- Yields:
Iterator[str] β Path of files to be included.
- Return type:
Iterator[str]
- compression.print_file_tree(files)ο
Prints list of files in tree format.
- Parameters:
files (list[str]) β List of file paths
- Return type:
None
- compression.print_zip_content(zip_file)ο
Prints content of the zip file to stdout.
- Parameters:
zip_file (BinaryIO) β Opened zip file in binary format.
- Return type:
None