Unpublishing build artifacts

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Unpublishing build artifacts

Tim Van Holder
Hi,

I'm looking at adding support for unpublishing build artifacts.

Basically, our .NET-based jobs create NuGet packages which are added as artifacts for the run but also pushed to a package server.

For our non-release CI jobs, I want to look at automating cleanup so that when the job is deleted, the packages are also removed from the package server.
This would ensure that a retention policy is only needed in Jenkins, not also in the package server.

I'm running into two problems:
- reacting to the job delete using RunListener works, and I can see the package artifacts in
  order to determine which package(s) need unpublishing.
  - However, I don't immediately see a means for storing information on the Run when doing the
    push (like the server used) that can be picked up on the delete.
- it's also possible to delete the artifacts without deleting the entire run; however, there does not
  seem to be a way to react to that at all.
  - I also assume (but have not tested) that deleting the artifacts deletes the whole artifact, not just
    the file data, so I would not be able to see that there used to be a package there when the job
    is deleted.

Any suggestions/ideas?

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAKMi--DddQ2LjR-f9qWbYBdOVAb-BBSdnUCPvw8EAowA%3DJH6cw%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Unpublishing build artifacts

slide
You could add an Action to the Run (https://javadoc.jenkins-ci.org/hudson/model/Run.html#addAction-hudson.model.Action-) to store information about the artifact location on the server. Then when you are getting a delete, you could look for the Action and pull the necessary information from there.


On Wed, Mar 31, 2021 at 4:20 PM Tim Van Holder <[hidden email]> wrote:
Hi,

I'm looking at adding support for unpublishing build artifacts.

Basically, our .NET-based jobs create NuGet packages which are added as artifacts for the run but also pushed to a package server.

For our non-release CI jobs, I want to look at automating cleanup so that when the job is deleted, the packages are also removed from the package server.
This would ensure that a retention policy is only needed in Jenkins, not also in the package server.

I'm running into two problems:
- reacting to the job delete using RunListener works, and I can see the package artifacts in
  order to determine which package(s) need unpublishing.
  - However, I don't immediately see a means for storing information on the Run when doing the
    push (like the server used) that can be picked up on the delete.
- it's also possible to delete the artifacts without deleting the entire run; however, there does not
  seem to be a way to react to that at all.
  - I also assume (but have not tested) that deleting the artifacts deletes the whole artifact, not just
    the file data, so I would not be able to see that there used to be a package there when the job
    is deleted.

Any suggestions/ideas?

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAKMi--DddQ2LjR-f9qWbYBdOVAb-BBSdnUCPvw8EAowA%3DJH6cw%40mail.gmail.com.


--

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAPiUgVdV_2m-8BytR50nZiT-3tuaLu6gc3eU6sKBGTNiXeZegw%40mail.gmail.com.