FastAPI + vanilla JS app run as a Docker container behind Caddy (HTTPS by IP). install.sh installs or updates it on a server in one command, with preflight checks and Docker setup; deploy.sh pushes a local checkout to a server over SSH and runs install.sh there. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
10 lines
608 B
Bash
Executable file
10 lines
608 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# Deploy this checkout (including uncommitted changes) to a server over SSH:
|
|
# HOST=root@<server> ./deploy.sh
|
|
# Copies the code to /opt/gsm/src on the server and runs install.sh there. SITE=<ip or domain> is passed on if set.
|
|
set -euo pipefail
|
|
[ -n "${HOST:-}" ] || { echo "usage: HOST=root@<server> $0" >&2; exit 1; }
|
|
cd "$(dirname "$0")"
|
|
tar -czf - --exclude=__pycache__ app caddy install.sh |
|
|
ssh "$HOST" 'rm -rf /opt/gsm/src && mkdir -p /opt/gsm/src && tar -xzf - -C /opt/gsm/src'
|
|
ssh "$HOST" "${SITE:+SITE=$(printf %q "$SITE") }GSM_SRC=/opt/gsm/src bash /opt/gsm/src/install.sh"
|