I don't think this is possible at the moment with Ivy.
Please open a JIRA feature request

Maarten




----- Original Message ----
From: Tom Widmer <tom.wid...@googlemail.com>
To: ivy-u...@ant.apache.org
Sent: Tuesday, December 23, 2008 10:50:09 AM
Subject: TeamCity dependency tracking

Hi all,

I'm using a TeamCity build server as an Ivy repository for our build artifacts, 
and it works very well for the job except for tracking dependencies when using 
a varying build version, like 'latest.release'. To fix the problem, I need to 
be able to pass different log in credentials for the ivy.xml files to the 
artifacts. I have a resolver for the repo like this:

<url name="teamcity" latest="latest-time">
            <ivy 
pattern="${teamcity.ivy.repo.root}/[module]::([branch]-)main/[revision]/ivy.xml"
 />
            <artifact 
pattern="${teamcity.ivy.repo.root}/[module]::([branch]-)main/[revision]/[artifact](.[ext])"
 />
        </url>

I have:

<credentials host="build" realm="TeamCity"
      username="${teamcity.auth.userId}"
      passwd="${teamcity.auth.password}"/>

but obviously those credentials are used for both the ivy.xml files and the 
artifacts. Is there any way to specify different credentials for the ivy.xml 
files?


Background:

TeamCity has a cunning system of tracking dependencies between builds by 
providing build-specific TeamCity log in credentials to your ant build script 
in a couple of properties (though Hudson's system of fingerprinting is just as 
cunning, and would avoid the problem I'm having). Anything downloaded with 
those credentials during the build gets logged by TeamCity as a dependency of 
the build. I use this to have automatic tracking of any dependencies that Ivy 
downloads from TeamCity (the TeamCity UI allows you to navigate to dependency 
builds, prevent them being cleaned up automatically, etc.).

So, what's the problem? I recently added a nightly regression testing build 
that always builds against the latest build, using latest.release. 
Unfortunately, this causes the build to download the ivy.xml file from every 
single build that exists on the server in order to work out which is the 
latest. So the regression testing build appears to depend on every single build 
(though you can tell the real build by looking for the build where more than 1 
artifact is a dependency).

I've made it workable by disabling dependency cleanup prevention for that build 
(so at least the regression test doesn't prevent automatic cleanup of old, 
unused builds), but it would still be nice to prevent every single ivy.xml file 
being listed as a dependency! Two possible fixes:

1. Persuade Ivy to download ivy.xml files only using standard credentials, so 
those downloads won't be tracked.
2. Persuade TeamCity to ignore downloads of ivy.xml files using the build 
tracking credentials.

I can't see a way to do 2, but does anyone know how to do 1?

Perhaps this is a feature request - some way to bind credentials to things 
other than just hosts.

Thanks,

Tom


      

Reply via email to