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?

0

1 Answer 1

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.

3
  • 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, 2011 at 18:50
  • @brandogs = you need to include the username and password in the url
    – redsquare
    Jan 13, 2011 at 11:04
  • 2
    e.g http://<username>:<password>@<teamcity_server>:1000/httpAuth/ see confluence.jetbrains.net/display/TCD6/Accessing+Server+by+HTTP
    – redsquare
    Jan 13, 2011 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.