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_pathscontains some directory, it is very surprising when the contents of the directory are not uploaded, nor tried.
$BUILDKITE_ARTIFACT_PATHSin 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_PATHSwill simply never work unless directories can be in