diff options
Diffstat (limited to 'scripts/deploy')
| -rwxr-xr-x | scripts/deploy | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/deploy b/scripts/deploy new file mode 100755 index 0000000..a17b1ab --- /dev/null +++ b/scripts/deploy @@ -0,0 +1,26 @@ +#!/bin/bash +# deploy — Build and deploy claudomator to /site/doot.terst.org +# Usage: ./scripts/deploy +# Example: sudo ./scripts/deploy + +set -euo pipefail + +FQDN="doot.terst.org" +SITE_DIR="/site/${FQDN}" +BIN_DIR="${SITE_DIR}/bin" +SERVICE="claudomator@${FQDN}" +REPO_DIR="$(cd "$(dirname "$0")/.." && pwd)" + +echo "==> Building claudomator..." +cd "${REPO_DIR}" +go build -o "${BIN_DIR}/claudomator" ./cmd/claudomator/ + +echo "==> Fixing permissions..." +chown www-data:www-data "${BIN_DIR}/claudomator" +chmod +x "${BIN_DIR}/claudomator" + +echo "==> Restarting service..." +systemctl restart "${SERVICE}" +systemctl status "${SERVICE}" --no-pager -l + +echo "==> Done!" |
