Build configuration creates multiple artifacts; need to download just one of them based on file pattern match
Pretty desperate here - I'm embarrassed to even tell you the number of hours I have spent on this problem. I have a build configuration which creates three artifacts. I'd like to download just one of these artifacts based on some pattern that exists in the filename. This is what I've tried so far:
http://<server>:<port>/guestAuth/app/rest/builds?locator=buildType:(id:MyBuildConfigID),status:SUCCESS,count:1&fields=build(id,artifact(file(name),$locator(recursive:true,pattern:*.tar.gz)),content)
http://<server>:<port>/guestAuth/downloadArtifacts.html?buildTypeId=MyBuildConfigID&buildId=lastSuccessful&artifactName?locator=pattern:*.zip
http://<server>:<port>/guestAuth/app/rest/builds?locator=buildType:(id:MyBuildConfigID),status:SUCCESS,count:1&fields=build(id,artifacts(file(name),$locator(recursive:true,pattern:*.tar.gz)))
Is this even possible?
Please sign in to leave a comment.
Hi Laura,
If you check the REST API documentation (https://confluence.jetbrains.com/display/TCD18/REST+API#RESTAPI-BuildArtifacts), the request is a bit simpler:
<server_url>/app/rest/builds/<build_locator>/artifacts/content/<pattern>
I've tried passing id:xxx to the build locator and "*.jar" to the <pattern> and it attempts to download (although the pattern has to match exactly one result, not more)
Could you try that?
Denis,
Thank you so much for your help. Using the following URL(identifying info modified):
http://buildserver:port/guestAuth/app/rest/builds/buildType:(id:myBuildId),status:SUCCESS,count:1/artifacts/content/*.tar.gz
I get the contents of the archive downloaded as file with name '_.tar.gz';
I wanted to download the archive by the archive name.
For example, in the xml displayed with URL http://buildserver:port/guestAuth/app/rest/builds/buildType:(id:myBuildId),status:SUCCESS,count:1/artifacts
I'd like to download the artifact "File1.tar.gz" as "File1.tar.gz".
*****************************************************************************