What is the quickest way to deploy content to a CDN with an Ant target? My Ant target is running on a continuous integration server (Hudson). My current solution uses curl and is a bit slow. Should I use wput or something else and how would I do that in ant?
<target name="Deploy">
<for param="file">
<path>
<fileset dir="${basedir}/output" includes="**/*"/>
</path>
<sequential>
<echo> Deploy @{file} </echo>
<exec executable="curl">
<arg value="-F name=value"/> <!-- params for secure access -->
<arg value= "-F file=@{file}"/>
<arg value="http://cdn.com/project"/>
</exec>
</sequential>
</for>
</target>
Several ideas have come up to speed up the transfer of content to the cdn
1) max out the pipe bandwidth by using the parallel ant task to simultaneously transfer several mutually exclusive filesets. For example, if there are three sub-folders in the output folder, each can be given to a different parallel task, and each would iterate through the files, calling curl on each file to transfer it to the cdn. http://ant.apache.org/manual/Tasks/parallel.html
2) write a custom ant task (bash script?) that would have local knowledge about the build so that any files that were changed by the last build get marked and only those files would be transfered. This would prevent sending a file that is already on the cdn.
3) read the remote directory from the cdn and use timestamps to determine which files to send. This may not be possible depending on the cdn and whether it allows such queries. I was hoping wput could do this but I don't see an option for that. http://wput.sourceforge.net/wput.1.html