Problem with Clean-Up Policy

Answered

We have several clean9-up policies: 

1. Clean-up policy for <Root project>

Artifacts more than 7 days older than the last build and older than the 3rd successful build; artifact patterns: [+:**/*]
Other items are kept forever
Do not prevent dependency artifacts cleanup

2. Clean-up policy for Project1

Everything more than 90 days older than the last build
Artifacts more than 4 days older than the last build; artifact patterns: [+:**/*]
Other items are kept forever
Do not prevent dependency artifacts cleanup

Clean-up policy for Project1 didn't inherit clean-up policy from <Root project>.

The problem is, that in Project1 apply rules for <Root project>, i.e. artifacts clear-up after 1 calendar week. Why is this happening?  ? 

 

1 comment
Comment actions Permalink

There are a few reasons why some of the older artifacts may remain even after a clean-up cycle:

- When using base rules, they work separately for each active branch and each build configuration (documentation). If the base clean-up rule is configured to keep 4 days worth of builds and there is a branch that was last built 3 days ago, artifacts produced by builds of that branch up to 7 days old will persist.
- Personal builds count as separate branches, so the above applies to personal builds too.
- When calculating the number of days worth of builds to keep, pinned builds are skipped and kept unremoved. That means if a pinned build was run 1 day ago, and the build before it ran 3 days ago, builds up to 7 days old will be kept, because the first unpinned build ran 3 days ago. You can unpin the builds to get them cleaned up.
- 'Prevent dependency artifact cleanup' option affects the artifacts produced by the configurations on which the configuration with the said option depends. For example, you have configuration A and configuration B with a snapshot dependency on A. If you need to clean up the artifacts of A, you will need to make sure B's clean-up policy has the 'Prevent dependency artifact cleanup' option unticked, not A's.

I hope this helps to clarify the cleanup issue. If you have a specific question, please let me know.

0

Please sign in to leave a comment.