Manage artifact retention rules
Learn about artifact retention rules that manage build artifacts and control storage costs.
読み終わるまでの所要時間 2 分最終更新 13時間前
Use artifact retention rules to automatically delete artifacts for builds based on age or the number of builds. Deleting build artifacts saves on storage costs. Unity Build Automation (UBA) evaluates the artifact retention rules during the next scheduled evaluation. UBA evaluates artifact retention rules every hour. When UBA deletes artifacts based on retention rules, it keeps a record of the build target. This build target provides details such as build statistics, storage size, and configuration. You can view build targets and a summary of the active artifact retention rules in Build History. You must have the owner permission or the manager permission for the selected project to manage artifact retention rules. By default, a project has no artifact retention rules configured. This means that UBA retains build artifacts according to the Unity DevOps retention schemas. To manage artifact retention rules:
- In the Unity Dashboard, go to Build Automation > Settings.
- Go to Project settings and to Artifact Retention rules.
- To delete build artifacts based on the age of a build, enable Time-based rule and set the build age in days. For more information, refer to Time-based rule.
- To delete build artifacts based on build count, enable Build count rule and set the maximum number of builds. For more information, refer to Build count rule.
- For either retention rule, enable Retain logs to keep build logs when UBA deletes other build artifacts. When enabled, UBA ignores builds with only logs during rule evaluation. For more information, refer to Artifacts and logs.
- Select Save to save artifact retention rules.
Time-based rule
Use the time-based artifact retention rule to delete artifacts from builds that are older than a specified number of days. UBA applies this retention rule to builds based on the following criteria:- The build isn't a favorite build.
- The build has a terminal build status of success, failure, canceled, or unknown.
- The build has artifacts, or the build has only logs and Retain logs is disabled.
Build count rule
Use the build count artifact retention rule to delete build artifacts when the number of builds exceeds a specified limit. UBA counts a build when its terminal build status is success, failure, canceled, or unknown. The build must also match one of the following conditions:- The build isn't a favorite build.
- The build has artifacts.
- The build has only logs and Retain logs is disabled.