I am using Phing and right now I am using this code to upload my files to FTP:
<target name="ftp.upload">
<echo>Uploading files to FTP</echo>
<ftpdeploy
host="${ftp.destination.host}"
port="${ftp.destination.port}"
username="${ftp.destination.username}"
password="${ftp.destination.password}"
dir="${ftp.destination.dir}"
mode="${ftp.destination.mode}">
<fileset refid="TheFiles" />
</ftpdeploy>
<echo>FTP Upload Finished!</echo>
</target>
It takes a long time to load, and I have a lot of images – so every time I make a small text change, I don’t want it to re-upload everything. Is there a way to detect which files has been changed and only upload those?
Thanks!
This is a little late … but you CAN actually do this with Phing. This requires a few steps:
Define a date property to go off from. This will be necessary at the end when you’re saving last build date for future builds
Define lastbuilddate property. Define it to something way back. Then include a file (will be created at the end of your run) with the same property. If file exists (2nd run and after), it will override the setting you defined with whatever the last date was
Include date task in your fileset definition. That specifies to only pick files that have last modified date AFTER your last build date
Run your ftp for the TheFiles fileset
Update the lastbuild.properties file with the latest run date. Noticed that we’re using date/time properties defined initially.
Every time you run your target, it will only ftp files that were changed since the date specified in lastbuilddate property