How to get the path to an artifact in TeamCity?

25 Views Asked by At

I have my own script that takes an artifact from the build machine and sends it to a channel. I just find an .apk file in a specific directory. Is there a way to get the artifact path or just name from TeamCity? PS: I heard about the REST API, but there is no need to download the artifact, I’m trying to send it in messenger.

I'm trying to get the path from TeamCity and I'm expect that someone to help me find a proper way to do this.

1

There are 1 best solutions below

0
Peter Moore On

The physical path is returned from API with where 27356 is your build id:

http://teamcity:8111/app/rest/builds/id:27356/artifactsDirectory

Information on the artifacts themselves are from:

http://teamcity:8111/app/rest/builds/id:27356/artifacts

this will also return a list of file nodes which have download hrefs

<content href="/app/rest/builds/id:27356/artifacts/content/Makefile.bld_log.txt"/>

See the api doc for more details on other methods.