Pawprint Control Scripts
Control scripts for managing pawprint services via systemd (alternative to Docker deployment).
Structure
ctrl/
├── .env.pawprint # Shared configuration
├── local/ # Scripts run from developer machine
│ ├── commit.sh # Commit changes across all repos
│ ├── deploy.sh # Full deployment workflow
│ ├── init.sh # Initial sync to server
│ ├── push.sh # Deploy to server (all by default)
│ └── status.sh # Git status of all repos
└── server/ # Scripts run on server
├── install-deps.sh # Install Python deps (all by default)
├── restart.sh # Restart services (all by default)
├── setup-cert.sh # Setup SSL certificate
├── setup-nginx.sh # Create nginx config
└── setup-service.sh # Create systemd service
Configuration
Edit .env.pawprint to configure:
# Deployment
DEPLOY_SERVER=mariano@mcrn.ar
DEPLOY_REMOTE_PATH=~/pawprint
# Local paths
PAWPRINT_BARE_PATH=/home/mariano/pawprint
# Server paths
SERVER_USER=mariano
SERVER_PAWPRINT_PATH=/home/mariano/pawprint
SERVER_VENV_BASE=/home/mariano/venvs
Design Principle
All services are the default. No flags needed for common operations.
./push.sh # Deploys all (default)
./push.sh artery # Deploy only artery (when needed)
See DESIGN_PAWPRINT.md for detailed philosophy.
Local Scripts
commit.sh
./local/commit.sh "Your commit message"
status.sh
./local/status.sh
push.sh
./local/push.sh # Push all services (default)
./local/push.sh artery # Push only artery
deploy.sh
./local/deploy.sh
# Then restart on server:
# ssh mariano@mcrn.ar 'bash ~/pawprint/ctrl/server/restart.sh'
init.sh
./local/init.sh # Initial full sync (run once)
Server Scripts
restart.sh
sudo ./server/restart.sh # Restart all (default)
sudo ./server/restart.sh artery # Restart only artery
install-deps.sh
./server/install-deps.sh # Install all (default)
./server/install-deps.sh artery # Install only artery
setup-service.sh
sudo ./server/setup-service.sh pawprint 12000 main:app
sudo ./server/setup-service.sh artery 12001 main:app
setup-nginx.sh
sudo ./server/setup-nginx.sh artery artery.mcrn.ar 12001
setup-cert.sh
sudo ./server/setup-cert.sh artery.mcrn.ar
Deployment Workflow
Initial Setup (once)
Local:
cd ctrl/local
./init.sh
Server:
cd ~/pawprint/ctrl/server
./install-deps.sh
sudo ./setup-service.sh pawprint 12000 main:app
sudo ./setup-service.sh artery 12001 main:app
sudo ./setup-service.sh album 12002 main:app
sudo ./setup-service.sh ward 12003 main:app
sudo ./setup-nginx.sh pawprint pawprint.mcrn.ar 12000
sudo ./setup-nginx.sh artery artery.mcrn.ar 12001
sudo ./setup-nginx.sh album album.mcrn.ar 12002
sudo ./setup-nginx.sh ward ward.mcrn.ar 12003
Regular Updates
Local:
cd ctrl/local
./commit.sh "Update feature X"
./deploy.sh
Server:
sudo ~/pawprint/ctrl/server/restart.sh
Nest vs Pawprint Control
- core_nest/ctrl/ - Manages full nest (amar + pawprint) via Docker
- pawprint/ctrl/ - Manages pawprint services via systemd
This directory provides systemd-based deployment as an alternative to Docker.
For full nest orchestration with Docker, use core_nest/ctrl/.