New plugin request for feedback: Execute a script every time a build gets deleted

34 views
Skip to first unread message

jayleg...@gmail.com

unread,
Dec 5, 2016, 5:01:28 PM12/5/16
to Jenkins Developers
In our build environment, we store build results in up to 3 different locations.  Therefore, when a build is deleted in Jenkins, we would like for it to be deleted in the other locations as well.  To accomplish this, we need a Jenkins plugin that would execute a script every time a build is deleted in Jenkins.

I have only been using Jenkins for the past month (have found plugins for our other needs), so your feedback is definitely appreciated.  Please let me know if I have overlooked an existing solution; otherwise, I will start investigating what's necessary to create a Jenkins plugin.

Thanks

Ted Xiao

unread,
Dec 5, 2016, 10:50:21 PM12/5/16
to Jenkins Developers
I am afraid you need write a plugin to extend ItemListener, see also http://javadoc.jenkins.io/hudson/model/listeners/ItemListener.html#onDeleted(hudson.model.Item)
or you can check the JENKINS_HOME/jobs/job_name/builds folder on Jenkins server periodically and compare what  builds you have

jayleg...@gmail.com

unread,
Dec 8, 2016, 12:58:30 PM12/8/16
to Jenkins Developers

I ended up extending RunListener<AbstractBuild> to trigger my plugin when a build is deleted.

Baptiste Mathus

unread,
Dec 10, 2016, 12:31:35 PM12/10/16
to Jenkins Developers
AbstractBuild seems wrong if you also want to catch Pipelines deletions. Did you try just Job?

Le 8 déc. 2016 6:58 PM, <jayleg...@gmail.com> a écrit :

I ended up extending RunListener<AbstractBuild> to trigger my plugin when a build is deleted.

--
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 jenkinsci-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/c04b3e6f-9346-41b6-9989-354c803ba2ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages