Update memory bank: document automated deployment workflow with deploy.sh

This commit is contained in:
Eliza kragh 2026-03-05 12:52:02 -07:00
parent 1d63dfddef
commit ee5f7bcb6e

View file

@ -1,3 +1,4 @@
# DeafGain Website - AI Assistant Memory Bank
## IMPORTANT: User Profile & Expectations
@ -37,9 +38,9 @@
### SSH Production Access (Chaulmark's Account)
- **Server**: 10.4.0.205
- **SSH User**: `chaulmark`
- **Project Path**: `/docker/websites/deafgain/`
- **Project Path**: `/home/chaulmark/websites/deafgain.org`
- **Purpose**: Deploy Docker containers on production server
- **VPN Required**: Yes - Must connect via WireGuard VPN first (use `vpn-manager.command`)
- **VPN Required**: Yes - Automatically handled by `deploy.sh` script
### Production Environment
- **URL**: https://deafgain.org/
@ -60,13 +61,18 @@
git commit -m "Descriptive message"
git push
```
6. **Connect VPN**: User runs `vpn-manager.command` to connect to private network
7. **Deploy to Production** (SSH as chaulmark):
6. **Deploy to Production** (Automated via deploy.sh):
```bash
ssh chaulmark@10.4.0.205 "cd /docker/websites/deafgain/ && git pull && docker-compose up --build -d"
./deploy.sh
```
8. **Verify**: Check https://deafgain.org/ to confirm changes live
9. **Report**: Tell user "Done! Changes are live at deafgain.org"
This script automatically:
- Connects to VPN via WireGuard
- Tests server connectivity
- SSHs to production server
- Pulls latest changes from Git
- Rebuilds and restarts Docker containers
7. **Verify**: Check https://deafgain.org/ to confirm changes live
8. **Report**: Tell user "Done! Changes are live at deafgain.org"
### Git Commands I Use (User Never Runs These)
```bash
@ -84,45 +90,34 @@ git diff
git log --oneline -15
```
### Production Deployment (I Execute via SSH)
### Automated Production Deployment
The production server is on a private network (10.4.0.0/24) requiring VPN access. All deployment is now automated via `deploy.sh` script.
**Deployment Script**: `deploy.sh` in project root
- Automatically connects VPN via WireGuard
- Tests server connectivity
- SSHs to production and deploys
**What deploy.sh does**:
1. Checks if VPN is connected, connects if needed
2. Tests connectivity to 10.4.0.205
3. SSHs to chaulmark@10.4.0.205
4. Changes to `/home/chaulmark/websites/deafgain.org`
5. Runs `git pull` to get latest code
6. Runs `docker compose up --build -d` to rebuild containers
7. Reports success
**When I Need to Deploy**:
```bash
# FIRST: User must connect VPN using vpn-manager.command
# Then I can proceed with SSH deployment
# SSH into production server as chaulmark
ssh chaulmark@10.4.0.205
# Navigate to project
cd /docker/websites/deafgain/
# Pull latest changes
git pull
# Rebuild and restart containers
docker-compose up --build -d
# Monitor logs (if needed)
docker-compose logs -f
# Exit SSH
exit
./deploy.sh
```
That's it! The script handles VPN, SSH, Git pull, and Docker rebuild automatically.
### VPN Connection (User Runs)
The production server is on a private network (10.4.0.0/24) requiring VPN access.
**Tool**: `vpn-manager.command` in project root
- Interactive menu-driven script
- Manages WireGuard VPN connection
**Manual VPN Tool** (Optional): `vpn-manager.command`
- Interactive menu-driven script for manual VPN management
- Can connect/disconnect VPN manually
- Tests connectivity to production server
**When I Need Deployment**:
1. I ask user: "Please connect VPN using vpn-manager.command"
2. User runs the script and selects "Connect to VPN"
3. Script confirms connection to 10.4.0.205
4. I proceed with SSH deployment
5. User can disconnect VPN when done (optional)
## Token Management (If Needed)
### When Token Expires:
@ -235,11 +230,9 @@ git pull
4. I edit Services.tsx, add to relationshipPoints array
5. I commit: "Add RID conference to Missoula MT on interactive map"
6. I push: git push
7. I ask: "Please connect VPN using vpn-manager.command"
8. User connects VPN
9. I deploy: ssh chaulmark@10.4.0.205 "cd /docker/websites/deafgain/ && git pull && docker-compose up --build -d"
10. I verify: Check https://deafgain.org/services
11. I report: "Done! RID conference added to map at deafgain.org"
7. I deploy: ./deploy.sh (handles VPN, SSH, git pull, docker rebuild automatically)
8. I verify: Check https://deafgain.org/services
9. I report: "Done! RID conference added to map at deafgain.org"
```
### Task: "Add New Video"
@ -256,11 +249,9 @@ git pull
6. I test locally: pnpm dev (verify video plays)
7. I commit: "Add new video: [Title]"
8. I push: git push
9. I ask: "Please connect VPN using vpn-manager.command"
10. User connects VPN
11. I deploy: ssh chaulmark@10.4.0.205 "cd /docker/websites/deafgain/ && git pull && docker-compose up --build -d"
12. I verify: Check https://deafgain.org/resources
13. I report: "Done! New video '[Title]' is live on resources page"
9. I deploy: ./deploy.sh (handles VPN, SSH, git pull, docker rebuild automatically)
10. I verify: Check https://deafgain.org/resources
11. I report: "Done! New video '[Title]' is live on resources page"
```
### Task: "Update Services/Content"
@ -271,10 +262,8 @@ git pull
4. I make changes
5. I commit: "Update [page]: [description]"
6. I push: git push
7. I ask: "Please connect VPN using vpn-manager.command"
8. User connects VPN
9. I deploy: ssh chaulmark@10.4.0.205 "cd /docker/websites/deafgain/ && git pull && docker-compose up --build -d"
10. I report: "Done! Changes live at deafgain.org"
7. I deploy: ./deploy.sh (handles VPN, SSH, git pull, docker rebuild automatically)
8. I report: "Done! Changes live at deafgain.org"
```
### Task: "Fix Bug/Issue"
@ -286,11 +275,9 @@ git pull
5. I test fix locally: pnpm dev
6. I commit: "Fix [issue description]"
7. I push: git push
8. I ask: "Please connect VPN using vpn-manager.command"
9. User connects VPN
10. I deploy: ssh chaulmark@10.4.0.205 "cd /docker/websites/deafgain/ && git pull && docker-compose up --build -d"
11. I verify fix: Test on live site
12. I report: "Fixed! [Explanation of what was wrong and what I did]"
8. I deploy: ./deploy.sh (handles VPN, SSH, git pull, docker rebuild automatically)
9. I verify fix: Test on live site
10. I report: "Fixed! [Explanation of what was wrong and what I did]"
```
## Critical Files I Work With
@ -332,7 +319,12 @@ API_URL=http://localhost:804
```
## Recent History (Reference Only)
- **March 5, 2026**: Cloned repo, created memory bank, established AI assistant role
- **March 5, 2026**:
- Cloned repo, created memory bank, established AI assistant role
- Created automated deployment script (deploy.sh) with VPN and Docker rebuild
- Installed WireGuard for VPN connectivity
- Fixed server path to /home/chaulmark/websites/deafgain.org
- Successfully tested full automated deployment workflow
- **January 26, 2026**: Added RID conference to Missoula MT
- **January 20, 2026**: Added anti-spam honeypot
- **January 9, 2026**: Fixed email (SMTP 587, new Gmail password)
@ -350,7 +342,7 @@ API_URL=http://localhost:804
**What I Do**: Check coordinates format `[-long, lat]`, verify array syntax, test locally, fix and redeploy
### Issue: "Changes not live on website"
**What I Do**: Ensure VPN is connected, SSH to production, pull latest, rebuild Docker containers with `--build` flag
**What I Do**: Run `./deploy.sh` to automatically connect VPN, SSH to production, pull latest, rebuild Docker containers
### Issue: "Git token expired"
**What I Tell User**: "Please generate new token at gitea.sigd.net → Settings → Applications → Access Tokens"
@ -373,11 +365,11 @@ API_URL=http://localhost:804
## Quick Reference
### User Says → AI Does
- "Add [Event] to map" → Get coordinates, edit Services.tsx, commit, push, ask for VPN, deploy
- "Add video [Title]" → Save 4 files, edit Resources.tsx, commit, push, ask for VPN, deploy
- "Update [Page] content" → Edit page file, commit, push, ask for VPN, deploy
- "Email not working" → Diagnose, fix .env or code, commit, push, ask for VPN, deploy
- "Fix [problem]" → Diagnose, fix code, test locally, commit, push, ask for VPN, deploy
- "Add [Event] to map" → Get coordinates, edit Services.tsx, commit, push, run deploy.sh
- "Add video [Title]" → Save 4 files, edit Resources.tsx, commit, push, run deploy.sh
- "Update [Page] content" → Edit page file, commit, push, run deploy.sh
- "Email not working" → Diagnose, fix .env or code, commit, push, run deploy.sh
- "Fix [problem]" → Diagnose, fix code, test locally, commit, push, run deploy.sh
### AI Never Asks User To:
- ❌ Run git commands
@ -392,8 +384,7 @@ API_URL=http://localhost:804
- ✅ Test locally when possible
- ✅ Commit with clear messages
- ✅ Push to Git repository
- ✅ Ask user to connect VPN before deployment
- ✅ Deploy to production via SSH (once VPN connected)
- ✅ Deploy to production via `./deploy.sh` (handles VPN and everything automatically)
- ✅ Verify changes are live
- ✅ Report completion simply