Once you have configured your hosts, you can set up your build jobs to deploy artifacts to these hosts.
You can do this either as a build step (see Figure 12.14, “Deploying files to a remote host in the build
section”) or as a post-build action (see Figure 12.15, “Deploying files to a remote host in the post-build
actions”). In both cases, the options are similar.
Figure 12.14. Deploying files to a remote host in the build section
First of all, you select the target host from the list of hosts you configured in the previous section. Next,
you configure the files you want to transfer. You do this by defining one or more “Transfer sets.” A
Transfer set is a set of files (defined by an Ant fileset expression) that you deploy to a specified directory
on the remote server. You can also provide a prefix to be removed—this lets you strip off unnecessary
directories that you do not want to appear on the server (such as the target/site directory path in
the example). You can add as many transfer sets as you need to get the files you want onto the remote
server. The plugin also provides options to execute commands on the remote server once the transfer is
complete (“Exec command”) or to exclude certain files or flatten the directories.