Publication does a few things:
makes the right packages available,
updates all the data,
builds any changed code in the project,
starts, stops, and restarts services as needed.
This is managed in phases:
prepare a staging area to rsync to each host on the cluster, using cvs update). We will also produce lists of files and packages that changed. This is in turn done in three parts: we copy some data specific to publication parallel to $PLAYPEN_ROOT on all the hosts (we append .pubdata to that path). Then we optionally copy the old contents of the non-ext portion of the playpen to minimize build times. Finally, we rsync the remaining changes across.
on each host, copy the old playpen to the new playpen to speed up the rsyncing.
rsync the files to each host.
on each host, build a new playpen root, without interrupting the existing playpen. This is done by publish/prepare-new-playpen.
on each host, stop the old services as needed, swap the playpens, adjust non-relocatable packages, and finally restart/start the needed services. This is done by publish/use-new-playpen.
All scripts run on the remote hosts during publication will have the environment variable WIGWAM_IS_PUBLISHING set to 1.