-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Directory copy with file provisioner in windows does not copy files #9060
Comments
Hi @carrickhines thanks for reaching out. Can you please provide a copy of your debug logs
By chance does is the path of I remember seeing a previous issue where a user had issues copying from a mapped drive. Here's the link to that issue #8758 |
Hey @nywilken. I do have a few updates: `
` From: https://www.packer.io/docs/provisioners/file.html "If the source, however, is /foo/ (a trailing slash is present), and the destination is /tmp, then the contents of /foo will be uploaded into /tmp directly." My assumption was that the contents of the source directory would be copied into c:\packages. That is not the behavior I am experiencing. The behavior I see is described in the proceeding file provisioner section of the docs as the following: "If the source is /foo (no trailing slash), and the destination is /tmp, then the contents of /foo on the local machine will be uploaded to /tmp/foo on the remote machine. The foo directory on the remote machine will be created by Packer." In the reproduction steps above, my example does have a trailing slash. I'm ready to chalk this up as a peculiarity in Windows. Perhaps I am also missing something in the documentation. Thoughts? Also, I have updated the repo steps to fit the output provided. |
@carrickhines thanks for the update - super helpful. This looks like a bug for sure. In reading the code I see that on Windows it is checking to see if the path ends with a Unix style path separator
Below are the results of my testing using the following config
|
Based on this comment on #9386, it seems the resolution for this issue is to update the documentation to explicitly state you need a trailing forward slash, regardless of OS. |
Overview of the Issue
When using the file provisioner in windows, the file provisoner does not copy files.
Reproduction Steps
Packer version
From
1.5.5
Simplified Packer Buildfile
The file provisioner above is really the only thing required.
Operating system and Environment details
Windows, Azure, Azure Devops build pipeline
Log Fragments and crash.log files
The log shows the copy successfully completing but the files are not present in the destination directory.
The text was updated successfully, but these errors were encountered: