2

In TeamCity, is there any way to pull all the pinned artifacts from a Build Configuration rather than just the last pinned build?

EDIT: Thanks to redsquares advice, I am attempting to solve this problem using the REST API with Nant.

I have changed from getting the pinned builds, to builds with specific tags, as this allows me to configure multiple lists if needed.

I thought I could just use the get task in Nant as follows and then follow that with the xmlpeek task to gather the information from the xml file:

<get dest="tagged.xml" src="http://<teamcity_server>:1000/httpAuth/app/rest/buildTypes/id:bt103/builds?tag=release">
    <proxy host="<teamcity_server>" port="1000">
        <credentials username="uid" password="pwd"/>
    </proxy>
</get>

I am positive the uid and pwd are correct. Despite this I keep getting the following error:

Unable to download 'http://<teamcity_server>:1000/httpAuth/app/rest
/buildTypes/id:bt101/builds?tag=release' to 'H:\<path>\tagged.xml'.
    The remote server returned an error: (401) Unauthorized.

Is the Proxy task configured incorrectly?

brandogs
  • 829
  • 7
  • 14

1 Answers1

19

In teamcity 6 you can use the rest API to grab the artifacts for a project.

You could write a powershell script to connect to the rest api and get all pinned builds then download the artifacts for those builds.

More info and options here.

redsquare
  • 78,161
  • 20
  • 151
  • 159
  • This is very helpful, redsquare! Thanks! I am try to use the REST API with Nant to pull out this data. I am currently encountering an authentication error. I will edit my original post with the info. – brandogs Jan 12 '11 at 18:50
  • @brandogs = you need to include the username and password in the url – redsquare Jan 13 '11 at 11:04
  • 2
    e.g http://:@:1000/httpAuth/ see http://confluence.jetbrains.net/display/TCD6/Accessing+Server+by+HTTP – redsquare Jan 13 '11 at 11:05