SamKirkland/FTP-Deploy-Action

Uploading all files by default

jcolls opened this issue · 6 comments

For some reason all my files are being updated whether they have changed in github or not.
I added --verbose to check and everything gets deleted then transferred. I thought the default was to now only upload changed files?

I'm using the following ARGS. Would you be able to explain if I have something wrong. I thought I had to have --transfer-all in order to do what it is currently doing.

ARGS: --exclude=.ftpquota --exclude-glob=.git*/** --exclude-glob=.git** --no-empty-dirs --verbose

Many thanks

Hey!

This is a very common question, i'll be adding some documentation to the FAQ to make it more clear in the future.

The FTP spec is very limited and doesn't have the ability to upload differences like rsync.
However a few workarounds exist, by default the script is set to upload any file that has a different last-modified-time or size. However when checking out the latest code git sets the modification time to now, meaning the script see's all files as new. I've been looking into a solution.

To fix this in the meantime you can skip the time comparison and only do a file size comparison. Files will only be uploaded if the file size is different, this has one caveat. If the file was modified but the file size remained the same the file won't be uploaded.

To ignore times add --ignore-time to your ARGS

Thanks Sam for the response and the explanation.

I was initially worried about the time it takes to do an upload as I had the assumption that all the files were being deleted and then being uploaded. However, after looking at the process, using the verbose mode, I can see that the files are deleted and uploaded individually which means that there is very little 'downtime' during the transfer.

I will leave the setup as is as I do not want to risk missing uploads with --ignore-time and hope that your investigations come up with a solution to save a bit of bandwidth and processing time.

Hey Sam. Wondering if there was a fix for this?

Thanks

The solution for now has been to add --ignore-time to your ARGS
I've been working on a long term solution but the ftp library this action is using must change to resolve this issue :(

Misiu commented

@SamKirkland so you must change the library or are you waiting for changes in library you are using?
If the second option, then could you post the link to the issue in that library? we will be able to monitor it.
In my case, it takes about 4 minutes to upload files to FTP on Azure.

Zenoo commented

Yeah, I've been using --ignore-time for a while too, but every now and then, it causes an issue when a file that has been modified still kept the same size.

So ... if there is another solution for this ...