I put in a PR here that already supports this with my rationale: Directory artifact paths by jsoo1 · Pull Request #1571 · buildkite/agent · GitHub
(Sorry I did not think to put in a feature request here first)
To summarize my thoughts from the github issue and PR, there are two big user experience reasons the artifact_paths
field should accept directories as well as glob patterns.
- Principle of least surprise. If
artifact_paths
contains some directory, it is very surprising when the contents of the directory are not uploaded, nor tried. - Using
$BUILDKITE_ARTIFACT_PATHS
in scripts with only glob paths makes some uses impossible. In particular, it is because you can’t unambiguously un-glob a string in bash. For instance,make prefix=$BUILDKITE_ARTIFACT_PATHS
will simply never work unless directories can be inartifact_paths
.