curl - How to quickly deploy assets to Amazon S3 with an Ant target? -
curl - How to quickly deploy assets to Amazon S3 with an Ant target? -
what quickest way deploy content cdn ant target? ant target running on continuous integration server (hudson). current solution uses curl , bit slow. should utilize wput or else , how 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 secure access --> <arg value= "-f file=@{file}"/> <arg value="http://cdn.com/project"/> </exec> </sequential> </for> </target> several ideas have come speed transfer of content cdn
1) max out pipe bandwidth using parallel ant task simultaneously transfer several mutually exclusive filesets. example, if there 3 sub-folders in output folder, each can given different parallel task, , each iterate through files, calling curl on each file transfer cdn. http://ant.apache.org/manual/tasks/parallel.html
2) write custom ant task (bash script?) have local knowledge build files changed lastly build marked , files transfered. prevent sending file on cdn.
3) read remote directory cdn , utilize timestamps determine files send. may not possible depending on cdn , whether allows such queries. hoping wput don't see alternative that. http://wput.sourceforge.net/wput.1.html
resolved
i found blog titled "deploying assets amazon s3 ant" extremely helpful. uses python script 's3cmd sync' transfers files don’t exist @ destination.
i ended ant target:
<target name="s3upload"> <property name="http.expires" value="fri, 31 dec 2011 12:00:00 gmt" /> <exec executable="${python_dir}\python.exe" failonerror="true"> <arg value="${python_dir}\scripts\s3cmd" /> <arg value="--guess-mime-type" /> <arg value="--add-header=cache-control:public, max-age=630657344" /> <arg value="--add-header=expires:${http.expires}" /> <arg value="--encoding=utf-8" /> <arg value="--skip-existing" /> <arg value="--recursive" /> <arg value="--exclude=*.log" /> <arg value="--acl-public" /> <arg value="sync" /> <arg value="${cdn_dir}/" /> <arg value="s3://my-project-cdn/" /> </exec> </target> ant curl amazon-s3 deployment assets
Comments
Post a Comment