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

前端 未结 4 1871
陌清茗
陌清茗 2021-02-18 17:51

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

相关标签:
4条回答
  • 2021-02-18 18:26

    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

    0 讨论(0)
  • 2021-02-18 18:33

    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."

    0 讨论(0)
  • 2021-02-18 18:36

    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

    0 讨论(0)
  • 2021-02-18 18:45

    You can do it from your build script or externally.

    0 讨论(0)
提交回复
热议问题