Skip to main content
Glama
bootstrap-workflow-guide-for-users.mdβ€’17.8 kB
# Bootstrap Deployment Workflow - User Guide > **πŸ‘‹ Welcome!** This guide explains what happens when you run the bootstrap tool and how to use the generated scripts. --- ## 🎯 What You'll Get When you call `bootstrap_validation_loop`, the tool will: 1. βœ… Detect your deployment platform (Kubernetes, Docker, OpenShift, etc.) 2. βœ… Generate deployment scripts customized for your platform 3. βœ… Create an ADR documenting your deployment plan 4. βœ… Track all resources so you can clean them up later 5. βœ… Give you validation scripts to verify everything works ## πŸ“Š Visual Workflow - What Happens Step by Step ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Step 1: You Call the Tool β”‚ β”‚ β”‚ β”‚ You: "bootstrap_validation_loop" β”‚ β”‚ Tool: "Let me detect your platform..." β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ↓ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Step 2: Platform Detection β”‚ β”‚ β”‚ β”‚ Tool looks at your files: β”‚ β”‚ β€’ Found kubernetes.yaml β†’ "You're using Kubernetes!" β”‚ β”‚ β€’ Found Dockerfile β†’ "You have Docker too!" β”‚ β”‚ β€’ Confidence: 92% sure it's Kubernetes β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ↓ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Step 3: Load Best Practices β”‚ β”‚ β”‚ β”‚ Tool: "Loading Kubernetes best practices..." β”‚ β”‚ β€’ Official documentation: kubernetes.io β”‚ β”‚ β€’ Deployment steps: 6 phases β”‚ β”‚ β€’ Validation checks: 5 critical checks β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ↓ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Step 4: Start Tracking Resources β”‚ β”‚ β”‚ β”‚ Tool: "Creating SystemCard to track everything..." β”‚ β”‚ β€’ Namespace: myapp βœ“ β”‚ β”‚ β€’ Deployment: myapp βœ“ β”‚ β”‚ β€’ Service: myapp βœ“ β”‚ β”‚ β”‚ β”‚ (This lets you clean up everything later!) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ↓ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Step 5: Generate Your Deployment Plan β”‚ β”‚ β”‚ β”‚ Tool creates an ADR document with: β”‚ β”‚ βœ“ What platform you're using β”‚ β”‚ βœ“ What files you need (deployment.yaml, etc.) β”‚ β”‚ βœ“ What environment variables are required β”‚ β”‚ βœ“ Step-by-step deployment instructions β”‚ β”‚ βœ“ How to validate it worked β”‚ β”‚ βœ“ How to clean up when done β”‚ β”‚ β”‚ β”‚ File: docs/adrs/bootstrap-deployment-{timestamp}.md β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ↓ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Step 6: Generate Deployment Scripts β”‚ β”‚ β”‚ β”‚ Tool creates 3 scripts for you: β”‚ β”‚ β”‚ β”‚ πŸ“ bootstrap.sh β”‚ β”‚ β†’ Deploys your app automatically β”‚ β”‚ β”‚ β”‚ πŸ“ validate_bootstrap.sh β”‚ β”‚ β†’ Checks if deployment worked β”‚ β”‚ β”‚ β”‚ πŸ“ cleanup.sh β”‚ β”‚ β†’ Removes everything cleanly β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ↓ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Step 7: You're Ready to Deploy! β”‚ β”‚ β”‚ β”‚ Tool: "βœ… Bootstrap complete! Here's what to do next:" β”‚ β”‚ β”‚ β”‚ 1. Review the ADR in docs/adrs/ β”‚ β”‚ 2. Run ./bootstrap.sh to deploy β”‚ β”‚ 3. Run ./validate_bootstrap.sh to verify β”‚ β”‚ 4. When done, run ./cleanup.sh to remove everything β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` ## πŸ“ Files Created in Your Project After running the tool, you'll see these new files: ``` your-project/ β”œβ”€β”€ docs/ β”‚ └── adrs/ β”‚ └── bootstrap-deployment-2025-01-23.md ← Your deployment plan β”‚ β”œβ”€β”€ bootstrap.sh ← Deploy script (run this!) β”œβ”€β”€ validate_bootstrap.sh ← Validation script β”œβ”€β”€ cleanup.sh ← Cleanup script └── .system-card.json ← Resource tracking (internal use) ``` ## πŸš€ How to Use the Generated Scripts ### 1️⃣ First: Read Your ADR ```bash # Open and read the generated ADR cat docs/adrs/bootstrap-deployment-*.md ``` **What to look for:** - βœ… Is Kubernetes the right platform? (or Docker, etc.) - βœ… Do you have all required files? - βœ… Are all environment variables set? - βœ… Do the deployment steps make sense? ### 2️⃣ Second: Run Bootstrap Script ```bash # Make sure you're connected to your cluster kubectl cluster-info # or: docker ps # Deploy your application ./bootstrap.sh ``` **What this does:** ``` Phase 1: Check prerequisites (kubectl installed, cluster accessible) ↓ Phase 2: Create namespace (myapp) ↓ Phase 3: Create secrets (from your .env file) ↓ Phase 4: Deploy application (pods, services) ↓ Phase 5: Deploy ingress (if needed) ↓ Phase 6: Wait for everything to be ready ↓ Done! βœ… ``` **Watch the output:** ``` ======================================== Bootstrap Deployment - kubernetes Pattern: Kubernetes ======================================== Starting Phase 1: Prerequisites Validation β†’ Verify kubectl is installed kubectl version --client β†’ Verify cluster connectivity kubectl cluster-info βœ“ Phase 1 complete Starting Phase 2: Namespace Setup β†’ Create namespace kubectl create namespace myapp βœ“ Phase 2 complete ... ======================================== βœ… Bootstrap deployment complete! ======================================== ``` ### 3️⃣ Third: Validate Deployment ```bash # Check if everything deployed correctly ./validate_bootstrap.sh ``` **What this checks:** - βœ… Can we connect to the cluster? - βœ… Is the namespace created? - βœ… Are all pods running? - βœ… Does the service have endpoints? - βœ… Is the application responding? **Success looks like:** ``` ======================================== Bootstrap Validation ======================================== Checking: Cluster Connection βœ… PASSED: Cluster Connection Checking: Deployment Ready βœ… PASSED: Deployment Ready Checking: Service Has Endpoints βœ… PASSED: Service Has Endpoints Checking: Pods Running βœ… PASSED: Pods Running ======================================== βœ… All validation checks passed! ======================================== ``` **If something fails:** ``` Checking: Deployment Ready ❌ FAILED: Deployment Ready Some pods are not in Running state Remediation steps: - Check pod status: kubectl describe pod <pod-name> - View pod logs: kubectl logs <pod-name> - Check resource limits and requests ``` ### 4️⃣ Fourth: When Done - Cleanup ```bash # Remove everything cleanly ./cleanup.sh ``` **What this removes:** ``` Phase 1: Delete application (deployments, services) ↓ Phase 2: Delete secrets ↓ Phase 3: Delete namespace ↓ Done! Everything cleaned up βœ… ``` ## πŸ” Understanding the SystemCard **What is SystemCard?** SystemCard is like a "shopping list" that tracks everything the tool creates for you. This way, when you clean up, it knows exactly what to delete. **What it tracks:** ```json { "resources": [ "namespace: myapp", "deployment: myapp", "service: myapp", "secret: app-secrets" ] } ``` **Why this matters:** ❌ Without SystemCard: ```bash # You have to remember everything you created kubectl delete deployment myapp kubectl delete service myapp kubectl delete secret app-secrets kubectl delete namespace myapp # Did I forget anything? πŸ€” ``` βœ… With SystemCard: ```bash # Just run cleanup.sh - it knows everything! ./cleanup.sh # All done! Nothing left behind βœ… ``` ## 🎬 Complete Example Walkthrough Let's say you're deploying a Node.js app to Kubernetes. ### Before You Start **What you have:** ``` my-nodejs-app/ β”œβ”€β”€ src/ β”‚ └── index.js β”œβ”€β”€ Dockerfile β”œβ”€β”€ deployment.yaml ← Kubernetes manifest β”œβ”€β”€ service.yaml ← Kubernetes service └── .env ← Environment variables ``` ### Step 1: Call the Bootstrap Tool ```bash # In Claude or your MCP client "Run bootstrap_validation_loop for my project" ``` **Tool responds:** ``` πŸ” Detecting platform... πŸ“‹ Found: Kubernetes (92% confidence) βœ… Loaded: Kubernetes validated pattern πŸ“ Generated: bootstrap-deployment-2025-01-23.md πŸ“ Generated: bootstrap.sh πŸ“ Generated: validate_bootstrap.sh πŸ“ Generated: cleanup.sh ``` ### Step 2: Review the Plan ```bash cat docs/adrs/bootstrap-deployment-2025-01-23.md ``` **You see:** - Platform: Kubernetes βœ“ - Required files: deployment.yaml βœ“, service.yaml βœ“, .env βœ“ - Environment variables: DATABASE_URL, JWT_SECRET - 6 deployment phases with commands - 5 validation checks **You think:** "Looks good! Let's deploy!" ### Step 3: Deploy ```bash # First, make sure you're connected to your cluster kubectl cluster-info # Output: Kubernetes control plane is running at https://... # Now deploy ./bootstrap.sh ``` **You see:** ``` ======================================== Bootstrap Deployment - kubernetes ======================================== Phase 1: Prerequisites Validation βœ“ kubectl is installed βœ“ Cluster is accessible Phase 2: Namespace Setup βœ“ Created namespace: myapp Phase 3: Secrets βœ“ Created secrets from .env Phase 4: Application Deployment βœ“ Deployment created: myapp βœ“ Service created: myapp Phase 5: Waiting for pods... βœ“ Pods are running (3/3) ======================================== βœ… Bootstrap complete! (took 2m 34s) ======================================== ``` ### Step 4: Validate ```bash ./validate_bootstrap.sh ``` **You see:** ``` Checking: Cluster Connection βœ… PASSED Checking: Namespace Exists βœ… PASSED Checking: Deployment Ready βœ… PASSED Checking: Service Has Endpoints βœ… PASSED Checking: Pods Running βœ… PASSED βœ… All 5 checks passed! Your app is live! ``` ### Step 5: Access Your App ```bash # Get the service IP kubectl get service myapp # Output: # NAME TYPE EXTERNAL-IP PORT(S) # myapp LoadBalancer 203.0.113.42 80:30123/TCP # Open in browser open http://203.0.113.42 ``` **πŸŽ‰ Your app is live!** ### Step 6: Later - Cleanup ```bash # When you're done testing ./cleanup.sh ``` **You see:** ``` 🧹 Starting deployment cleanup... Phase 1: Delete application βœ“ Deleted deployment: myapp βœ“ Deleted service: myapp Phase 2: Delete secrets βœ“ Deleted secret: app-secrets Phase 3: Delete namespace βœ“ Deleted namespace: myapp βœ… Cleanup complete! (took 45s) Nothing left behind - all resources removed. ``` ## πŸ€” Common Questions ### Q: Do I need to understand all the internals? **A:** No! You just need to: 1. Read the generated ADR 2. Run `./bootstrap.sh` 3. Run `./validate_bootstrap.sh` 4. Use `./cleanup.sh` when done The tool handles all the complexity. ### Q: What if I want to customize the deployment? **A:** You can edit the generated scripts! They're just bash scripts with clear phases. Or, modify your deployment.yaml and re-run the tool. ### Q: Can I use this in CI/CD? **A:** Yes! Example: ```yaml # .github/workflows/deploy.yml - name: Deploy to Kubernetes run: | ./bootstrap.sh ./validate_bootstrap.sh ``` ### Q: What if validation fails? **A:** The validation script tells you exactly what failed and how to fix it. Example: ``` ❌ FAILED: Deployment Ready Remediation steps: - Check pod status: kubectl describe pod <pod-name> - View pod logs: kubectl logs <pod-name> ``` Follow the remediation steps, then re-run validation. ### Q: Can I deploy to multiple environments? **A:** Yes! The tool accepts `targetEnvironment` parameter: ```typescript bootstrap_validation_loop({ targetEnvironment: "production" // or "staging", "development" }) ``` This generates environment-specific ADRs and scripts. ### Q: What platforms are supported? The tool auto-detects: - βœ… Kubernetes - βœ… OpenShift - βœ… Docker / Docker Compose - βœ… Firebase - βœ… AWS - βœ… More being added! If your platform isn't supported, the tool uses AI to generate a deployment plan. ## πŸŽ“ Pro Tips ### Tip 1: Read the ADR First The ADR has **everything** you need to know: - What platform was detected - What files you need - What could go wrong - How to fix problems ### Tip 2: Run Validation Often ```bash # After deployment ./validate_bootstrap.sh # After making changes ./validate_bootstrap.sh # Before committing ./validate_bootstrap.sh ``` ### Tip 3: Keep Scripts in Git ```bash git add bootstrap.sh validate_bootstrap.sh cleanup.sh git commit -m "Add deployment automation" ``` Now your whole team can use them! ### Tip 4: Use Cleanup in CI/CD ```yaml # Test workflow - name: Deploy test environment run: ./bootstrap.sh - name: Run tests run: npm test - name: Cleanup test environment run: ./cleanup.sh ``` This gives you clean test environments every time. ### Tip 5: Check SystemCard ```bash # See what resources are being tracked cat .system-card.json | jq . ``` This shows you exactly what will be deleted during cleanup. ## πŸ“š Next Steps 1. **Run the tool** and get your deployment scripts 2. **Read your ADR** to understand the plan 3. **Deploy** with `./bootstrap.sh` 4. **Validate** with `./validate_bootstrap.sh` 5. **Use in CI/CD** for automated deployments ## πŸ†˜ Need Help? - **ADR unclear?** Open an issue: [GitHub Issues](https://github.com/tosin2013/mcp-adr-analysis-server/issues) - **Validation failed?** Check the remediation steps in the validation output - **Want to customize?** Edit the generated scripts - they're just bash! - **Found a bug?** Please report it so we can improve! --- **Remember:** The tool does the hard work of detecting your platform, finding best practices, and generating scripts. You just run them! πŸš€ **Generated by**: MCP ADR Analysis Server v2.1.11 **Documentation**: https://github.com/tosin2013/mcp-adr-analysis-server/tree/main/docs

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tosin2013/mcp-adr-analysis-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server