deploy
Deploy the memory application to the remote server. Use when deploying code, syncing changes, restarting services, or running commands on the production server.
When & Why to Use This Skill
This Claude skill automates the deployment and management of applications on remote servers, specifically optimized for EC2 environments. It streamlines the DevOps lifecycle by providing tools for code synchronization, Git-based deployments, Docker service management, and remote command execution, ensuring a fast and reliable path from development to production.
Use Cases
- Automated Production Deployment: Seamlessly pull the latest code from specific Git branches and restart Docker services to ensure the production environment is always up-to-date.
- Rapid Development Syncing: Bypass Git for quick testing by using Rsync to push local code changes directly to the server, enabling immediate feedback loops.
- Remote Database Management: Execute database migrations (e.g., Alembic) and maintenance scripts directly on the production server within the application's virtual environment.
- Server Maintenance and Troubleshooting: Restart services, check real-time Docker logs, and run arbitrary shell commands remotely to diagnose and resolve infrastructure issues.
| name | deploy |
|---|---|
| description | Deploy the memory application to the remote server. Use when deploying code, syncing changes, restarting services, or running commands on the production server. |
Memory Deployment
The deployment script is at tools/deploy.sh. It manages the remote server memory (EC2 instance) at /home/ec2-user/memory.
Commands
Deploy (most common)
Pull latest code and restart services:
./tools/deploy.sh deploy # deploys master branch
./tools/deploy.sh deploy <branch> # deploys specific branch
Sync
Rsync local code directly to server (bypasses git, useful for testing):
./tools/deploy.sh sync
Syncs: src/, tests/, tools/, db/, docker/, frontend/, requirements/, config files.
Excludes: __pycache__, .git, memory_files, secrets, .env, venv, etc.
Pull
Git pull on the server without restarting:
./tools/deploy.sh pull # pulls master
./tools/deploy.sh pull <branch> # pulls specific branch
Restart
Restart docker services without pulling new code:
./tools/deploy.sh restart
Runs: docker compose up --build -d
Run
Execute arbitrary commands on the server (with venv activated):
./tools/deploy.sh run <command>
Examples:
./tools/deploy.sh run "python -c 'print(1)'"
./tools/deploy.sh run "pip list"
./tools/deploy.sh run "alembic upgrade head"
Typical Workflows
Standard deployment:
git push origin master
./tools/deploy.sh deploy
Quick test without committing:
./tools/deploy.sh sync
./tools/deploy.sh restart
Run migrations:
./tools/deploy.sh run "alembic upgrade head"
Check logs after deploy:
./tools/deploy.sh run "docker compose logs -f"