Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Is it possible to retrieve artifacts from "failed' builds?

We're attempting to implement a basic smoke test suite using Pipelines + Cypress. Obviously, we'll want to have access to the video/screenshot artifacts of those runs especially if they fail, but it seems like the artifacts aren't available after a 'failed' step. Is what we're trying possible?

1 answer

1 accepted

1 vote
Answer accepted
Caroline R Atlassian Team Nov 12, 2021

Hi, @Sam Wainwright! Welcome to the community! 

Artifacts are not uploaded for the failed steps. Bitbucket pipelines are configured to stop at any non-zero exit code. That means that the pipeline execution is stopped when cypress fails the tests. Because artifacts are stored after the last step of the pipeline, you won’t have any artifacts.

Bitbucket Pipelines achieves the default behavior of exiting on the first error by prepending your script with the "set -e” bash command. You can "undo” this at any point in your script using the command "set +e”. If you want all the commands in your script to execute regardless of errors then put "set +e” at the top of your script. If you just want to ignore the error for one particular command then put "set +e” before that command and "set -e” after it.

Once the scripts are forcefully successful with the help of the method mentioned above, the artifacts upload part will be executed and they will be available for download later.

I hope this helps, but do let me know if you have any questions. 

Kind regards,

Great, that did the trick. Thanks!

Caroline R Atlassian Team Nov 15, 2021

Hi, Sam! Thanks for your confirmation, I'm glad to know it worked! 

Kind regards,

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

⭐ Calling all Bitbucket and DevOps experts: Special showcase opportunity ⭐

Hi, Bitbucket community! Are you a DevOps practitioner (or know one in your network)? Do you have DevOps tips, tricks, or learnings you'd like to share with the community? If so, we'd love to hea...

1,440 views 4 7
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