From 6a4fc2d15141cd922327267e376302f65a3bb277 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sat, 9 Mar 2024 00:25:48 -0700 Subject: rsync --- deploy.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 deploy.sh (limited to 'deploy.sh') diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..0799a23 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +set -e + +echo $SSH_KEY | base64 -d >> /tmp/key +chmod -R 0600 /tmp/key + +for item in dist/*; do + echo "copying $item" + if [ -d "$item" ]; then + SOURCE_PATH="$item/" + DEST_PATH="$RSYNC_DESTINATION/$item/" + else + SOURCE_PATH="$item" + DEST_PATH="$RSYNC_DESTINATION" + fi + rsync -e "ssh -i /tmp/key -o StrictHostKeyChecking=no" -avz --delete $SOURCE_PATH $DEST_PATH +done +echo "finished copying to remote host..." + +rm /tmp/key -- cgit v1.2.3-70-g09d2