1

I have having trouble download artifacts from TeamCity. On TeamCity's confluence page it says to use

/repository/download/BUILD_TYPE_EXT_ID/.lastFinished/ARTIFACT_PATH
/repository/download/BUILD_TYPE_EXT_ID/.lastSuccessful/ARTIFACT_PATH
/repository/download/BUILD_TYPE_EXT_ID/.lastPinned/ARTIFACT_PATH

to download the artifacts. However I would always get a 404 page not found. For example, if I look at the url bar for the artifact that I wish to download on TeamCity

https://teamcity.MyServer.com/viewLog.html?buildId=12345&buildTypeId=MyProjectName&tab=artifacts

And then I fill out the REST API call according to that confluence page

https://teamcity.MyServer.com/repository/download/MyProjectName/.lastSuccessful/12345

I would always get a 404 Page Not Found. And just for sanity check I have also tried

https://teamcity.MyServer.com/httpAuth/repository/download/MyProjectName/.lastFinished/artifact_folder.zip
https://teamcity.MyServer.com/httpAuth/repository/download/MyProjectName/.lastFinished/artifact_folder
https://teamcity.MyServer.com/httpAuth/repository/download/MyProjectName/.lastFinished/httpAuth/app/rest/builds/id:1234/artifacts/children/artifact_folder/v0.1.3

but none them it works.

When I shorten the url to

https://teamcity.MyServer.com/repository/download/MyProjectName

I can see a page of url links, however when I click on any of them I would get a ERR_CONNECTION_TIMED_OUT, This site can’t be reached

I am currently using How do you programatically download the artifacts from the latest Team City build using C#? to download the artifacts, but I feel like the official documented way should work.

So how do I make /repository/download/ work?

cli2
  • 239
  • 1
  • 5
  • 12

1 Answers1

0

ARTIFACT_PATH is a path to a file and not to a folder. So the correct URL will be: https://teamcity.MyServer.com/httpAuth/repository/download/MyProjectName/.lastFinished/ARTIFACT_PATH

For example, if on Artifacts tab you see the following structure "t100/generic/test.log", then ARTIFACT_PATH is t100/generic/test.log

kt_
  • 74
  • 5