Deployment is a process of moving an activity/task into the server such that it will work in real-time. In order to deploy, project has to be packed using zipfileset. The following topics are covered in ANT Deploy chapter:
Introduction to deployment
copy task
FTP server connection
Description
After packing, the war file is ready to deploy. ANT Deploy can be done in various ways.
Normally, the war file can be copied into other machine using the copy task, if it is a local machine.
Conceptual
figure
Example
Code for deploying using copy task
[java]
<target name="deploy" depends="war" unless="testsFailed">
<copy file="${build.dir}/${war.name}" to dir="${deploy.dir}"/>
</target>
[/java]
Further
Process
But now, deploying must be done to a QA machine, which is an integration test machine and QA machine can be accessed via FTP. In the below example, server attribute is the remote machine hostname for which the transfer of file will be done.
Remotedir defines the ftp task destination directory. Servers and FTP clients use binary modes to the files like the zip file in the project. Verbose gives an extra information about the transfer of file. Passive has to be set to yes to get through the firewall.
Now, the FTP server connection has been set. Then, the server has to be instructed what to transfer. The fileset tags helps in transferring process.