TeamCity, how to get names of the files edited

北城余情 提交于 2019-12-03 12:05:51

To get the names of the files changed this is what I did. Thanks to Sam Jones.

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

  1. Add a command line build step
  2. Select Run as Custom Script
  3. Add the script copy "%system.teamcity.build.changedFiles.file%" changelog.txt in script box.

You will get the changes in changelog.txt file in the format specified on this link.

NOTE: teamcity.build.changedFiles.file does not work. You need to use system.teamcity.build.changedFiles.file

It sounds like you want a VCS Trigger that specifies VCS Trigger Rules, so that a build configuration will run when someone makes a change to a particular file. The documentation has some nice examples of how to do this. If you're trying to trigger a build on one particular file, try this:

+:foo/bar.txt

This excludes all files from the trigger rule and then includes bar.txt in the foo directory. Paths are relative to the root of the repository (do not include a preceding slash). If someone modifies foo/bar.txt, the build configuration will be triggered to run.

VCS Trigger Rules also support pattern matching and all sorts of other options. Check out the documentation.

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