How to find artifact path for Rest API(automate artifact downloads)
I've been trying this for a while. So far I am able to download specific build artifacts using:
http://teamcity/guestAuth/repository/download/blah_blah_Main_InstallCreatorForMaster/74479:id/C.Installer_3.6.0-dev.350.exe
However I am trying to build an automation suite. I need to download last successful build and the build number increases(i.e. next build is dev.351)
I have seen/tried numerous ways to do this like:
http://teamcity:8111/app/rest/builds/buildType:<buildTypeId>,branch:default:any,status:success/artifacts/content/<path>
/repository/download/BUILD_TYPE_ID/.lastSuccessful/ARTIFACT_PATH
My question is what is this artifact path? When I go to settings of the branch I want to download the artifact from it reads:
Artifact paths:
However when I append that path to the end of the url I get
404
Artifact does not exist: 'Output/C.Installer_*.exe
Does anyone have any info on this? I've tried just about everything
Please sign in to leave a comment.
What do you get if you just request the following on your build?
<teamcity>/app/rest/builds/buildType:<buildTypeId>,branch:default:any,status:success/artifacts/children
This should return a list of artifacts and the content path to retrieve it. For example:
Then, you can use the full content path appended to your <teamcity server> to download the file. Using the example above, I can download my README.md by using <teamcity server>/app/rest/builds/id:1229/artifacts/content/README.md
Our current documentation on using REST API to work with artifacts can be found here: https://www.jetbrains.com/help/teamcity/rest-api.html#Build-Artifacts