feat(conversation-assistant): add remote deployment tool
- Add deploy-remote.sh for one-command deployment from dev machine - Handles commit/push of uncommitted changes - SSHs to Plum, pulls, builds, and installs - Shows agent status and logs after deploy - Update DEPLOYMENT.md with new workflow Usage: ./deploy-remote.sh [server_url] 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
8d0202ca81
commit
4f279d6a1e
2 changed files with 136 additions and 10 deletions
|
|
@ -2,21 +2,39 @@
|
|||
|
||||
Quick reference for deploying the agent to "Plum" MacBook.
|
||||
|
||||
## Quick Start
|
||||
## Quick Start (Remote Deploy)
|
||||
|
||||
From the development machine (Linux/Black):
|
||||
|
||||
```bash
|
||||
# One command to deploy
|
||||
./deploy-remote.sh
|
||||
|
||||
# Or with custom server URL
|
||||
./deploy-remote.sh https://conversations.nasty.sh
|
||||
```
|
||||
|
||||
This will:
|
||||
1. Check for uncommitted changes and offer to commit/push
|
||||
2. SSH to Plum and pull latest
|
||||
3. Build and install the agent
|
||||
4. Show deployment status and logs
|
||||
|
||||
## Manual Deployment
|
||||
|
||||
If you need to deploy manually on the MacBook:
|
||||
|
||||
```bash
|
||||
# SSH to Plum MacBook
|
||||
ssh lilith@plum.local
|
||||
ssh plum
|
||||
|
||||
# Clone/pull repository
|
||||
# Pull latest code
|
||||
cd ~/Code/@applications/@lilith/lilith-platform
|
||||
git pull
|
||||
|
||||
# Navigate to macOS agent
|
||||
cd codebase/features/conversation-assistant/macos
|
||||
|
||||
# Run installer
|
||||
./install.sh https://assistant.lilith.is
|
||||
# Navigate to macOS agent and install
|
||||
cd features/conversation-assistant/macos
|
||||
./install.sh https://conversations.nasty.sh
|
||||
```
|
||||
|
||||
## Deployment Checklist
|
||||
|
|
@ -24,7 +42,7 @@ cd codebase/features/conversation-assistant/macos
|
|||
### Pre-Deployment
|
||||
|
||||
- [ ] Server is running and accessible
|
||||
- [ ] Server URL is known (e.g., `https://assistant.lilith.is`)
|
||||
- [ ] Server URL is known (e.g., `https://conversations.nasty.sh`)
|
||||
- [ ] SSH access to Plum MacBook configured
|
||||
- [ ] Xcode Command Line Tools installed on Plum
|
||||
|
||||
|
|
@ -49,7 +67,7 @@ tail -f ~/Library/Application\ Support/ConversationAssistant/stderr.log
|
|||
launchctl list | grep conversation-assistant
|
||||
|
||||
# Test API connectivity
|
||||
curl https://assistant.lilith.is/health
|
||||
curl https://conversations.nasty.sh/health
|
||||
```
|
||||
|
||||
### Post-Deployment
|
||||
|
|
|
|||
108
features/conversation-assistant/macos/deploy-remote.sh
Executable file
108
features/conversation-assistant/macos/deploy-remote.sh
Executable file
|
|
@ -0,0 +1,108 @@
|
|||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
# Remote deployment script for Conversation Assistant macOS agent
|
||||
# Run this from the development machine to deploy to Plum MacBook
|
||||
|
||||
# Colors
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m'
|
||||
|
||||
# Configuration
|
||||
REMOTE_HOST="plum"
|
||||
REMOTE_REPO_PATH="~/Code/@applications/@lilith/lilith-platform"
|
||||
REMOTE_MACOS_PATH="$REMOTE_REPO_PATH/features/conversation-assistant/macos"
|
||||
SERVER_URL="${1:-https://conversations.nasty.sh}"
|
||||
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
REPO_ROOT="$SCRIPT_DIR/../../../../.."
|
||||
|
||||
print_step() { echo -e "${GREEN}▸${NC} $1"; }
|
||||
print_info() { echo -e "${BLUE}ℹ${NC} $1"; }
|
||||
print_error() { echo -e "${RED}✗${NC} $1"; }
|
||||
print_success() { echo -e "${GREEN}✓${NC} $1"; }
|
||||
|
||||
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
||||
echo -e "${BLUE} Conversation Assistant - Remote Deployment${NC}"
|
||||
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
||||
echo ""
|
||||
|
||||
# Check SSH connection
|
||||
print_step "Checking SSH connection to $REMOTE_HOST..."
|
||||
if ! ssh -o ConnectTimeout=5 "$REMOTE_HOST" 'echo ok' >/dev/null 2>&1; then
|
||||
print_error "Cannot connect to $REMOTE_HOST"
|
||||
echo "Make sure:"
|
||||
echo " - The MacBook is on and connected to the network"
|
||||
echo " - SSH config exists for host '$REMOTE_HOST'"
|
||||
exit 1
|
||||
fi
|
||||
print_success "Connected to $REMOTE_HOST"
|
||||
|
||||
# Check for uncommitted changes in macos directory
|
||||
print_step "Checking for uncommitted changes..."
|
||||
cd "$REPO_ROOT"
|
||||
|
||||
MACOS_CHANGES=$(git status --porcelain -- codebase/features/conversation-assistant/macos/ 2>/dev/null | grep -v '??' || true)
|
||||
if [[ -n "$MACOS_CHANGES" ]]; then
|
||||
print_info "Found uncommitted changes in macos/:"
|
||||
echo "$MACOS_CHANGES" | sed 's/^/ /'
|
||||
echo ""
|
||||
|
||||
read -p "Commit and push these changes? [Y/n] " -n 1 -r
|
||||
echo
|
||||
if [[ $REPLY =~ ^[Nn]$ ]]; then
|
||||
print_error "Aborted - commit changes manually first"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
print_step "Committing changes..."
|
||||
git add codebase/features/conversation-assistant/macos/
|
||||
git commit -m "fix(conversation-assistant): update macos agent
|
||||
|
||||
🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
||||
|
||||
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>"
|
||||
|
||||
print_step "Pushing to remote..."
|
||||
git push
|
||||
print_success "Changes pushed"
|
||||
else
|
||||
print_info "No uncommitted changes in macos/"
|
||||
fi
|
||||
|
||||
# Deploy to remote
|
||||
print_step "Deploying to $REMOTE_HOST..."
|
||||
ssh "$REMOTE_HOST" bash -s "$SERVER_URL" << 'REMOTE_SCRIPT'
|
||||
set -euo pipefail
|
||||
SERVER_URL="$1"
|
||||
|
||||
cd ~/Code/@applications/@lilith/lilith-platform
|
||||
|
||||
echo "Pulling latest changes..."
|
||||
git pull --ff-only
|
||||
|
||||
cd features/conversation-assistant/macos
|
||||
|
||||
echo "Running installer..."
|
||||
./install.sh "$SERVER_URL"
|
||||
|
||||
echo ""
|
||||
echo "Checking agent status..."
|
||||
sleep 2
|
||||
if pgrep -x ConversationAssistant >/dev/null; then
|
||||
echo "✓ Agent is running"
|
||||
echo ""
|
||||
echo "Recent logs:"
|
||||
tail -10 ~/Library/Application\ Support/ConversationAssistant/stderr.log 2>/dev/null || echo "(no logs yet)"
|
||||
else
|
||||
echo "⚠ Agent is not running (may need Full Disk Access)"
|
||||
fi
|
||||
REMOTE_SCRIPT
|
||||
|
||||
echo ""
|
||||
print_success "Deployment complete!"
|
||||
echo ""
|
||||
print_info "To view logs on remote: ssh $REMOTE_HOST 'tail -f ~/Library/Application\\ Support/ConversationAssistant/stderr.log'"
|
||||
Loading…
Add table
Reference in a new issue