Back to Development & Coding

DevOps Pipeline

CI/CD pipeline configuration for GitHub Actions, GitLab, Jenkins, and cloud platforms.

80% tokens saved
10hrs per pipeline saved
89% popularity

Quick Info

Version

2.0

Last Updated

2025-01

Difficulty

advanced

Category

Development & Coding

Use Cases

  • CI/CD setup
  • Deployment automation
  • Testing pipelines
  • Infrastructure as code

Features

  • Pipeline generation
  • Docker configs
  • Kubernetes manifests
  • Monitoring setup

System Prompt

You are a DevOps architect with extensive experience in CI/CD, infrastructure as code, container orchestration, and cloud platforms. You design robust automation pipelines that enable continuous delivery with confidence.

Main Prompt

Design a complete DevOps automation solution for the described application. Include CI/CD pipelines, infrastructure as code, monitoring, and deployment strategies.

## 🎯 Project Requirements
### Application Details:
[DESCRIBE_APPLICATION]

### Current State:
- Team Size: [NUMBER] developers
- Deployment Frequency: [DAILY/WEEKLY/MONTHLY]
- Tech Stack: [LANGUAGES_FRAMEWORKS]

## 🚀 Complete DevOps Solution

### CI/CD Pipeline

#### GitHub Actions Workflow
```yaml
name: Complete CI/CD Pipeline

on:
  push:
    branches: [main, develop]
  pull_request:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Setup environment
        uses: actions/setup-node@v4
        with:
          node-version: '20'
      - name: Install dependencies
        run: npm ci
      - name: Run tests
        run: npm test
      - name: Build application
        run: npm run build

  security-scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Run Trivy scan
        uses: aquasecurity/trivy-action@master
        with:
          scan-type: 'fs'
          scan-ref: '.'
      - name: Run Semgrep
        uses: returntocorp/semgrep-action@v1

  deploy:
    needs: [test, security-scan]
    runs-on: ubuntu-latest
    if: github.ref == 'refs/heads/main'
    steps:
      - name: Deploy to production
        run: |
          echo "Deploying to production"
          kubectl apply -f k8s/
```

### Infrastructure as Code

#### Terraform Configuration
```hcl
# main.tf
resource "aws_ecs_cluster" "main" {
  name = "production-cluster"
}

resource "aws_ecs_service" "app" {
  name            = "app-service"
  cluster         = aws_ecs_cluster.main.id
  task_definition = aws_ecs_task_definition.app.arn
  desired_count   = 3

  deployment_configuration {
    maximum_percent         = 200
    minimum_healthy_percent = 100
  }
}
```

### Kubernetes Deployment
```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: app
spec:
  replicas: 3
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      labels:
        app: myapp
    spec:
      containers:
      - name: app
        image: myapp:latest
        ports:
        - containerPort: 8080
        resources:
          requests:
            memory: "256Mi"
            cpu: "250m"
          limits:
            memory: "512Mi"
            cpu: "500m"
```

### Monitoring Stack
- Prometheus for metrics collection
- Grafana for visualization
- AlertManager for alerting
- ELK stack for log aggregation

### Security Implementation
- Container scanning with Trivy
- SAST with Semgrep
- Secrets management with Vault
- Network policies for pod isolation

Variables

DESCRIBE_APPLICATIONRequired

Type and architecture of application

Example: Microservices API, React SPA

LANGUAGES_FRAMEWORKSRequired

Technology stack

Example: Node.js, Python, Java

Pro Tips

  • •Specify current deployment challenges
  • •Include compliance requirements
  • •Mention team's DevOps experience level
More Development & Coding Agents