Collect artifacts when timeout

Hi BK Community,

We have a soft-fail step where we would like to collect all artifacts when it finished (or failed). Right now, we are using artifact_paths.

However, when a timeout occurred on that step, it seems that artifacts are not being collected. Is there a good solution to collect them even when timeout happened?

Hi @dyrock :wave:

Welcome to the community! The artifact_paths parameter in the command step is designed to automatically upload artifacts in the paths configured when the command step finishes running - if there is a timeout mid-execution, the artifacts won’t get uploaded.

You could have your build scripts upload your artifacts using the buildkite-agent artifact upload command so that the artifacts are uploaded to your artifact storage as soon as they are written, or at the very least give you more control in the script when the artifact is being uploaded.

Hope that helps!

Cheers,
Jeremy