0
votes

I have been searching and have not been able to find a solution to my issue of being able to run a task prior to the build being deleted by the retention policy of the project in VSTS. Here's my current setup:

  1. Build runs, uploads artifacts to Artifactory.
  2. The URL to the artifact is stored in the properties under build summary.
  3. Project retention policy runs and removes builds that meet criteria.
  4. Corresponding artifact in Artifactory remains.

What I want to do is, up on deletion of the build in VSTS, that somehow attach to the pre-deletion of the build and run a task to delete the corresponding artifact in Artifactory. Then continue to delete the build in VSTS.

Is this possible? Is there something I was missing when trying to search for this?

1

1 Answers

0
votes

For this issue, from my point of view, it is impossible to remove external artifacts pre-deletion of build by project retention policy.

Because your retention policies are processed once per day. The timing of this process varies because we spread the work throughout the day for load balancing purposes. There is no option to change this process. So we can't track when the builds were deleted and cannot delete the corresponding external artifacts in the pre-deletion of the builds. For details ,please refer to this document.

You can through Artifactory Discard Builds task to remove build artifacts stored in Artifactory. Check the Delete artifacts checkbox, to also delete the build artifacts and not only the build meta-data.

enter image description here