You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Gerke Ephorus <ge...@gmail.com> on 2010/09/06 14:10:55 UTC

Ivy housekeeping, repository cleaning

  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


Re: Ivy housekeeping, repository cleaning

Posted by Chris Marks <to...@gmail.com>.
Not sure what Maven repository you're using, but Artifactory provides the
ability to remove jars after a certain time of not being requested.  We keep
all of our internal builds, but we use this for third party binaries.
Hope this helps

Thanks

On Sep 6, 2010 8:18 AM, "Steve Miller" <st...@millerland.com> wrote:

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 <ge...@gmail.com>
wrote:
>  Hi list readers,
...

Re: Ivy housekeeping, repository cleaning

Posted by Steve Miller <st...@millerland.com>.
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 <ge...@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
>
>