<div dir="ltr">Yea, its located here: <a href="http://jenkins.ovirt.org/scriptler/">http://jenkins.ovirt.org/scriptler/</a><div>I see you already added it :)</div><div><br></div><div>I&#39;ve sent a patch to specify this option, as it might contain useful commands:</div><div><a href="https://gerrit.ovirt.org/#/c/54955/">https://gerrit.ovirt.org/#/c/54955/</a><br></div><div><span style="color:rgb(59,59,59);font-family:Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(238,238,238)"><br></span></div><div><span style="color:rgb(59,59,59);font-family:Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(238,238,238)">e.</span></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 17, 2016 at 12:40 PM, David Caro <span dir="ltr">&lt;<a href="mailto:dcaro@redhat.com" target="_blank">dcaro@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 03/17 14:38, Barak Korren wrote:<br>
&gt; Hi there,<br>
&gt;<br>
&gt;<br>
&gt; Working on cleaning up Jenkins I came up with the following Groovy script:<br>
&gt;<br>
&gt;   job_name = &#39;ovirt-engine_3.6_build-artifacts-fc22-x86_64&#39;<br>
&gt;   successful_to_keep = 5<br>
&gt;<br>
&gt;   job = Hudson.instance.getJob(job_name)<br>
&gt;<br>
&gt;   recent_success_times =<br>
&gt;     job._getRuns().<br>
&gt;     findAll({k, v -&gt; v.result == Result.SUCCESS }).<br>
&gt;     collect([], { k, v -&gt; v.time }).<br>
&gt;     sort().reverse().take(successful_to_keep)<br>
&gt;<br>
&gt;   third_success = recent_success_times.last()<br>
&gt;<br>
&gt;   job._getRuns().<br>
&gt;     findAll({ k, v -&gt; v.time &lt; third_success }).<br>
&gt;     each({ k, v -&gt; v.delete() })<br>
&gt;<br>
&gt; The script deletes all builds older then the 5th last successful build.<br>
<br>
<br>
</span>There&#39;s a plugin installed called &#39;scriptler&#39; that allows you to put those<br>
groovy scripts there, there are already a couple iirc<br>
<div class="HOEnZb"><div class="h5"><br>
&gt;<br>
&gt; --<br>
&gt; Barak Korren<br>
&gt; <a href="mailto:bkorren@redhat.com">bkorren@redhat.com</a><br>
&gt; RHEV-CI Team<br>
&gt; _______________________________________________<br>
&gt; Infra mailing list<br>
&gt; <a href="mailto:Infra@ovirt.org">Infra@ovirt.org</a><br>
&gt; <a href="http://lists.ovirt.org/mailman/listinfo/infra" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman/listinfo/infra</a><br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
David Caro<br>
<br>
Red Hat S.L.<br>
Continuous Integration Engineer - EMEA ENG Virtualization R&amp;D<br>
<br>
Tel.: <a href="tel:%2B420%20532%20294%20605" value="+420532294605">+420 532 294 605</a><br>
Email: <a href="mailto:dcaro@redhat.com">dcaro@redhat.com</a><br>
IRC: dcaro|dcaroest@{freenode|oftc|redhat}<br>
Web: <a href="http://www.redhat.com" rel="noreferrer" target="_blank">www.redhat.com</a><br>
RHT Global #: 82-62605<br>
</font></span><br>_______________________________________________<br>
Infra mailing list<br>
<a href="mailto:Infra@ovirt.org">Infra@ovirt.org</a><br>
<a href="http://lists.ovirt.org/mailman/listinfo/infra" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman/listinfo/infra</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Eyal Edri<br>Associate Manager</div><div>RHEV DevOps<br>EMEA ENG Virtualization R&amp;D<br>Red Hat Israel<br><br>phone: +972-9-7692018<br>irc: eedri (on #tlv #rhev-dev #rhev-integ)</div></div></div></div></div>
</div>