SamKirkland / ftp-deploy

Deploy websites over FTP with one command line
MIT License
89 stars 43 forks source link

Implementing selective FTP deploy to deploy only changed files #31

Closed Himato closed 1 year ago

Himato commented 1 year ago

Currently, our FTP deploy process uploads all files to the server every time we deploy, even if only a few files have been modified. This can be time-consuming and inefficient, especially when dealing with large projects with many files.

To improve the deploy process, we would like to request a feature that allows us to selectively upload only the files that have been modified since the last deployment. This feature would greatly reduce the deployment time and save bandwidth usage on both our end and the server's end.

We understand that there may be some challenges in implementing this feature, such as tracking the changes made to files since the last deployment and identifying which files need to be uploaded or by simply comparing the last write time of the two files. However, we believe that this feature would greatly improve the overall efficiency of our deploy process and make it easier for our team to manage deployments.

We welcome any feedback or suggestions on how this feature can be implemented, and we are happy to collaborate with the community to make this feature a reality. Thank you for considering our feature request.

SamKirkland commented 1 year ago

v4+ uploads only changed files. Uploaded file state is synced to the .ftp-deploy-sync-state.json file. But some FTP account cannot read this file (maybe that's why it's not working?)

At the end of the upload you should see a log with the following: šŸŽ‰ Sync complete. Saving current server state to "./.ftp-deploy-sync-state.json"

Himato commented 1 year ago

Does it work in in case of DANGEROUS_CLEAN_SLATE set to true ?

SamKirkland commented 1 year ago

No. Look at your deployment logs, you'll see the following warning:

šŸ—‘ļø Removing all files on the server because 'dangerous-clean-slate' was set, this will make the deployment very slow...

Also look at the readme, you'll see the following description Deletes ALL contents of server-dir, even items marked as --exclude argument