Suggestion for optimising Artifacts size/storage
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Large Artifacts stored without compression will potentially lead to excess storage capacity usage. A job can be customised to ensure the Artifacts produced by Bamboo are compressed into a single or multiple files.
Environment
Bamboo Datacenter
Suggestion
- Enable package threshold for the type of Artifact storage. With this option, when the number of files that match the Artifact exceeds the threshold, Bamboo packs the Artifact into a single file. (Bamboo uses zip compression, and you can implement Artifact compression before publishing Artifact with solution C below.)
For Bamboo server Artifact handler, navigate to Artifact Handlers → check Enable package threshold and Add a value for the required threshold → Save
- For Amazon S3, navigate to Artifact Handlers → Add a value for the required threshold → Save
Add a script task as the last task for the Job which produces the Artifact. The script's responsibility is to compress the expected Artifact into a single compressed file, e.g;
Compresstar cvf archive.tar.gz --use-compress-program='gzip -9' *.txt
Modify the Artifacts definition to produce the compressed file, e.g **/*.gz
- To use the Artifact, a Script task can be added to the Deployment Task or child plans after the Artifacts download task, this will ensure the Artifacts are uncompressed before usage.