开发者

Teamcity artifacts to SVN

We pinned builds that get deployd to production. Is there an easy, automated way to upload the artifacts of p开发者_如何学编程inned builds to a svn repository?


Note : Versionning artifacts doesn't seem to be a good practice. If your source is managed by a VCS, you're already able to rebuild your system at any previous state, from past revisions. Moreover, for practical reasons, TeamCity already keeps a recent history of your artifacts, so you can access them\deploy them quickly.

Back to your question : I can't see any good way to achieve what your asking for. Two ideas though:

  • Pushing artifacts to your SVN repo is quite straightforward from your build script ; you just need to create a task that commit files to your repo. If at this stage you have enough context to know if the build must be pinned, you can trigger the commit.

  • TeamCity offers a nice REST API. From any automated job/script/program, you can query your build server to get the "pin status" of any build:

    Get current pin status: GET http://teamcity:8111/httpAuth/app/rest/builds/<buildLocator>/pin/ (returns "true" or "false" text)

    Once you get the status of the build, you can download and commit your artifacts.

Again, the whole process seems awkward to me.


TeamCity acts as an Ivy repository. So, the need to put things into SVN is somewhat less attractive. You just back it up and you have your build script use it as a repository.

Alternatively you can create a build configuration with an artifact dependency on the "last pinned" build of your project.

You can either trigger it AS your build, or as a dependency of your build, you can just use a timer.

You can make it run an Ant script that does the SVN uploading. , you may need to check via your build script to see if this is a new pinned build or an old one.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜