Configuring artifact dependency with SVN Revision number

Hello everyone,

We are currently using TeamCity 5.1 and I have setup our project to build with 2 configurations.

1 project is building all the business logic and executing unit tests (NUnit) and the second project is building all the web projects together with the functional tests (Selenium).

Now the first project is generating artifacts that I would like to use in my 2nd project as a dependency.

So I checked the path of the artifact produced by the 1 build configuration:

http://buildserver/repository/download/bt3/12634:id/ReleaseBuild/ProductName.v3.0.9.16429.7z

And used the built-in aliases to access the last successful artifact to by-pass having to know the number:

http://buildserver/repository/download/bt3/.lastSuccessful/ReleaseBuild/ProductName.v3.0.9.16429.7z

So far so good, but after a new build those numbers will change ofcourse. I tried accessing that file using some wildcards:

- http://buildserver/repository/download/bt3/.lastSuccessful/ReleaseBuild/ProductName*.7z

- http://buildserver/repository/download/bt3/.lastSuccessful/ReleaseBuild/*.7z

But nothing is returned. The build only produces 1 artifact and I just want that one to be available in my dependency and it's pissing me off why I cannot simply say: Hey theres an artifact in that directory, just get me it, regardless of its name, or just use a wildcard to access the file. I also looked at using the VCS properties but even if I somehow get the revision number back it still won't give me the 3.0.9 part, and then I still can't access the file name.

It's also very possible that I am going about this the wrong way but for me I am hitting a road block here to use the artifact dependency.

I also tried using downloadAll instead of download and omitting the 7z part, but that produces a zip file where the 7z is contained. But that doesn't help me much since I need the 7z itself.

Anyway even if this is a big user error situation or I simply mis-interpreted the situation I hope if any answer is produced other people will benefit from hitting a similar road block. Thanks everyone for reading this thread and for the time taken.

Best regards,

Joseph Miller

3 comments

Hello Joseph,

You can use artifacts dependency to download specified files from the "source" build. Please refer to http://confluence.jetbrains.net/display/TCD5/Dependent+Build#DependentBuild-ArtifactDependency for details. The path to artifacts can either identify a specific file, or use wildcards.

Otherwise you can download artifacts within your build script packed in a zip archive or use {build.number} as a shortcut to current build number in the artifact file name.

Kind regards,
Marina

0

Thank you Marina for your reply,

However using the wildcards does not seem to work. Otherwise I would have been able to get my artifact using this link right?

http://buildserver/repository/download/bt3/.lastSuccessful/ReleaseBuild/*.7z

This produces an Apache : File Not Found message. So my question would be, how do I get my 7z file using wildcards?

As pointed out in my OP getting the ZIP file that contains my 7z file is working but is not usuable since I need the 7z file itself and not yet another archive wrapping it. Using the {Build.Number} alias is not the correct answer either since that simply returns the build number from TeamCity itself, in our case it would return a number: 1127.

And that number has nothing to do with the revision number produced by SVN.

Again thanks for your time and efforts in creating your reply, it was indeed helpful, but unfortunately it does not solve my issue.

0

Joseph,

I meant using wildcards allowed in Artifacts paths in Artifacts Dependency. Please take a look at http://confluence.jetbrains.net/display/TCD5/5.Dependencies#5.Dependencies-Add%2FEditArtifactDependency.

You can make build configuration dependent on the artifacts or sources of builds of some other build configurations (for example last successful build) so before the build is started to run, all artifacts the builds depends on will be downloaded and placed in their configured target locations and then can be used by the build.

Kind regards,
Marina

0

Please sign in to leave a comment.