diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-03-05 18:29:02 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-03-05 18:29:02 +0000 |
| commit | 680e5f668637248073c1f8f7e3547810ab1ada36 (patch) | |
| tree | b4289235b493e21795b8b8dc3ff05e0474438dde | |
| parent | 2bbae7416274ef83a6b1d0f9e6101814f0d15ad1 (diff) | |
allow running deploy as non-root
| -rwxr-xr-x | scripts/deploy | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/deploy b/scripts/deploy index a17b1ab..4722dab 100755 --- a/scripts/deploy +++ b/scripts/deploy @@ -8,11 +8,14 @@ set -euo pipefail FQDN="doot.terst.org" SITE_DIR="/site/${FQDN}" BIN_DIR="${SITE_DIR}/bin" -SERVICE="claudomator@${FQDN}" +SERVICE="claudomator@${FQDN}.service" REPO_DIR="$(cd "$(dirname "$0")/.." && pwd)" echo "==> Building claudomator..." cd "${REPO_DIR}" +export GOCACHE="${SITE_DIR}/cache/go-build" +export GOPATH="${SITE_DIR}/cache/gopath" +mkdir -p "${GOCACHE}" "${GOPATH}" go build -o "${BIN_DIR}/claudomator" ./cmd/claudomator/ echo "==> Fixing permissions..." @@ -20,7 +23,7 @@ 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 +sudo systemctl restart "${SERVICE}" +sudo systemctl status "${SERVICE}" --no-pager -l echo "==> Done!" |
