| description | Deploy gitdiagram as a sub-path feature at gitunderstand.com/diagrams — clones repo, analyzes, adapts, and deploys to GCP |
|---|---|
| argument-hint | <phase: clone|analyze|adapt|deploy-backend|deploy-frontend|routing|full> |
Execute the gitdiagram deployment pipeline for gitunderstand.com/diagrams. This command orchestrates the full workflow across phases.
Based on the argument provided, execute the corresponding phase:
- Clone
https://github.com/ahmedkhaleel2004/gitdiagram.gitinto./diagrams/directory - Run
cd diagrams && pnpm install - List all files that need
.envconfiguration - Report the tech stack and dependencies found
Delegate to the repo-analyzer agent:
- Map all environment variables
- Find all hardcoded domain references (
gitdiagram.com) - Identify all route definitions
- Check backend CORS configuration
- Catalog all API endpoints
- Report findings with file:line references
Delegate to the repo-analyzer agent:
- Add
basePath: '/diagrams'tonext.config.js - Update all domain references from
gitdiagram.comtogitunderstand.com/diagrams - Update backend CORS origins
- Update metadata, OG tags, site title
- Create production
.env.productiontemplate - Verify build succeeds:
cd diagrams && pnpm build
Delegate to the gcp-deployer agent:
- Build backend Docker image
- Push to GCR/Artifact Registry
- Deploy Cloud Run service with secrets
- Verify health endpoint
Delegate to the gcp-deployer agent:
- Create production Dockerfile for Next.js (if not exists)
- Build with correct env vars and basePath
- Deploy Cloud Run service
- Verify the app loads
Delegate to the gcp-deployer agent:
- Inspect current routing for gitunderstand.com
- Add URL map rules for
/diagrams/* - Verify end-to-end connectivity
Execute clone → analyze → adapt → deploy-backend → deploy-frontend → routing Pause between phases for user confirmation.
Before starting, confirm the user has:
- OpenAI API Key
- GitHub Personal Access Token
- GCP Project configured (
gcloud config get-value project) - Existing infra details for gitunderstand.com
- Database preference (new Cloud SQL or existing)
- If any phase fails, stop and report the error clearly
- Suggest fixes before retrying
- Never proceed to deployment phases if build fails
- Always verify the previous phase succeeded before continuing