deploy.sh 490 Bytes
Newer Older
1
#!/bin/bash
2

3
4
# Deploy HTML documentation directory. Must be run from docs directory.

5
6
# Run ssh-agent and add ssh key.
eval $(ssh-agent -s)
7
8

echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
9
10
11
12

# Add server's ssh host key to known hosts.
mkdir -p ~/.ssh

13
14
15
chmod 700 ~/.ssh

[[ -f /.dockerenv ]] && echo "$SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts
16
17

# Upload site.
Maarten de Waard's avatar
Maarten de Waard committed
18

19
rsync -r --verbose --compress --delete ./_build/html/* \
20
  "${FTP_USER}@ftp.greenhost.nl:${DOMAIN_NAME}/${SUBDOMAIN}"