> Currently I have a NAnt script that creates zips of our builds and puts
> them in a folder. I put the build number on the file like so:
> build.111.zip, build.112.zip, etc. This is cool because if we have to go
> back a couple of builds, it is easy to do so.

Although this can be achieved in NAnt, i'm wondering why you wouldn't
just use a version control tool (e.g. Subversion) to achieve this?

A checkout then build from a previous revision works fine for me,
and by using a tool like TortoiseSVN you could easilly search the
log for details to find the appropriate revision to revert to.

> Here is my question: how could I script in NAnt the deletion of old
> builds, but keeping at least 5 previous builds. Basically, if I have build
> number "200", I want to delete all builds "194" and below. It would turn
> into a kind of rolling delete.
>
> Any thoughts? Thanks!

Here's some (trimed) code used to delete log files past a certain age,
shouldn't be too difficult to modify to parse out a build number in
the filename to compare against the current build.

<foreach item="File" property="log-file" if="${int::parse(logs-max-age)>=0}">
    <in>
        <items>
            <include name="${path::combine(logdir,'*.log')}"/>
        </items>
    </in>
    <do>
        <if 
test="${file::get-last-write-time(log-file)&lt;(datetime::now()-timespan::from-days(logs-max-age))
}">
            <delete file="${log-file}"/>
        </if>
    </do>
</foreach>

Also, it would be nice if folks could post in plain text instead of html,
aside from the bandwidth bloat, if you subscribe to this list in digest form,
it makes it unnecessary tiresome to read through great swaths of markup.

peace
si

> ------=_NextPart_000_00BD_01C5C35F.EDCFDFA0
> Content-Type: text/html;
>         charset="us-ascii"
> Content-Transfer-Encoding: quoted-printable
>
> <HTML>=0D=0A<BODY>=0D=0A<html xmlns:o=3D"urn:schemas-microsoft-com:office:o=
> ffice" xmlns:w=3D"urn:schemas-microsoft-com:office:word" xmlns=3D"http://ww=
> w=2Ew3=2Eorg/TR/REC-html40">=0D=0A=0D=0A<head>=0D=0A<META HTTP-EQUIV=3D"Con=
> tent-Type" CONTENT=3D"text/html; charset=3Dus-ascii">=0D=0A<meta name=3DGen=
> erator content=3D"Microsoft Word 11 (filtered medium)">=0D=0A<style>=0D=0A<=
> !--=0D=0A /* Style Definitions */=0D=0A p=2EMsoNormal, li=2EMsoNormal, div=
> =2EMsoNormal=0D=0A      {margin:0in;=0D=0A      
> margin-bottom:=2E0001pt;=0D=0A  font-s=
> ize:12=2E0pt;=0D=0A     font-family:"Times New Roman";}=0D=0Aa:link, 
> span=2EMso=
> Hyperlink=0D=0A {color:blue;=0D=0A      
> text-decoration:underline;}=0D=0Aa:visit=
> ed, span=2EMsoHyperlinkFollowed=0D=0A   {color:purple;=0D=0A    
> text-decoration:=
> underline;}=0D=0Aspan=2EEmailStyle17=0D=0A      
> {mso-style-type:personal-compose=
> ;=0D=0A font-family:Arial;=0D=0A        color:windowtext;[EMAIL PROTECTED] 
> Section1=0D=
> =0A     {size:8=2E5in 11=2E0in;=0D=0A   margin:1=2E0in 1=2E25in 1=2E0in 
> 1=2E25in;=
> }=0D=0Adiv=2ESection1=0D=0A     {page:Section1;}=0D=0A-->=0D=0A</style>=0D=0A=
> =0D=0A</head>=0D=0A=0D=0A<body lang=3DEN-US link=3Dblue vlink=3Dpurple>=0D=
> =0A=0D=0A<div class=3DSection1>=0D=0A=0D=0A<p class=3DMsoNormal><font size=
> =3D2 face=3DArial><span style=3D'font-size:10=2E0pt;=0D=0Afont-family:Arial=
> '>I was wondering if anyone has an idea they can share=0D=0Aregarding my sc=
> enario=2E<o:p></o:p></span></font></p>=0D=0A=0D=0A<p class=3DMsoNormal><fon=
> t size=3D2 face=3DArial><span style=3D'font-size:10=2E0pt;=0D=0Afont-family=
> :Arial'><o:p>&nbsp;</o:p></span></font></p>=0D=0A=0D=0A<p class=3DMsoNormal=
> ><font size=3D2 face=3DArial><span style=3D'font-size:10=2E0pt;=0D=0Afont-f=
> amily:Arial'>Currently I have a NAnt script that creates zips of our=0D=0Ab=
> uilds and puts them in a folder=2E I put the build number on the file like =
> so:=0D=0Abuild=2E111=2Ezip, build=2E112=2Ezip, etc=2E This is cool because =
> if we have to go back a=0D=0Acouple of builds, it is easy to do so=2E<o:p><=
> /o:p></span></font></p>=0D=0A=0D=0A<p class=3DMsoNormal><font size=3D2 face=
> =3DArial><span style=3D'font-size:10=2E0pt;=0D=0Afont-family:Arial'><o:p>&n=
> bsp;</o:p></span></font></p>=0D=0A=0D=0A<p class=3DMsoNormal><font size=3D2=
>  face=3DArial><span style=3D'font-size:10=2E0pt;=0D=0Afont-family:Arial'>He=
> re is my question: how could I script in NAnt the deletion=0D=0Aof old buil=
> ds, but keeping <i><span style=3D'font-style:italic'>at least</span></i>=0D=
> =0A5 previous builds=2E Basically, if I have build number &#8220;200&#8221;=
> , I want=0D=0Ato delete all builds &#8220;194&#8221; and below=2E It would =
> turn into a kind of=0D=0Arolling delete=2E<o:p></o:p></span></font></p>=0D=
> =0A=0D=0A<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'fo=
> nt-size:10=2E0pt;=0D=0Afont-family:Arial'><o:p>&nbsp;</o:p></span></font></=
> p>=0D=0A=0D=0A<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=
> =3D'font-size:10=2E0pt;=0D=0Afont-family:Arial'>Any thoughts? Thanks!<o:p><=
> /o:p></span></font></p>=0D=0A=0D=0A<p class=3DMsoNormal><font size=3D2 face=
> =3DArial><span style=3D'font-size:10=2E0pt;=0D=0Afont-family:Arial'>&nbsp;&=
> nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ~Jon<o:p></o:p>=
> </span></font></p>=0D=0A=0D=0A</div>=0D=0A=0D=0A</body>=0D=0A=0D=0A</html>=
> =0D=0A=0D=0A=0D=0A<P><hr size=3D1></P>=0D=0A<P><STRONG>=0D=0AThe contents o=
> f this email are the property of PNC=2E If it was not addressed=0D=0Ato you=
> , you have no legal right to read it=2E If you think you received it in=0D=
> =0Aerror, please notify the sender=2E Do not forward or copy without permis=
> sion=0D=0Aof the sender=2E <br><br>This message may contain an advertisemen=
> t of a=0D=0Aproduct or service and thus may constitute a commercial electro=
> nic mail=0D=0Amessage under US Law=2E  PNC=92s postal address is 249 Fifth =
> Avenue,=0D=0APittsburgh, PA  15222=2E  If you do not wish to receive any ad=
> ditional=0D=0Aadvertising or promotional messages from PNC at this e-mail a=
> ddress, click=0D=0Ahere to Unsubscribe=2E https://pnc=2Em0=2Enet/m/u/pnc/un=
> i/p=2Easp? <br><br>By=0D=0Aunsubscribing to this message, you will be unsub=
> scribed from all=0D=0Aadvertising or promotional messages from PNC=2E Remov=
> ing your e-mail address=0D=0Afrom this mailing list will not affect your su=
> bscription to alerts,=0D=0Ae-newsletters or account servicing e-mails=2E=0D=
> =0A</STRONG></P>=0D=0A</BODY>=0D=0A</HTML>=0D=0A


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Nant-users mailing list
Nant-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to