SSH Upload Folders
Hey!
I'm totally failing to upload artifact folders via SSH. No matter what "Paths to sources" patterns I use, only files are transferred via SSH.
Not even +:**/* is working.
Does someone have an idea? Thanks!
Please sign in to leave a comment.
Hello Anton,
What is the structure of the artifacts in this build? What directory do you want to upload? If you want to upload all files into the directory, you can use the following Paths to sources: +:**/* => target_directory.
Hello Alina,
thank you for your response!
Unfortunately the problem persists. I have some .jars/.wars and javadoc folders(w/ many htmls) among the artifacts; everything is uploaded except for the folders – even with your pattern.
Could you please attach screenshot of the build step settings and full build log?
I am facing the same problem. I would like to upload a folder containing several subfolders and files as it is (i.e. recursively) to the given target dir. So assume the following setup:
Then I want to see after the upload the following files on "somehost" (with the directory structure preserved):
However, for me the folder is completely ignored. When I try to upload single files everything works as expected.
How can I achieve this behavior?
Hi Johannes,
If you set "folder1" as the paths to sources, you will copy the *contents* of folder 1 (although subfolder should be copied as is, with its content). If you want it to hang from "folder1" on its target, you should basically add "folder1 => folder1" as the paths to sources. This should create folder1 on the target and copy the contents of folder1 to the target recursively.
We had the same issue. To be more precise with the following local file structure:
```
path/
to/
folder/
file1.txt
subfolder/
file2.txt
```
and the following upload pattern:
```
path/to/folder/* => some-folder/
```
only `file1.txt` would be copied, `subfolder` wouldn't be:
```
some-folder/
file1.txt
```
I think this is a bug.
I tried a bunch of patterns and ended up with one that worked:
```
path/to/folder => some-folder
```
this did the expected thing and ended up with
```
some-folder/
file1.txt
subfolder/
file2.txt
```