google-storage-plugin icon indicating copy to clipboard operation
google-storage-plugin copied to clipboard

No way to download everything including subfolders into workspace

Open g-ericso opened this issue 7 years ago • 4 comments

I am having trouble to download everything under a bucket with subfolders.

gsutil cp -r does not work in this case.

g-ericso avatar Jun 28 '18 21:06 g-ericso

I'm sorry, I don't completely understand your use case. Are you using the Jenkins Storage plugin? Classic or pipeline? Where does "gsutil -r" come in?

In the docs for the Download Step, it points out that in Objects to Download:

Currently only a single asterisk at the lowest level of the object name is supported.

If you are using gsutil directly, isn't the "-r" option specifically to disable wildcard handling? Do you want to use it without the "-r"? See https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames#directory-by-directory-vs-recursive-wildcards

Does this help? I admit, I may be misunderstanding what you are trying to do.

agoulti avatar Jun 28 '18 21:06 agoulti

I want to download everything in a subfolder under a bucket. I am using Jenkins Cloud Storage plugin.

If I do:

gs://.../*

which only downloads all files under the specific directory but not the files inside subdirectory.

I cannot do:

  • gs://.../**/*
  • gs://.../**

I don't have any solution except putting all subdirectories into a different sections.

g-ericso avatar Jun 28 '18 21:06 g-ericso

Yes, if you are using gsutil you would do gs://.../** Unfortunately the plugin does not yet support this syntax.

This sounds like a feature request to implement support for the double asterisk. It would be great to support it! Unfortunately, I don't have time to jump on it.

I will leave this open and will gladly review a PR if anyone wants to send one.

agoulti avatar Jun 28 '18 21:06 agoulti

Any progress on this? I just hit this same problem when trying to download a path and everything in it.

daegalus avatar Apr 16 '21 22:04 daegalus