deployment-pipeline-design – skill DevOps & Hạ tầng cho agent AI
Các mô hình kiến trúc cho pipeline CI/CD nhiều giai đoạn với cổng phê duyệt và chiến lược triển khai.
Cài skill deployment-pipeline-design bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/deployment-pipeline-design-cb212.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /deployment-pipeline-design – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/deployment-pipeline-design-cb212.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $deployment-pipeline-design – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/deployment-pipeline-design-cb212.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /deployment-pipeline-design – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/deployment-pipeline-design-cb212.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /deployment-pipeline-design – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Deployment Pipeline Design
Architecture patterns for multi-stage CI/CD pipelines with approval gates and deployment strategies.
Do not use this skill when
- The task is unrelated to deployment pipeline design
- You need a different domain or tool outside this scope
Instructions
- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
Purpose
Design robust, secure deployment pipelines that balance speed with safety through proper stage organization and approval workflows.
Use this skill when
- Design CI/CD architecture
- Implement deployment gates
- Configure multi-environment pipelines
- Establish deployment best practices
- Implement progressive delivery
Pipeline Stages
Standard Pipeline Flow
┌─────────┐ ┌──────┐ ┌─────────┐ ┌────────┐ ┌──────────┐
│ Build │ → │ Test │ → │ Staging │ → │ Approve│ → │Production│
└─────────┘ └──────┘ └─────────┘ └────────┘ └──────────┘Detailed Stage Breakdown
1. Source - Code checkout
2. Build - Compile, package, containerize
3. Test - Unit, integration, security scans
4. Staging Deploy - Deploy to staging environment
5. Integration Tests - E2E, smoke tests
6. Approval Gate - Manual approval required
7. Production Deploy - Canary, blue-green, rolling
8. Verification - Health checks, monitoring
9. Rollback - Automated rollback on failure
Approval Gate Patterns
Pattern 1: Manual Approval
# GitHub Actions
production-deploy:
needs: staging-deploy
environment:
name: production
url: https://app.example.com
runs-on: ubuntu-latest
steps:
- name: Deploy to production
run: |
# Deployment commandsPattern 2: Delayed Deployment
# GitLab CI
deploy:production:
stage: deploy
script:
- deploy.sh production
environment:
name: production
when: delayed
start_in: 30 minutes
only:
- mainPattern 3: Multi-Approver
Configure the platform's actual protected-environment approval policy and verify who may approve or bypass it. For Azure, bind manual validation to the installed task version and its supported agentless job rather than placing it in an arbitrary deployment hook. Record required approvers and evidence; notifications alone are not approval.
Deployment Strategies
1. Rolling Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
spec:
replicas: 10
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 2
maxUnavailable: 1Characteristics:
- Gradual rollout
- Availability depends on readiness, capacity and compatible changes
- Easy rollback
- Best for most applications
2. Blue-Green Deployment
# Blue (current)
kubectl apply -f blue-deployment.yaml
kubectl patch service my-app --type merge -p '{"spec":{"selector":{"app":"my-app","version":"blue"}}}'
# Green (new)
kubectl apply -f green-deployment.yaml
# Test green environment
kubectl patch service my-app --type merge -p '{"spec":{"selector":{"app":"my-app","version":"green"}}}'
# Rollback if needed
kubectl patch service my-app --type merge -p '{"spec":{"selector":{"app":"my-app","version":"blue"}}}'Characteristics:
- Instant switchover
- Easy rollback
- Doubles infrastructure cost temporarily
- Good for high-risk deployments
3. Canary Deployment
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: my-app
spec:
replicas: 10
strategy:
canary:
steps:
- setWeight: 10
- pause: {duration: 5m}
- setWeight: 25
- pause: {duration: 5m}
- setWeight: 50
- pause: {duration: 5m}
- setWeight: 100Characteristics:
- Gradual traffic shift
- Risk mitigation
- Real user testing
- Requires service mesh or similar
4. Feature Flags
from flagsmith import Flagsmith
flagsmith = Flagsmith(environment_key="API_KEY")
if flagsmith.has_feature("new_checkout_flow"):
# New code path
process_checkout_v2()
else:
# Existing code path
process_checkout_v1()Characteristics:
- Deploy without releasing
- A/B testing
- Instant rollback
- Granular control
Pipeline Orchestration
Multi-stage implementation contract
Build once, record the commit and immutable artifact digest, run tests/security checks on that artifact, deploy to authorized staging, run integration checks, obtain configured production approval, then deploy that same digest with bounded progressive traffic. Each job must establish its own checkout, locked tools, scoped credentials and artifact transfer. Verify rollout and application metrics before promotion; do not immediately promote a canary and thereby skip its observation window. Notifications require an explicitly configured authorized recipient and destination.
Pipeline Best Practices
1. Fail fast - Run quick tests first
2. Parallel execution - Run independent jobs concurrently
3. Caching - Cache dependencies between runs
4. Artifact management - Store build artifacts
5. Environment parity - Keep environments consistent
6. Secrets management - Use secret stores (Vault, etc.)
7. Deployment windows - Schedule deployments appropriately
8. Monitoring integration - Track deployment metrics
9. Rollback automation - Auto-rollback on failures
10. Documentation - Document pipeline stages
Rollback Strategies
Automated Rollback
deploy-and-verify:
steps:
- name: Deploy new version
run: kubectl apply -f k8s/
- name: Wait for rollout
run: kubectl rollout status deployment/my-app
- name: Health check
id: health
run: |
for i in {1..10}; do
if curl -sf https://app.example.com/health; then
exit 0
fi
sleep 10
done
exit 1
- name: Rollback on failure
if: failure()
run: kubectl rollout undo deployment/my-appManual Rollback
# List revision history
kubectl rollout history deployment/my-app
# Rollback to previous version
kubectl rollout undo deployment/my-app
# Rollback to specific revision
kubectl rollout undo deployment/my-app --to-revision=3Monitoring and Metrics
Key Pipeline Metrics
- Deployment Frequency - How often deployments occur
- Lead Time - Time from commit to production
- Change Failure Rate - Percentage of failed deployments
- Mean Time to Recovery (MTTR) - Time to recover from failure
- Pipeline Success Rate - Percentage of successful runs
- Average Pipeline Duration - Time to complete pipeline
Integration with Monitoring
Define a measured baseline, minimum traffic, observation interval and justified thresholds. Query a verified metrics endpoint with bounded timeouts and validate the provider status, result shape and numeric values. Missing/empty/malformed metrics are an incomplete verification, never a healthy result. Stop promotion and escalate when verification is unavailable. A fixed sleep and a shell comparison cannot establish deployment health.
Approval and orchestration checklist
Bind the artifact to an immutable commit/image digest, verify the exact target and existing deploy identity, require protected environment approval for production, and record health criteria and an explicit rollback revision. Every job runs on its own checkout/runtime; transfer verified artifacts rather than assuming the previous runner filesystem remains available. These are schematic examples, not a complete credential or orchestration template. No unbundled playbook is needed.
Related Skills
github-actions-templates- For GitHub Actions implementationgitlab-ci-patterns- For GitLab CI implementationsecrets-management- For secrets handling
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Skill liên quan
- deployment-procedures – Nguyên tắc và cách ra quyết định khi triển khai production. Quy trình triển khai an…
- deployment-validation-config-validate – Kiểm tra cấu hình ứng dụng bằng schema, bài kiểm thử cấu hình, và kiểm tra bảo mật cũng…
- simpy – Xây dựng, kiểm tra và phân tích các mô phỏng sự kiện rời rạc có giới hạn, dựa trên tiến…
- devops-deploy – DevOps và triển khai ứng dụng — Docker, CI/CD với GitHub Actions, AWS Lambda, SAM…
- devops-pipeline-builder – Thiết kế và triển khai pipeline CI/CD, cấu hình Docker, chiến lược triển khai và tự động…
- devops-troubleshooter – Chuyên gia xử lý sự cố DevOps, chuyên ứng phó sự cố nhanh, gỡ lỗi nâng cao và…
- dns-management – Cấu hình DNS zone và record. Quản lý Route53, Cloud DNS và DNS tự host. Dùng khi thiết…
- docker-compose – Định nghĩa và chạy ứng dụng Docker nhiều container bằng Docker Compose.