How can I copy the artifacts from Teamcity to another server?

扶醉桌前 提交于 2019-12-12 08:21:18

问题


how can I copy the artifacts from Teamcity to another server? Thanks


回答1:


You can do it from your build script or externally.




回答2:


The way I have done this, make things a lot easier.. Setup another configuration that pulls in, via artifact dependencies, all the files you need then run a cmd script to xcopy/copy the files to another drive on the network. You can do this using cmd script, vbs, python, shell etc..

  • Remember, you only need to refer to directories as if they were local as you would have your script in the same working directory

i.e cmd script :: xcopy .\"my build artifact(s)" \path\to\drive\on\my\network\"my build artifacts"

It doesn't get easier than that.

Naturally, if your artifacts are huge, then you may want to consider your more complicated option. However, TeamCity currently have a ticket pending, which you can vote on, that allows you to run multiple runners in one configuration - so you could just add your cmd script to the same configuration to save the copy time; please vote if can spare a minute:

http://youtrack.jetbrains.net/issue/TW-3660




回答3:


There is a Deployer plugin, that supports deploy by fileshare/SMB, FTP, SSH and other means. The usage is basically the same as the Artifact paths.

We have used just samba, so you must enter:

  • target Host path: //server/drive/myfolder
  • Username: mydomain\myusername - in our case we had to write domain here too
  • Password: ****
  • Domain: mydomain

and in path just select the files as in artifacts:

product/* => product.zip

and it will create file //server/drive/myfolder/product.zip




回答4:


If you are looking to get artifacts copied from a remote build agent to the primary TeamCity server, you may want to look into configuring Build Artifacts under the General Settings.

According to TeamCity's wiki entry on BuildArtifacts (http://confluence.jetbrains.com/display/TCD7/Build+Artifact) "Upon build finish, TeamCity searches for artifacts in the build's checkout directory according to the specified artifact patterns. Matching files are then uploaded ("published") to the TeamCity server, where they become available for download through the web UI or can be used in other builds using artifact dependencies."



来源:https://stackoverflow.com/questions/2545677/how-can-i-copy-the-artifacts-from-teamcity-to-another-server

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