3638bd7d81
📁 Files changed: 10 📝 Lines changed: 372 • deploy.md • .coverage • deploy.sh • __init__.py • comfy_routes.py • index-BEOoAFTp.css • index-Wi7i1Rks.js • index.html • GenerateView.vue • app.ts
55 lines
1.3 KiB
Bash
Executable File
55 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Deploy tensors to junkpile
|
|
# Usage: ./scripts/deploy.sh
|
|
|
|
set -e
|
|
|
|
REMOTE="chi@junkpile"
|
|
REMOTE_DIR="/opt/tensors/app"
|
|
LOCAL_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
|
|
|
echo "==> Building UI..."
|
|
cd "$LOCAL_DIR/tensors/server/ui"
|
|
npm run build
|
|
|
|
echo ""
|
|
echo "==> Syncing Python code to junkpile..."
|
|
rsync -av --delete \
|
|
--exclude='.git' \
|
|
--exclude='__pycache__' \
|
|
--exclude='.venv' \
|
|
--exclude='node_modules' \
|
|
--exclude='.ruff_cache' \
|
|
--exclude='.mypy_cache' \
|
|
--exclude='.pytest_cache' \
|
|
--exclude='*.egg-info' \
|
|
--rsync-path="sudo rsync" \
|
|
"$LOCAL_DIR/tensors/" "$REMOTE:$REMOTE_DIR/tensors/"
|
|
|
|
echo ""
|
|
echo "==> Fixing permissions..."
|
|
ssh "$REMOTE" "sudo chown -R tensors:tensors $REMOTE_DIR && sudo chmod -R g+w $REMOTE_DIR"
|
|
|
|
echo ""
|
|
echo "==> Restarting tensors service..."
|
|
ssh "$REMOTE" "sudo systemctl restart tensors"
|
|
|
|
echo ""
|
|
echo "==> Waiting for tensors to start..."
|
|
sleep 2
|
|
|
|
echo ""
|
|
echo "==> Verifying tensors service..."
|
|
SERVICE_STATUS=$(ssh "$REMOTE" "systemctl is-active tensors" 2>/dev/null)
|
|
if [ "$SERVICE_STATUS" = "active" ]; then
|
|
echo "✓ tensors service running"
|
|
else
|
|
echo "✗ tensors service not running"
|
|
ssh "$REMOTE" "journalctl -u tensors -n 10 --no-pager"
|
|
exit 1
|
|
fi
|
|
|
|
echo ""
|
|
echo "==> Deploy complete!"
|
|
echo " Access: http://junkpile:8081"
|