diff options
Diffstat (limited to 'scripts/deploy')
| -rwxr-xr-x | scripts/deploy | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/scripts/deploy b/scripts/deploy index c7ff734..2161535 100755 --- a/scripts/deploy +++ b/scripts/deploy @@ -21,7 +21,7 @@ REPO_DIR="$(cd "$(dirname "$0")/.." && pwd)" cd "${REPO_DIR}" echo "==> Pulling latest from bare repo..." -git pull --ff-only local master +git pull --ff-only local main STASHED=false if [ "$DIRTY" = false ] && [ -n "$(git status --porcelain)" ]; then @@ -31,6 +31,9 @@ if [ "$DIRTY" = false ] && [ -n "$(git status --porcelain)" ]; then trap 'if [ "$STASHED" = true ]; then echo "==> Popping stash..."; git stash pop; fi' EXIT fi +echo "==> Verifying (build + tests)..." +"${REPO_DIR}/scripts/verify" + echo "==> Building claudomator..." export GOCACHE="${SITE_DIR}/cache/go-build" export GOPATH="${SITE_DIR}/cache/gopath" @@ -39,23 +42,23 @@ go build -o "${BIN_DIR}/claudomator" ./cmd/claudomator/ echo "==> Copying scripts..." mkdir -p "${SITE_DIR}/scripts" -cp "${REPO_DIR}/scripts/"* "${SITE_DIR}/scripts/" -chown -R www-data:www-data "${SITE_DIR}/scripts" -chmod +x "${SITE_DIR}/scripts/"* +find "${REPO_DIR}/scripts" -maxdepth 1 -type f -exec cp -p {} "${SITE_DIR}/scripts/" \; + +echo "==> Installing to /usr/local/bin..." +install -m 755 "${BIN_DIR}/claudomator" /usr/local/bin/claudomator + +echo "==> Verifying system CLI version..." +/usr/local/bin/claudomator version echo "==> Fixing permissions..." -chown www-data:www-data "${BIN_DIR}/claudomator" -chmod +x "${BIN_DIR}/claudomator" +"${REPO_DIR}/scripts/fix-permissions" -if [ -f "${BIN_DIR}/claude" ]; then - echo "==> Fixing Claude permissions..." - chown www-data:www-data "${BIN_DIR}/claude" - chmod +x "${BIN_DIR}/claude" -fi +echo "==> Syncing credentials..." +"${REPO_DIR}/scripts/sync-credentials" -echo "==> Installing to /usr/local/bin..." -cp "${BIN_DIR}/claudomator" /usr/local/bin/claudomator -chmod +x /usr/local/bin/claudomator +echo "==> Ensuring binary and scripts are executable..." +chmod +x "${BIN_DIR}/claudomator" /usr/local/bin/claudomator +find "${SITE_DIR}/scripts" -maxdepth 1 -type f -exec chmod +x {} + echo "==> Restarting service..." sudo systemctl restart "${SERVICE}" |
