Ivy repository

Hi,

I had a look at the instructions of how to set up build dependencies using ivy instead of the built-in dependency manager.
It's nice that Teamcity acts as an Ivy repository. But it's using the build configuration ids (bt8, etc) as the module name.

We have the requirement that ant based buildscripts should also run locally on a developper's pc. This means that we would like to have one repository for storing artifacts, accessible through ivy from any machine or teamcity. However, due to these build configuration id's used in the Ivy repository on the Teamcity server, I see no other solution than to hardcode the module -> btxx mappings in an ant proprty file.

Can I configure Teamcity to use an external ivy repository with a different setup (I want to use project names instead of btxx) ?
Can I somehow download build artifacts from ant without using the build configuration id ?


For the local ant buildscripts, I would like to first use a filesystem resolver and see if the artifact is there in a conventional location. Only if not, it should be retrieved from the repository. This way a developer can checkout the components he will be working on, run the build script for them, and work with these sources, while ivy takes care of downloading all the other depencies.

I already had this for ivyconf.xml

<ivysettings>
<property name='ivy.checksums' value=''/>
<property name='repository' value='http://172.16.35.127:8111/repository'/>
<target name="setPropertiesTeamcity" if="teamcity.version">
    <property name="ivy.cachedir" value="${teamcity.build.tempDir}/.ivy/cache" />
</target>
<target name="setPropertiesLocal" unless="teamcity.version">
    <property name="ivy.cachedir" value="${build}/ivy-cache" />
</target>
<caches defaultCache="${ivy.cachedir}"/>
<statuses>
    <status name='integration' integration='true'/>
</statuses>
<resolvers>
   <chain name="chainresolver" returnFirst="true">
        <filesystem name='local-rep'>
            <artifact pattern="${basedir}/../build/dist/[artifact](.[ext])?" />
        </filesystem>
  
        <url name='teamcity-rep' alwaysCheckExactRevision='yes' checkmodified='true'>
            <ivy pattern='${repository}/download/[module]/[revision]/teamcity-ivy.xml?guest=1' />
            <artifact pattern='${repository}/download/[module]/[revision]/[artifact](.[ext])?guest=1' />
        </url>
    </chain>
</resolvers>
<modules>
    <module organisation='.*' name='.*' matcher='regexp' resolver='chainresolver' />
</modules>
</ivysettings>


Does anyone have a solution ?

Jeroen

4 comments
Comment actions Permalink

Without Ivy artifacts can be downloaded by build configuration full name, i.e. <project name>::<build conf name>, however this does not work with Ivy because it tries to create files with :: in their names. Take a look here for more details on how to download artifacts from the script: http://www.jetbrains.net/confluence/display/TCD4/Patterns+For+Accessing+Build+Artifacts

If you are using Ivy on Unix like system you can try to use fullname too. We also have a request in our tracker to allow to use human readable (and editable) codes instead of build configuration ids: http://jetbrains.net/tracker/issue/TW-2895

--
Pavel Sher

0
Comment actions Permalink

Thanks for the reply.
I already had a look at the patterns for accessing build artifacts but all of them require the Build configuration id. But I don't find any reference to using fullnames.
"If you are using Ivy on Unix like system you can try to use fullname too." -> Could you clarify what you mean by this ?. We are running on Linux so...

Also, the request for humon readable build id would suit us as well. I would define a build configuration per branch on a project, give them the unique id "<projectname>-<branch>" and I would be able to make the urls for ant. I hope it would be included soon.

Jeroen

0
Comment actions Permalink

In the section "Obtaining artifacts" you can read:
BUILD_TYPE_ID is a build configuration ID or build configuration full name, i.e. <project name>::<build conf name>

so it is possible to download artifacts using URLs like:

/repository/download/your project name::build conf name/.lastFinished/ARTIFACT_PATH


Also you can try to use <project name>::<build conf name> as the module name in the ivy.xml file instead of build configuration id.


--
Pavel Sher

0
Comment actions Permalink

Thanks a lot!
I guess I was looking at v3 of the documentation. This seems to be working.. I can do everything from ant(contrib) without ivy.

Jeroen

0

Please sign in to leave a comment.