Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,298,232
Community Members
 
Community Events
165
Community Groups

programatically parse bitbucket pipeline log file of previous step

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

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?  

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,225 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you