diff options
Diffstat (limited to 'deploy.sh')
-rwxr-xr-x | deploy.sh | 21 |
1 files changed, 21 insertions, 0 deletions
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 |