I was wondering if Bitbucket pipelines has a mechanism to parse the log file of the previous step?
I have situations where the log file generated from my build step contains warning messages which is not a hard fail but would like the catch the warning messages by searching for known specific warning messages and fail the build step if found.
Is this possible?
As workaround. If you're the one running specific commands, you can always prepare the ground for that.
In your own commands with warnings you can store that information in a log file or similar, in a particular folder. Then in that particular step use `artifacts` to keep those files available to download or any step that is coming after.
Reuse those artifact files to read them and identify if inside them you've any of those 'warning' or the flag that you used.
Would that work for you?
Almost. The commands used is the python coverage command which runs unit tests etc. If I can somehow pipe the stdout to a file while the command is running, I can then use the log file as an artifact as you mentioned.
Is it possible to pipe (split) the output of a command to a file without disrupting the standard flow of stdout/stderror?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.