Hi Gerke,
  So far I've just manually deleted things and then just run the build
again. But if your using a continuous integration tool to publish the
artifacts, I see how it would be nice to have it automated somehow. I
wrote a quick ant target to do this for one project (see below).  It
just get's the latest version, and then deletes all folders but that
version. If you had several modules, I guess you'd need to call a
parent build that called subant for this task on each module. I'm
still not sure when this would get run. I guess manually when you feel
the repository has gotten to large. Any thoughts?

<target name="clean-int" depends="load-ivy"
        description="--> cleans the integration repository for the current 
module">
        <ivy:info file="${ivy.file}" />
        <ivy:info property="lastbuild" organisation="${ivy.organisation}"
module="${ivy.module}" revision="latest.integration"/>
        <echo>Deleteing all but revision ${lastbuild.revision}</echo>

        <delete includeemptydirs="true">
                <fileset 
dir="${ivy.local.default.root}/${lastbuild.organisation}/${lastbuild.module}">
                        <exclude name="${lastbuild.revision}/**" />
                </fileset>
        </delete>
</target>

On Mon, Sep 6, 2010 at 8:10 AM, Gerke Ephorus <gerke.epho...@gmail.com> wrote:
>  Hi list readers,
>
> I have an Ivy repository and according to this:
> http://ant.apache.org/ivy/history/latest-milestone/bestpractices.html
> section "Dealing with integration versions", I'm using a timestamp link name
> in the artifact name to store the latest.integration. Now the repository is
> very big (almost 50G) and I probably need a "cleaning script" as also
> suggested in the above mentioned section.
>
> My question is: does any one use this strategy and if so: does (that ;-)
> )anyone know of a script that will clean-up my repository? (leaving in it:
> only the newest artifacts and the release-builds that have a different file
> name pattern)
>
> with kind regards,
> Gerke
>
>

Reply via email to