18 lines
702 B
Bash
Executable file
18 lines
702 B
Bash
Executable file
#!/bin/bash
|
|
# This script builds the documentation site using MkDocs and serves it to the Caddy web server.
|
|
|
|
# Build the documentation site
|
|
echo "Building documentation site..."
|
|
rm -rf ./site
|
|
mkdocs build --clean
|
|
|
|
# Collect ssh password
|
|
echo "Enter SSH password for cory@10.10.10.40:"
|
|
read -s SSH_PASSWORD
|
|
echo "Thank you! Your password has been securely collected."
|
|
|
|
# Clean up the web server directory
|
|
sshpass -p "$SSH_PASSWORD" ssh cory@10.10.10.40 'find /var/caddy/docs.bsct.io/www -mindepth 1 ! -regex `^/var/caddy/docs.bsct.io/www/fileshare\(/.*\?' -delete
|
|
|
|
# Copy the built documentation to the web server
|
|
sshpass -p "$SSH_PASSWORD" scp -r ./site/* cory@10.10.10.40:/var/caddy/docs.bsct.io/www/
|