-
Bug
-
Resolution: Unresolved
-
Major
-
None
I'm not sure whether this was meant to work like it is now.
I use the Jenkins Artifactory Plugin to publish the build info of my C#-Project's builds to artifactory. I used to have a retention policy which allowed to keep 3 versions of the artifact.
Then we decided to keep all artifacts, so I removed the part of the code from my pipeline which set the retention policy
buildInfo.retention maxBuilds: 3, deleteBuildArtifacts: true
I expected that this would stop artifactory from applying the retention policy to all subsequent builds so that from the moment when the new pipeline was used, all artifacts published from those subsequent builds would be kept forever.
But after a week I recognized that still only 3 artifacts are kept in artifactory.
Now I think I have to modify and enable the above code again so that maxBuilds is set to a value where it will keep all artifacts (which one would be correct? 0 or -1).
If the behaviour described above is correct, the documentation should contain a warning.
Otherwise, I would expect the default behaviour to be that it doesn't delete anything from a build when the retention policy was not explicitly set with that build
I can't see how a Pipeline script that doesn't include build retention, could cause those builds to be deleted.
The build retention method, simply invokes a REST API of Artifactory, which triggers an on demand build retention.
I assume that there's something else that causes your builds to be discarded.