Using regex to fail a build if there are warnings.
I have a build configuration that I have added a fail condition on this regex. \[+[0-9]{2}+:+[0-9]{2}+:[0-9]{2}+\]+W+:
When I download the build log as text, if there is a build warning it will contain a timestamp something like "[21:00:17]W:" When I run the build, the fail condition is not being caught. I think the regex is correct, is there something I'm missing?
Please sign in to leave a comment.
Hi,
Is the timestamp the one that you see on the build log or does your build script also produce their own timestamps? While downloading the build log does show that timestamp and message, that's the full text representation of the log, they aren't stored like that really, so TeamCity's own timestamp is not considered as part of the log.
Yes, I'm referencing the timestamp supplied by Team City. I did see on the regex step that it says this timestamp will be ignored. We are trying to keep our Team City builds clean and it would be really great if we could add a fail condition if there are any warnings on any step in the log. I know there are ways to do this with command line and Powershell steps, but some of the steps like Publish don't have a configuration for this. I was trying to find a more global solution using the regex, and even was trying to find a way to copy the build log to the server for parsing.