0

We're using TeamCity 9 on Ubunutu system. I want to copy the the artifacts published in the build to a directory (defined in Apache config as virtual directory) so that our application would get deployed.

Currently, our artifacts are being published in root/.BuildServer/system/artifacts/repo_name/build_name/some_number/some_hash_value directory.

I want to copy it to, let's say, \home\ubuntu\repo_name directory.

How should I do it?

Vishwajeet Vatharkar
  • 1,146
  • 4
  • 18
  • 42
  • Is some_number and some_hash_value available during the build? – Mattias May 06 '15 at 04:42
  • @Mattias : No! some_number is being incremented by 2 after every build. – Vishwajeet Vatharkar May 06 '15 at 04:59
  • 1
    @Mattias : I solved the problem by doing this. `cp -R -f %teamcity.build.workingDir% /home/ubuntu/repo_name` It is now creating or copying into a directory with name `some_hash_value` in the `repo_name` folder. The `some_hash_value` is not changing, irrespective of build numbers (or builds) , so far, so good. Is this a correct way? – Vishwajeet Vatharkar May 06 '15 at 05:09

2 Answers2

0

You can do it in 2 ways

  1. cp -R -f %teamcity.build.workingDir%/* /home/ubuntu/repo_name/

  2. Create a vcs checkout rule in your build target of the form .+:=>custom_name.This checks out VCS contents into a directory named custom_name.Then you can copy it using this command

cp -R -f %teamcity.build.workingDir%/custom_name /home/ubuntu/repo_name/

In case you only want to copy the artefacts, you can generate all your artefacts in one sub-directory under the build directory and copy files from that direcotry to the target directory

Biswajit_86
  • 3,661
  • 2
  • 22
  • 36
0

How about setting artifact path explicitly in the build configuration? You can read more here: https://confluence.jetbrains.com/display/TCD9/Configuring+General+Settings#ConfiguringGeneralSettings-ArtifactPaths

Krzysztof Wolny
  • 10,576
  • 4
  • 34
  • 46