Skip to content
Snippets Groups Projects
.deploy.sh 637 B
Newer Older
Thomas Wood's avatar
Thomas Wood committed
#!/bin/sh
# Use rsync to transfer files to a server via ssh, ensuring that the files are transferred with the correct permissions,
# user group. The command will also remove old files from the remote directory.
# To transfer files to the default location, you will need to be a member of the `rr` DoC usergroup.
#
# Example usage:
# DOC_DEPLOY_USER=me ./.deploy.sh

Thomas Wood's avatar
Thomas Wood committed
set -x
USER=${DOC_DEPLOY_USER:+${DOC_DEPLOY_USER}@}
SERVER=${DOC_DEPLOY_SERVER:-shell1.doc.ic.ac.uk}
PTH=${DOC_DEPLOY_PATH:-/vol/rr/www}
Sacha Ayoun's avatar
Sacha Ayoun committed
exec rsync -e "ssh -o StrictHostKeyChecking=no" --chmod=Dg+s,ug+rwX,o+rX --chown=:rr -igrp --delete _site/ "${USER}${SERVER}:${PTH}"
Thomas Wood's avatar
Thomas Wood committed