开发者

connect to teamcity from java and download a build

I've been googling how to connect to a TeamCity server and download a specific .war file. No luck.

I'm writing an application that needs to connect to TeamCity, download a war file, upload it to a server and some other stuff.

I can't figure out the TeamCity thing. Any suggestion开发者_高级运维s?


You can do this with artifacts in TeamCity. For example you add the following artifact path to your configuration: src\YourProject\bin\Release\* => YourBuild.zip

This will pack all files located in this folder in the zip file. See this blog post for more examples.

The zip file itself is then available for download e.g. http://localhost:8080/repository/download/bt6/180:id/YourBuild.zip

To get the proper IDs (here bt6 and 180) for your download link you can use TeamCity's REST API.


Here is the official documentation how to download build artifacts from TeamCity server. Commons HTTP client is known to work well. You need to authorize or to enable public access to your artifacts (see more on this).

Hope this helps, KIR

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜