Complete CI/CD pipeline configurations for 4 enterprise-grade platforms, enabling automated testing, building, security scanning, and deployment to production environments.
Type: Declarative Pipeline
Location: Root directory
Repository: Git/GitHub
pipeline {
agent any
options { /* build settings */ }
parameters { /* user inputs */ }
environment { /* shared variables */ }
stages {
stage('Checkout') { /* Get code */ }
stage('Install Dependencies') { /* Setup */ }
stage('Code Quality') { /* Lint, Security, Dependencies */ }
stage('Unit Tests') { /* Test suite */ }
stage('Integration Tests') { /* E2E */ }
stage('Build Docker Image') { /* Container */ }
stage('Container Security Scan') { /* Trivy */ }
stage('Push Docker Image') { /* Registry */ }
stage('Deploy to Dev') { /* Dev environment */ }
stage('Deploy to Staging') { /* Staging env */ }
stage('Deploy to Production') { /* Prod with approval */ }
stage('Performance Tests') { /* Load testing */ }
}
post { /* Reports, notifications */ }
}Key Features:
- Declarative syntax for readability
- Parallel stages for speed
- Environment-based parameters
- Conditional deployments (branch-based)
- Blue-green deployment strategy
- Test result publishing
- Artifact archiving
- Slack notifications
Best For: Enterprise deployments, maximum control, custom workflows
Type: CircleCI Configuration (v2.1)
Location: .circleci/ directory
Cloud Platform: CircleCI.com
version: 2.1
orbs:
docker: circleci/docker@2.1.4
kubernetes: circleci/kubernetes@1.3.1
codecov: codecov/codecov@3.2.4
executors:
python: { ... }
python-with-services: { ... }
docker-build: { ... }
commands:
install-dependencies: { ... }
run-linting: { ... }
run-security-scan: { ... }
run-unit-tests: { ... }
run-integration-tests: { ... }
build-docker-image: { ... }
scan-docker-image: { ... }
push-docker-image: { ... }
deploy-to-kubernetes: { ... }
run-smoke-tests: { ... }
jobs:
checkout-code: { ... }
lint-and-format: { ... }
security-checks: { ... }
unit-tests: { ... }
integration-tests: { ... }
build-image: { ... }
push-image: { ... }
deploy-staging: { ... }
deploy-production: { ... }
performance-tests: { ... }
workflows:
build-test-deploy: { ... }Key Features:
- Reusable commands (DRY principle)
- Multiple executors (Python, Docker)
- Docker and Kubernetes orbs
- Codecov integration
- Parallel job execution
- Approval workflows
- Service integration (PostgreSQL, Redis)
- Automatic scaling
- Built-in caching
Best For: Small-medium teams, Docker-heavy workflows, easy setup
Type: Travis CI Configuration
Location: Root directory
Cloud Platform: Travis-ci.com
language: python
python:
- "3.9"
- "3.10"
- "3.11"
stages:
- test
- build
- deploy
services:
- postgresql
- redis-server
env:
matrix:
- PYTHON_VERSION=3.9 TEST_SUITE=unit
- PYTHON_VERSION=3.10 TEST_SUITE=unit
- PYTHON_VERSION=3.11 TEST_SUITE=unit
- PYTHON_VERSION=3.11 TEST_SUITE=integration
jobs:
include:
- stage: test
name: "Code Quality Checks"
- stage: test
name: "Security Scanning"
- stage: test
name: "Unit Tests"
- stage: test
name: "Integration Tests"
- stage: build
name: "Build Docker Image"
- stage: build
name: "Container Security Scan"
- stage: build
name: "Push Docker Image"
- stage: deploy
name: "Deploy to Staging"
- stage: deploy
name: "Deploy to Production"
notifications:
email:
on_success: always
on_failure: always
slack:
secure: "ENCRYPTED_WEBHOOK"Key Features:
- Matrix testing (multiple Python versions)
- Service integration (PostgreSQL, Redis)
- Multiple stages (test, build, deploy)
- Branch-based workflows
- Build artifacts
- Coverage reporting
- Email and Slack notifications
- Encrypted secrets
Best For: GitHub projects, open-source, simple workflows
Type: Azure DevOps Pipeline (YAML)
Location: Root directory
Cloud Platform: dev.azure.com
trigger:
- main
- develop
- staging
- feature/*
pool:
vmImage: 'ubuntu-latest'
variables:
dockerRegistryServiceConnection: 'docker-registry-connection'
imageRepository: 'aiplatform/sdk'
dockerfilePath: '$(Build.SourcesDirectory)/Dockerfile'
stages:
- stage: Build
jobs:
- job: BuildAndTest
steps: { ... }
- stage: Security
jobs:
- job: SecurityScan
steps: { ... }
- stage: Test
jobs:
- job: UnitTests
steps: { ... }
- job: IntegrationTests
steps: { ... }
- stage: Docker
jobs:
- job: BuildDockerImage
steps: { ... }
- job: ScanDockerImage
steps: { ... }
- job: PushDockerImage
steps: { ... }
- stage: Deploy
jobs:
- deployment: DeployToStaging
steps: { ... }
- deployment: DeployToProduction
strategy:
runOnce:
preDeploy: { ... }
deploy: { ... }
postDeploy: { ... }
- stage: Performance
jobs:
- job: PerformanceTest
steps: { ... }Key Features:
- Multi-stage pipeline architecture
- Pre/deploy/post deployment hooks
- Approval gates (production only)
- Kubernetes manifest deployment
- Service connections
- Variable groups
- Environment-based configuration
- Container Registry integration
- Comprehensive artifact publishing
Best For: Enterprise, Microsoft ecosystem, Azure infrastructure
Comprehensive Guide
Sections:
-
Overview
- Pipeline stages explained
- Architecture overview
-
Platform Comparison
- Jenkins (pros/cons, cost, setup time)
- CircleCI (pros/cons, cost, setup time)
- Travis CI (pros/cons, cost, setup time)
- Azure DevOps (pros/cons, cost, setup time)
-
Detailed Setup for Each Platform
- Prerequisites and installation
- Initial configuration
- Required plugins/extensions
- Credentials setup
- Pipeline configuration
- Webhook setup
- Environment variables
-
Best Practices
- Branching strategy
- Environment-specific config
- Secrets management
- Docker best practices
- Testing strategy
- Build caching
- Parallel execution
- Artifact management
- Notifications
- Monitoring
-
Security Considerations
- Secrets management
- Code security scanning
- Supply chain security
- Access control
- Network security
-
Troubleshooting
- Common issues and solutions
- Debug mode
- Log collection
- Performance optimization
-
Resources
- Official documentation links
- Community resources
Step-by-Step Setup Guide
Sections:
-
Quick Start Summary Table
- Platform comparison
- Setup time estimates
- Free tier information
- Best use cases
-
Jenkins Setup
- Installation (Docker recommended)
- Initial configuration
- Plugin installation
- Credentials setup
- Pipeline job creation
- GitHub webhook
-
CircleCI Setup
- Account creation
- Repository selection
- Environment variables
- Context creation
- Configuration validation
- Build triggering
-
Travis CI Setup
- Account creation
- Repository enabling
- Environment variables
- Secret encryption
- Configuration validation
- Build status badge
-
Azure DevOps Setup
- Project creation
- Pipeline creation
- Service connections setup
- Variable groups
- Environment creation
- Pipeline verification
-
Environment Configuration
- .env file examples
- Environment loading
- Configuration management
-
Credentials Setup
- Docker Registry
- Kubernetes access
- GitHub tokens
- Slack webhooks
-
Test Configuration
- conftest.py (pytest fixtures)
- pytest.ini (configuration)
- tox.ini (multi-version testing)
-
Docker Configuration
- .dockerignore
- Multi-stage Dockerfile
-
Security Best Practices
- Secrets rotation
- Code scanning
- Container scanning
- Audit logging
-
Monitoring & Alerts
- Slack notifications
- Email alerts
- Dashboard setup
-
Troubleshooting
- Build timeouts
- Authentication failures
- Storage issues
- Networking problems
┌─────────────────────────────────────────────────────┐
│ Code Push (Git) │
└──────────────────┬──────────────────────────────────┘
│
┌─────────▼─────────┐
│ Checkout Code │
└────────┬──────────┘
│
┌─────────────▼──────────────┐
│ Parallel Quality Checks │
│ ├─ Lint (Flake8) │
│ ├─ Format (Black) │
│ ├─ Security (Bandit) │
│ └─ Dependencies (Safety) │
└───────────┬────────────────┘
│
┌───────────▼──────────┐
│ Testing │
│ ├─ Unit Tests │
│ └─ Integration │
└──────────┬───────────┘
│
┌──────────▼──────────┐
│ Docker Build │
│ (Multi-stage) │
└──────────┬──────────┘
│
┌──────────▼──────────────┐
│ Container Security │
│ Scan (Trivy) │
└──────────┬──────────────┘
│
┌──────────▼──────────┐
│ Push to Registry │
│ (if main/develop) │
└──────────┬──────────┘
│
┌──────────▼──────────────┐
│ Deploy to Staging │
│ (if develop) │
└──────────┬──────────────┘
│
┌──────────▼──────────────┐
│ Smoke Tests │
│ Health Checks │
└──────────┬──────────────┘
│
┌──────────▼──────────────┐
│ Manual Approval │
│ (Production Only) │
└──────────┬──────────────┘
│
┌──────────▼──────────────┐
│ Deploy to Production │
│ Blue-Green Strategy │
└──────────┬──────────────┘
│
┌──────────▼──────────────┐
│ Health Verification │
│ Post-deploy Tests │
└──────────┬──────────────┘
│
┌──────────▼──────────────┐
│ Performance Testing │
│ (Load Testing) │
└──────────┬──────────────┘
│
┌──────────▼──────────────┐
│ Reports & Artifacts │
│ ├─ Test Results │
│ ├─ Coverage Report │
│ ├─ Security Report │
│ └─ Performance Report │
└─────────────────────────┘
Code Quality Stage
├─ Flake8 - Python style violations
├─ Black - Code formatting
├─ Bandit - Python code security
├─ Safety - Vulnerable dependencies
└─ pip-audit - Comprehensive audit
Container Stage
├─ Dockerfile linting
├─ Base image security
├─ Trivy - Image vulnerability scanning
└─ Registry security checks
Deployment Stage
├─ RBAC verification
├─ Network policies
├─ Secrets encryption
└─ Audit logging
Unit Tests
├─ aiplatform/core.py
├─ aiplatform/quantum.py
├─ aiplatform/vision.py
├─ aiplatform/genai.py
├─ aiplatform/federated.py
└─ Coverage target: 80%+
Integration Tests
├─ API endpoints
├─ Database operations
├─ Cache integration
├─ External services
└─ Timeout: 300 seconds
Smoke Tests (Post-Deployment)
├─ Service health check
├─ API availability
├─ Database connectivity
└─ Cache connectivity
Performance Tests
├─ Load testing (100 users)
├─ Spike testing
├─ Duration: 5 minutes
└─ Tools: Locust
- Branch:
develop - Trigger: Automatic
- Approval: None required
- Testing: Full suite
- Notification: Team Slack
- Branch:
staging - Trigger: Automatic
- Approval: None required
- Testing: Full + smoke
- Notification: Team Slack
- Branch:
main - Trigger: Manual (tag)
- Approval: Required (DevOps team)
- Testing: Full + health checks
- Notification: Team Slack + email
- Strategy: Blue-green deployment
DOCKER_USERNAME- Registry usernameDOCKER_PASSWORD- Registry password (encrypted)KUBECONFIG_STAGING- Base64-encoded kubeconfigKUBECONFIG_PRODUCTION- Base64-encoded kubeconfig
GITHUB_TOKEN- GitHub API accessSLACK_WEBHOOK_URL- Slack notificationsEMAIL_TO- Failure notificationsAPP_ENV- Environment name
All platforms collect and preserve:
- JUnit test results (XML)
- Code coverage reports (HTML, XML)
- Security scan reports (JSON)
- Performance test results (HTML)
- Container scan reports (JSON)
- Build logs (artifacts)
- Docker images (registry)
- Build started
- Build succeeded
- Build failed
- Deployment started
- Deployment completed
- Security issue detected
- Build failures (on-demand)
- Deployment status
- Security alerts
- Jenkins: Blue Ocean UI
- CircleCI: Web dashboard
- Travis CI: Web dashboard
- Azure DevOps: Pipeline insights
| Feature | Jenkins | CircleCI | Travis CI | Azure DevOps |
|---|---|---|---|---|
| Cloud | Self-hosted | Yes | Yes | Yes |
| Cost | Free | $20-200/mo | $69-129/mo | Free (public) |
| Setup | 2-4h | 15 min | 10 min | 30 min |
| Configuration | Jenkinsfile | YAML | YAML | YAML |
| Parallelization | Yes | Yes | Limited | Yes |
| Approval Gates | Yes | Yes | Limited | Yes |
| Docker Support | Plugin | Native | Docker | Task |
| Kubernetes | Plugin | Orb | Manual | Task |
| Free Tier | Full | 6,000 min/mo | Open-source | Unlimited (public) |
| Enterprise Ready | Best | Good | Limited | Best |
-
Read Documentation
- Start with CI_CD_PLATFORMS.md
- Review platform comparison
- Choose your platform
-
Follow Setup Guide
- Read CI_CD_SETUP.md
- Follow step-by-step instructions
- Configure credentials securely
-
Test Configuration
- Commit configuration files
- Push to feature branch
- Watch pipeline execute
- Review test results
-
Enable Notifications
- Configure Slack webhook
- Set up email alerts
- Configure approvers
-
Optimize Pipeline
- Monitor execution time
- Enable caching
- Parallelize where possible
- Archive relevant artifacts
Status: ✅ Production Ready
Last Updated: December 2025
Version: 1.0