Fail if an artifact doesn't exist on upload

#1

Is there a way to ensure artifacts exists before giving a success to the step? I’d like to avoid [[ -f ARTIFACT ]] checks in the commands area.

We’re doing a tar of a build directory and sometimes that doesn’t work properly. We’d like to avoid it proceeding on if that fails.

0 Likes

#2

Good question! The buildkite-agent artifact download command will through an error if there was no artifact found. Are you not finding that to be the case?

0 Likes

#3

That’s too late in the process for us. Need it to fail immediately on the step that attempts the upload

0 Likes

#4

Oh, I didn’t realize you were referring to artifact uploads. Sorry, I thought you meant downloads.

Are you using the buildkite-agent artifact upload command, or using the artifact_paths in the step’s configuration?

0 Likes

#5

Apologies, you’re absolutely right about that not being clear.

Currently, we’re using artifact_paths: "build.tar.gz"

0 Likes