--- name: deploy description: Deploy Major Domo or Paper Dynasty services to production. Handles version bumping, Docker build/push, and production deployment. USE WHEN user says "deploy discord bot", "deploy database", "deploy major domo", "deploy paper dynasty", "release", "bump version and deploy", "/deploy", or wants to push a new version to production. --- # Deploy Services to Production ## When to Activate This Skill - "Deploy discord bot" / "Deploy md-discord" / "Deploy pd-discord" - "Deploy database" / "Deploy md-database" / "Deploy pd-database" - "Deploy major domo" / "Deploy paper dynasty" - "Release new version" - "Bump version and deploy" - "/deploy" followed by service name - "Push to production" ## Available Services | Service | Project | Docker Hub | Host | Production Path | |---------|---------|------------|------|-----------------| | **md-discord** | Major Domo | `manticorum67/major-domo-discordapp` | akamai | `/root/container-data/major-domo` | | **md-database** | Major Domo | `manticorum67/major-domo-database` | akamai | `/root/container-data/sba-database` | | **pd-discord** | Paper Dynasty | `manticorum67/paper-dynasty-discordapp` | sba-bots | `/home/cal/container-data/paper-dynasty` | | **pd-database** | Paper Dynasty | `manticorum67/paper-dynasty-database` | akamai | `/root/container-data/paper-dynasty` | ## Quick Start ```bash # Dry run (see what would happen) ~/.claude/skills/deploy/deploy.sh md-discord patch --dry-run ~/.claude/skills/deploy/deploy.sh pd-database minor --dry-run # Actual deployment ~/.claude/skills/deploy/deploy.sh md-discord patch ~/.claude/skills/deploy/deploy.sh pd-database minor ``` ## Version Bump Types | Type | Example | When to Use | |------|---------|-------------| | **patch** | 2.28.3 → 2.28.4 | Bug fixes, minor changes | | **minor** | 2.28.3 → 2.29.0 | New features, backwards compatible | | **major** | 2.28.3 → 3.0.0 | Breaking changes | ## Deployment Workflow The script executes these steps automatically: 1. **Check git status** - Warns about uncommitted changes 2. **Update VERSION** - Increments based on bump type 3. **Build Docker image** - Tags with version and `latest` 4. **Push to Docker Hub** - Both version and latest tags 5. **Deploy to production** - SSH to host, pull and restart 6. **Git commit & tag** - Commits VERSION bump, creates git tag 7. **Verify** - Shows running container status ## Service Details ### Major Domo Discord Bot (md-discord) - **Local**: `/mnt/NV2/Development/major-domo/discord-app-v2` - **Container**: `major-domo-discord-app-1` - **Compose service**: `discord-app` ### Major Domo Database API (md-database) - **Local**: `/mnt/NV2/Development/major-domo/database` - **Container**: `sba_db_api` - **Compose service**: `api` ### Paper Dynasty Discord Bot (pd-discord) - **Local**: `/mnt/NV2/Development/paper-dynasty/discord-app` - **Host**: `sba-bots` (10.10.0.88, user: cal) - **Container**: `paper-dynasty_discord-app_1` - **Compose service**: `discord-app` ### Paper Dynasty Database API (pd-database) - **Local**: `/mnt/NV2/Development/paper-dynasty/database` - **Host**: `akamai` - **Container**: `pd_api` - **Compose service**: `api` ## Important Notes - **Always verify tests pass before deploying** - **Check git status is clean before starting** - **SSH session detection**: Automatically disables BuildKit to avoid credential prompts - **Dry run**: Always available with `--dry-run` flag ## Viewing Logs ```bash # Major Domo Discord Bot ssh akamai "docker logs major-domo-discord-app-1 --tail 100 -f" # Major Domo Database API ssh akamai "docker logs sba_db_api --tail 100 -f" # Paper Dynasty Discord Bot ssh sba-bots "docker logs paper-dynasty_discord-app_1 --tail 100 -f" # Paper Dynasty Database API ssh akamai "docker logs pd_api --tail 100 -f" ``` ## Rollback Procedure If deployment fails, edit the docker-compose.yml on the production host to use a specific version tag: ```yaml # Example: rollback to previous version image: manticorum67/major-domo-discordapp:2.28.2 ``` Then pull and restart: ```bash ssh HOST "cd PATH && docker compose pull SERVICE && docker compose up -d SERVICE" ```