Deploying by pulling into the live directory means the site is briefly running half of one release and half of another, and rolling back means pulling again and hoping.
releases/
20181114093000/
20181114141200/
current -> releases/20181114141200
shared/
.env
storage/
# the swap, which is atomic
ln -sfn "$RELEASE" /var/www/app/current.tmp
mv -Tf /var/www/app/current.tmp /var/www/app/current
systemctl reload php7.2-fpm
mv -T on a symlink is a rename, which is atomic on the same filesystem — ln -sfn directly onto an existing link is not, and there is a window where the path does not resolve. The fpm reload is required because the opcache keys on resolved paths, so without it the workers keep serving the previous release from cache. Rolling back is repointing the link, which takes a second and is the entire argument for the layout.