Get Build artifacts from a custom path using teamcity RESTAPI
Hi,
My build artifacts are getting stored in
<property name="runParam.teamcity.build.workingDir" value="/mnt/share/Builds/"/>
How do i give the path for downloading or listing the artifacts in the above directory
Please sign in to leave a comment.
Hi,
I'm not sure I understand your question. What artifacts are you storing there? Are they stored there via your build process? TeamCity doesn't store them like that: https://confluence.jetbrains.com/display/TCD10/Build+Artifact
If you are additionally storing them there during the build script, teamcity is probably not aware that they exist and thus it's unlikely they can be retrieved from the REST API.
If you could shed some light into how you deal with artifacts and what you mean that the artifacts "are stored" in that parameter's configuration, I might be able to help further.
Hi,
The artifacts by which I mean installer files create by ant/maven builds are not stored in the sever. They get moved to a mount path . Now i want to retrieve the mount path and also be able to download the artifact from the mount path.
Is there a provision to do so.
Hope my query is more clear.
Hi Sairam,
TeamCity can only provide artifacts that are marked as such in TeamCity. In order to do that, you need to configure them in the Build configuration - Build Settings as "Artifact paths". This paths *must* be relative to the build directory, cannot be absolute paths. If you move your artifacts during your build to some path instead, you will need to gather them from that path by yourself, teamcity is unaware of the existance of those artifacts and thus cannot provide access to them. Also keep in mind that build processes are run in build agents, not the server, so you will need to make sure that you access the right machine where the agent is running.
If you do have them defined as "Artifact paths", then the artifacts are indeed pushed to the server (automatically by TeamCity), and you can use the REST API to pick them up normally, but they will not be on that path on the server.
Hope this helps.
Thanks for the reply.
This clarifies my question.
All I have to do now is give the artifact path relative to the Build path with patttern such that Teamcity can publish the artifact to the server and I can download using the API