0

Is there anyway in Teamcity where you can fail a build because the changes/files contain characters or words that are not accepted?

i.e.

In Javascript files I'd want console.log to never end up at release/production level and want the build to fail if this exists anywhere to prevent this from happening.

r0bb077
  • 732
  • 2
  • 11
  • 33
  • Establishing what files have changed is a version control activity, so this might be achievable using the script runner and commands for your version control system. What VCS are you using? – Nanhydrin Sep 18 '18 at 08:57
  • I'm currently using git – r0bb077 Sep 18 '18 at 11:32
  • I don't use git so I can't offer any detailed help. I'm sure there must be some fairly standard command that searches the text of commits, `git log` presumably. The problem you may encounter with this is that if you're not building literally every commit, and you're only building say the last commit from a bunch, then it might be difficult in TeamCity to identify all the previous new commits and search them. It may be easier to take TeamCity out of the equation altogether and use git commit hooks to prevent the commits in the first place, either at client side or server side. – Nanhydrin Sep 18 '18 at 13:02

0 Answers0