How to get all artifacts as zip using TeamCity Rest API?

Docs show it

/repository/downloadAll/BUILD_TYPE_ID/BUILD_SPECIFICATION 

to receive all your artifacts as a zip file, but this does not use the REST API. Is there a way in the REST API to do the same? The docs seem to indicate that repository links exist only for backward compatibility.

+6
source share
3 answers

You can use this url, it works for me:

 http://<TeamcityUrl>/httpAuth/app/rest/builds/id:<BuildId>/artifacts/archived 

I am using TeamCity 9.

+2
source

I am not sure if it is documented, but it works.

 http://teamcity-url/downloadArtifacts.html?buildId=216886 

If you use it from .NET, you can use the following code:

 List<string> downloadedFiles = new RemoteTc() .Connect(a => a.ToHost("tc").AsGuest()) .DownloadArtifacts(123, @"C:\DownloadedArtifacts"); 

The code above uses the FluentTc library

+1
source

From the documentation: http://confluence.jetbrains.net/display/TW/REST+API+Plugin#RESTAPIPlugin-buildartifacts

 Artifacts: GET <TeamcityUrl>/httpAuth/app/rest/builds/<buildLocator>/artifacts/files/<artifact relative name> 

If you download artifacts from the TeamCity assembly, consider using the properties of teamcity.auth.userId / teamcity.auth.password as credentials for the request to download artifacts: in this way TeamCity will be able to record the other artifacts used in the assembly and display it on the tab "Dependencies."

Have you tried this?

0
source

All Articles