Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

programatically parse bitbucket pipeline log file of previous step

Magnus Kriel
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 13, 2021

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?

1 answer

0 votes
Eduardo Asenjo September 14, 2021

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?

Magnus Kriel
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 15, 2021

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?  

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
atlassian, compass, developer experience, devex, platform engineering, internal developer platform, component catalog, atlassian learning, productivity tools, developer productivity, software architecture, compass webinar, engineering teams

Discover how Compass drives DevEx and productivity at Atlassian 🏃🏻‍♂️

Learn why Compass was built to tackle dev experience at scale. See how Atlassian uses it to boost visibility, reduce cognitive load, and drive consistency—plus tips to get started and customize your IDP for stronger team engagement.

Join the webinar ✨
AUG Leaders

Atlassian Community Events