Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support directories in artifact_paths #1570

Open
jsoo1 opened this issue Mar 2, 2022 · 0 comments · May be fixed by #1571
Open

Support directories in artifact_paths #1570

jsoo1 opened this issue Mar 2, 2022 · 0 comments · May be fixed by #1571

Comments

@jsoo1
Copy link

jsoo1 commented Mar 2, 2022

Suppose I want to upload all contents of a directory foo/bar. I would love to specify artifact paths like this:

artifact_paths:
  - foo/bar

I would expect this to be treated the same as foo/bar/*. But actually no artifacts are uploaded, even if the directory exists and is non-empty. This is further complicated by the name of the variable/key. The problem is thatartifact_paths are not paths, they are patterns. It is even more confusing that they do not support directories which are paths!

Suppose I have a command step that wants to create one directory from $BUILDKITE_ARTIFACT_PATHS if it doesn't exist. How would I go about it without first-class directory support?

Well, let's try the common shell script and assume we have the following glob pattern configured:

artifact_paths:
  - foo/**/*

In our command:

# Try to create directory foo
mkdir $BUILDKITE_ARTIFACTS_PATHS

... oops, now we created a directory called foo/**/*, what I really wanted was to create a directory called foo and put all my artifacts in that directory.

This is even more confusing as a user because of the existence of nullglob, dotglob and the other variety of shell options. Maybe we should all stop using shell scripts (I don't disagree). But I think for now, it would be better to support directories in artifact_paths.

Describe the solution you'd like
If a path foo is specified in artifact_paths and it is a directory that exists, it should be treated like foo/* during the upload step.

Edit: I think the directory should be treated like foo/**/*

@jsoo1 jsoo1 linked a pull request Mar 11, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant