cschlosser / drone-ftps

Deploy to FTPS server from Drone CI build
https://hub.docker.com/r/cschlosser/drone-ftps/
Apache License 2.0
20 stars 16 forks source link

Include option to upload only new files #13

Closed cschlosser closed 1 year ago

cschlosser commented 6 years ago

Add only_newer option.

Use like this:

pipeline:
  deploy:
    image: cschlosser/drone-ftps
    hostname: example.com:21
    secrets: [ ftp_username, ftp_password ]
    only_newer: true

This should fix #12

SGTGunner commented 5 years ago

No, neither option worked. It still copies all files.

cschlosser commented 5 years ago

Maybe you could give it a try?

SGTGunner commented 5 years ago

I tried the -e option as well and no luck.

cschlosser commented 5 years ago

Do you have any other idea?

SGTGunner commented 5 years ago

Humm, a couple of things to consider perhaps. I notice that you did not use all the flags? There is an issue around the timezone that could also be a problem. There is an option of --ignore-time which may help with that.

cschlosser commented 5 years ago

I used all the flags. The -R was there before already but maybe it needs to be in this order so I added it twice. Also added the ignore time option

SGTGunner commented 5 years ago

Sorry, for the delay. Do I still use the -e in the only_newer: option?

cschlosser commented 5 years ago

The only_newer: true results in -Rne --ignore-time to be added to the string

hussainb commented 4 years ago

I might be late to this post but I was looking at using drone to deploy php projects which do not require a build and only the changed files to be updated using FTP. This plugin fits the purpose if the only-newer flag works. by looking at the conversation above, I was just wondering how lftp detects which files are new or modified, maybe by the date-time?

upon reading the drone docs, drone creates a temporary directory and clones the repo which means all the files are always newly created in every build, so can this be the reason that lftp might be uploading all the files again?

cschlosser commented 4 years ago

Thanks for the suggestion @hussainb ,

Yes, lftp uses the timestamp of the files to detect what changed. A git clone keeps the timestamps correctly in sync with the remote repository. This is not the cause of the problem.

hussainb commented 4 years ago

Didn't know that! Thanks!

josevavia commented 3 years ago

If I can help to anyone with my experience, I was able to get this working using -Rn --ignore-time

The -e was not helpful in my case, because in remote server there are generated file that I dont want to delete in each deploy

morvy commented 2 years ago

just tried this PR and I nearly collapsed as after uploading all the files it started with deleting of my whole FTP :D this PR ignored my PLUGIN_DEST_DIR and used root. Or does "latest" use PLUGIN_DEST_DIR while "only-newer" uses dest_dir ?

cschlosser commented 2 years ago

This branch is quite out of date. Did you merge it with master?

morvy commented 2 years ago

I only used .drone.yml with cschlosser/drone-ftps:only-newer .. would be really nice if it worked. Later I found out the FTP was nearly fully deleted but I had a backup so no data loss :)

cschlosser commented 2 years ago

The example configuration from the master readme no longer matches this branch. I may be able to take a look at this in the next few days but we had problems getting this to work reliably so I'm not too hopeful right now.

cschlosser commented 1 year ago

Should be included in #31, hopefully.