Uploading artifacts
A job gets a clean environment. When it finishes, everything it produced goes away — unless it was uploaded as an artifact.
The declarative form is artifact_paths:
steps:
- command: make test
artifact_paths:
- "tmp/junit-*.xml"
- "coverage/**/*"
The imperative form is the agent command, useful when you need to upload part-way through a job or decide what to upload at runtime:
buildkite-agent artifact upload "tmp/junit-*.xml"
The behaviour that surprises people
artifact_paths uploads after the command finishes, whether it passed or
failed.
This is deliberate and it is the entire point. The job you most want files from is the one that broke: its test reports, its screenshots, its logs. If artifacts only survived success, they would be useless for diagnosis.
So a failing test step still gives you the JUnit XML that says which test failed. Rely on this — it is not an accident of implementation.
Glob patterns are matched relative to the working directory, and you can list
several. Be a little careful with breadth: **/* on a large repository uploads
your entire checkout, slowly.
A step declares `artifact_paths: "tmp/junit-*.xml"` and its command exits non-zero. What happens to the matching files?
Sign in to answer and record your progress.