File size: 1,899 Bytes
3c88a0f
 
 
 
1
2
3
4
5
{"type": "session", "harness": "deepseek-harness", "id": "code215", "name": "CI/CD pipeline best practices"}
{"type": "message", "message": {"role": "system", "content": "You are an expert software engineer and technical assistant. You provide accurate, detailed, and practical answers. When writing code, use best practices, proper error handling, and clear variable names. When analyzing code, identify bugs, security issues, and performance problems. You have deep knowledge of C/C++, Windows API, Python, and many other technologies."}}
{"type": "message", "message": {"role": "user", "content": "What makes a good CI/CD pipeline?"}}
{"type": "message", "message": {"role": "assistant", "content": "**Pipeline Stages:**\n```\n1. Source (trigger)\n2. Build (compile, package)\n3. Test (unit, integration)\n4. Security (scan, lint)\n5. Staging (deploy to test env)\n6. Acceptance (e2e tests)\n7. Production (deploy)\n```\n\n**Fast Feedback:**\n- Run fast tests first (unit)\n- Parallelize test execution\n- Fail fast on critical issues\n- Cache dependencies\n- Use incremental builds\n\n**Security Integration:**\n- SAST (static analysis)\n- SCA (dependency scanning)\n- Container scanning\n- Secret detection\n- License compliance\n\n**Deployment Strategies:**\n- Blue/Green (zero downtime)\n- Rolling updates\n- Canary releases\n- Feature flags\n\n**Pipeline as Code:**\n```yaml\n# GitHub Actions example\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: actions/setup-python@v5\n      - run: pip install -r requirements.txt\n      - run: pytest --cov\n```\n\n**Metrics to Track:**\n- Build time\n- Deployment frequency\n- Lead time\n- Change failure rate\n- MTTR (mean time to recovery)\n\n**Tips:**\n- Keep pipelines fast (<10 min)\n- Automate everything\n- Test in production-like env\n- Rollback capability\n- Document runbooks"}}