TeamCity artifact from lastSuccessful branch build

*爱你&永不变心* 提交于 2019-12-03 11:18:18

I just came across this article.

I plan on giving this a try over the next couple days, and if it works, I will give a brief summary of the result for anyone else who has trouble with this.

EDIT:

Sorry for the delay, just realized that I never came back to report how we resolved this issue.

We ended up upgrading TeamCity (which we should have done anyway, so it wasn't a big deal), and once that was finished, it worked great without much effort. We're now running TeamCity v8.1.5, and here's the URL pattern we're using to pull our artifacts:

http://<build-server>/httpAuth/app/rest/builds/buildType:<build-type>,branch:<branch>/artifacts/content/<artifact-path>

NOTE: We're using the httpAuth API in order to authorize access to our build artifacts, so we also had to create a new TeamCity user for our deployments.

From the linked page adding the QueryString param worked for me:

?branch=<branch_name>

Without this it only downloads artifacts from default branch.

Our full url:

http://<buildserver>/repository/downloadAll/<BuildId>/.lastFinished?branch=<branchname>

Which will download latest build from branch 'branchname' on the 'buildid' config.

You can construct the URL as follows:

http://<TeamCity-Server>/guestAuth/repository/download/<BUILD_TYPE_ID>/<BUILD_NUMBER>/<ARTIFACT_PATH>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!