CI/CD Automation - Ant Colony Pipeline Manager
Manages CI/CD pipelines, deployment orchestration, and automated software delivery within the Codomyrmex ecosystem. This module provides ant colony-inspired resilience for continuous integration and deployment workflows.
Instructions
You are an expert in CI/CD automation, deployment orchestration, and software delivery pipelines. When working in the `ci_cd_automation` module, follow these guidelines:
1. Module Context & Purpose
This module manages CI/CD pipelines, deployment orchestration, and automated software delivery within the Codomyrmex ant-inspired workspacePrimary technologies: Python, CI/CD platforms (GitHub Actions, Jenkins), container orchestration, deployment strategies, monitoring systemsAlways consult the module's `README.md` for module-specific setup and usage instructionsSupplement (do not replace) the project's `general.cursorrules` unless explicitly overriding for module-specific reasons2. Project Structure Awareness
Pay close attention to these key files when working in this module:
`README.md` - Module overview, setup, and usage`API_SPECIFICATION.md` - Programmatic interfaces (functions, classes)`CHANGELOG.md` - All notable changes must be logged here`SECURITY.md` - Security considerations for CI/CD processes and deployments`requirements.txt` - Python dependencies`docs/` - In-depth documentation, technical overviews, tutorials`src/` or `ci_cd_automation/` - Core module logic`tests/` - Unit and integration tests`pipeline_manager.py` - Core pipeline management functionality`deployment_orchestrator.py` - Deployment orchestration logic`rollback_manager.py` - Rollback and recovery management`pipeline_monitor.py` - Pipeline monitoring and analytics3. Coding Standards
**Consistency**: Match existing coding styles, naming conventions, and architectural patterns within the module**Language**: Primarily Python - follow PEP 8 strictly**Type Hinting**: Use extensive type annotations for pipeline configurations and deployment parameters**Pipeline Design**: Pipeline definitions should be declarative, versionable, and support complex dependencies**Deployment Safety**: Implement comprehensive validation, health checks, and rollback capabilities**Monitoring Integration**: All pipeline and deployment activities must be logged and monitored4. Testing Requirements
All new features (deployment strategies, pipeline templates) and bug fixes MUST include tests in `tests/unit/` or `tests/integration/`Cover various pipeline scenarios, deployment strategies, and failure recovery pathsMock external CI/CD systems and deployment targets for deterministic test behaviorRun existing tests to ensure no regressions - refer to `ci_cd_automation/tests/README.md`5. Documentation Standards
Keep `README.md`, `API_SPECIFICATION.md`, and `docs/` meticulously up-to-dateDocument pipeline configurations, deployment strategies, and monitoring setup clearlyInclude practical examples of pipeline definitions and deployment workflowsUpdate `CHANGELOG.md` for all notable changes6. Module-Specific Considerations
**Security First**: Prioritize secret management and access controls in all pipeline and deployment processes**Reliability**: Implement comprehensive error handling, retries, and rollback mechanisms**Observability**: Ensure full logging and monitoring of all pipeline and deployment activities**Scalability**: Design for parallel execution and resource-efficient deployment strategies7. Pre-Commit Checklist
Before finalizing any changes:
1. Update all module-specific documentation
2. Verify all tests pass
3. Confirm pipelines execute correctly
4. Test that deployments handle failures gracefully
5. Validate integration with related modules (`build_synthesis`, `containerization`)
Example Usage
```python
Example: Define a declarative pipeline with rollback support
from ci_cd_automation import PipelineManager, DeploymentOrchestrator
pipeline = PipelineManager(
name="production-deploy",
stages=["build", "test", "deploy"],
rollback_enabled=True
)
orchestrator = DeploymentOrchestrator(
strategy="blue-green",
health_check_timeout=300,
auto_rollback=True
)
Execute with comprehensive monitoring
result = orchestrator.deploy(
pipeline=pipeline,
target="production",
monitor=True
)
```
Constraints
Never commit secrets or credentials - use secure secret managementAlways implement rollback capabilities for deployment operationsMock external systems in tests - never hit live CI/CD platforms during testingMaintain backward compatibility with existing pipeline definitionsFollow the ant colony philosophy: resilient, self-organizing, failure-tolerant systems