CI/CD और DevOps Automation

Docker, GitHub Actions, Nginx — एक instruction से production-level configuration

DevOps configuration, हर बार एक nightmare होता है

YAML hell + environment mismatch + configuration को hours लग जाते हैं

GitHub Actions के YAML में एक space गलत, सारा pipeline crash हो गया। Error message सिर्फ "syntax error", तुम सैकड़ों lines के YAML को stare करते हो अलग space को find करने के लिए।

"मेरे local में perfectly काम कर रहा है" — classic line। Docker image version गलत, environment variables pass नहीं हुए, port mapping reverse हो गई, हर deploy एक adventure बन जाता है।

Nginx configuration को internet से copy किया, HTTPS काम नहीं कर रहा, reverse proxy 502 दे रहा है, access log में सब 404 है। 3 hours खोज के पता चला कि proxy_pass में एक slash गायब है।

OpenClaw तुम्हारे लिए production-level configuration generate कर

Template paste-paste नहीं है, तुम्हारी project को समझ के customize है

OpenClaw तुम्हारी project structure को analyze करता है — कौन सी language, कौन सी framework, कौन से services, कौन से environment variables, फिर targeted configuration generate करता है।

Generated Dockerfile latest image को randomly pull नहीं करता। Multi-stage builds, image optimization, security best practices — सब को consider किया हुआ होता है।

GitHub Actions workflow भी सिर्फ npm test नहीं चलाता। Cache strategy, parallel tasks, conditional deployments, Secret management — production को जो चाहिए सब है। सबसे important — generated YAML का syntax बिल्कुल सही होता है।

DevOps Prompts, सीधे copy कर सकते हो

Docker, CI/CD, Nginx — तीन main चीज़ें, हर एक production-level configuration है।

Docker + docker-compose complete setup Golden instruction
इस Node.js project को analyze करके complete Docker configuration generate करो:

Dockerfile requirements:
1. Multi-stage builds (builder + production)
2. Alpine base image use करो, final image छोटी हो
3. Non-root user से run करो
4. Cache को properly use करो (पहले package.json COPY करो फिर npm install)
5. Healthcheck add करो

docker-compose.yml requirements:
1. App service + database (PostgreSQL) + Redis
2. Dev और prod environments को separate करो (profiles या override files से)
3. Data persistence के लिए volumes
4. Network isolation
5. Environment variables को .env से manage करो

.dockerignore और necessary documentation के साथ।
यह Prompt generate करने वाला Docker configuration production के लिए सही है, internet से copy किए हुए FROM node:latest tutorial version नहीं है। Multi-stage builds से image को 1GB से 100MB के नीचे ला सकते हो।
GitHub Actions CI/CD complete flow Golden instruction
इस project के लिए complete GitHub Actions CI/CD pipeline configure करो।

Workflow requirements:

1. CI (every push और PR पर trigger):
   - Code linting: ESLint / Prettier
   - Unit tests + coverage report
   - Build validation
   - Dependency security scan

2. CD (main में merge पर trigger):
   - Docker image build करके ECR में push करो
   - AWS ECS में (या EC2 में) deploy करो
   - Deploy के बाद smoke tests run करो
   - Failure पर auto-rollback करो

3. Optimization:
   - npm/pip caching से speed बढ़ा
   - Tests को parallel करो
   - Relevant file changes पर ही specific steps trigger करो

सभी secrets को GitHub Secrets से manage करो।
Complete CI/CD config hand से लिखने में कम से कम 12 hours लगते हैं, plus debugging। यह Prompt एक बार generate करता है, basically testing से चलता है, कुछ variable names change करने से बस।
Nginx reverse proxy + HTTPS + load balancing Advanced technique
Production-level Nginx configuration generate करो:

1. Reverse proxy:
   - Frontend static assets (/) → local directory
   - API requests (/api/) → backend service (upstream)
   - WebSocket support (/ws/)

2. HTTPS configuration:
   - Let's Encrypt certificate (Certbot auto-renewal)
   - HTTP को HTTPS पर auto-redirect करो
   - HSTS, OCSP Stapling
   - TLS 1.2+ only, secure cipher suites

3. Load balancing:
   - Upstream में multiple backend instances
   - Health checks
   - Least_conn strategy

4. Performance optimization:
   - Gzip compression
   - Static asset caching headers
   - Request rate limiting (DDoS protection)

Certbot installation और certificate request commands के साथ।
Nginx configuration सबसे ज़्यादा bugs होते हैं। proxy_pass के end में slash को या न करो, location matching priority, upstream health checks — AI ने सब pitfalls को avoid कर दिया है।

Configuration generation: OpenClaw vs hand-written YAML

Hand-written गलत नहीं है, लेकिन smarter तरीका है।

OpenClaw
  • Project structure के हिसाब से customize करता है, generic template नहीं
  • Security best practices को include करता है (non-root, Secret management, TLS)
  • Generated YAML का syntax guaranteed सही है, कोई space mismatch नहीं
  • एक Prompt से पूरा सब: Docker + CI/CD + Nginx
VS
Hand-written YAML / Internet से copy
  • Stack Overflow से copy किया तो version पुराना हो सकता है
  • Security config अक्सर miss हो जाता है, production में holes।
  • YAML spaces को adjust करने में hours लग जाते हैं
  • अलग-अलग से पिस किया गया code, अलग-अलग conflict हो सकते हैं

Real scenario: नई project DevOps from scratch setup

नई project को launch करना है, DevOps सिर्फ तुम हो
Backend Node.js + PostgreSQL + Redis, frontend React, Docker containers चाहिए, GitHub Actions CI/CD, Nginx reverse proxy, HTTPS। Boss कहते हैं एक हफ्ते में करो।
OpenClaw
तीन Prompts चलाए, Docker complete, CI/CD pipeline, Nginx configuration सब ready। आधे दिन project-specific variables को change करके, tests को चलाके। दूसरे दिन staging environment में deploy करने लगे, एक हफ्ते से पहले सब complete।
खुद से करना
Docker multi-stage build को research करने में ही 2 दिन लग गए, GitHub Actions caching को tune करने में एक दिन, Nginx HTTPS को configure करने में आधी रात तक। एक हफ्ता खत्म, CI में errors को fix कर रहे हैं। Boss progress पूछने लगा।

DevOps configuration tips

💡 Configuration generate हो जाए तो local में एक बार चला लो। Docker को `docker-compose up --build` से test करो, GitHub Actions को `act` से locally simulate करो।
🎯 OpenClaw को कहो config में detailed comments दे। 3 महीने बाद जब तुम config को modify करने जाओ, तो comment के लिए grateful होगे।
⚠️ Generation में अगर secrets/passwords आएं तो environment variables या Secret management से करो। Hardcode करना कभी मत करो। यह law है।
क्या ये केस आपके काम आया?