TeamCity how to edit file names

I use TeamCity and I am new to this. I added the build configuration to TeamCity, and I created one VCS root to attach to it.

However, my project has a special requirement for detecting a specific file that has been modified at the root location of the VCS, and use this file in the build phase. I am sure that this can be done in TeamCity, I can’t understand how to do it.

Any help? Thanks,

+8
version-control teamcity
source share
2 answers

To change the file names, this is what I did. Thanks to Sam Jones.

I used the System.TeamCity.build.changedFiles.file variable as follows.

  • Add command line build step
  • Select Run As Custom Script
  • Add script copy "%system.teamcity.build.changedFiles.file%" changelog.txt to the script field.

You will receive changes to the changelog.txt file in the format indicated on this link .

NOTE. teamcity.build.changedFiles.file does not work. You need to use System.TeamCity.build.changedFiles.file

+16
source share

It looks like you want the VCS trigger to set the rules for the VCS trigger, so the build configuration will be executed when someone makes changes to a specific file. The documentation has some good examples of how to do this. If you are trying to invoke an assembly in one specific file, try the following:

 +:foo/bar.txt 

This excludes all files from the trigger rule, and then includes bar.txt in the foo directory. The paths refer to the root of the repository (do not include the previous slash). If someone modifies foo / bar.txt, the build configuration will start.

VCS trigger rules also support pattern matching and all sorts of other parameters. Check the documentation.

+2
source share

All Articles