summaryrefslogtreecommitdiff
path: root/deploy.sh
blob: 0799a238b7416c7b2230a6c57873bc0eb3788cb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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