https://github.com/amandladev/python-pipeline-creator
A CLI tool for creating and managing CI/CD pipelines on AWS
https://github.com/amandladev/python-pipeline-creator
aws ci-cd code-deploy iac pipeline
Last synced: 6 months ago
JSON representation
A CLI tool for creating and managing CI/CD pipelines on AWS
- Host: GitHub
- URL: https://github.com/amandladev/python-pipeline-creator
- Owner: amandladev
- License: mit
- Created: 2025-09-16T03:39:27.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-09-16T04:12:32.000Z (7 months ago)
- Last Synced: 2025-09-16T06:23:36.808Z (7 months ago)
- Topics: aws, ci-cd, code-deploy, iac, pipeline
- Language: Python
- Homepage:
- Size: 21.5 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ Pipeline Creator CLI
**A powerful CLI tool for creating and managing enterprise-grade CI/CD pipelines on AWS with intelligent automation.**
[](https://www.python.org/downloads/)
[](https://aws.amazon.com/cdk/)
[](LICENSE)
## โจ Features
- ๐๏ธ **Smart Pipeline Generation** - Automated AWS CodePipeline creation with CDK
- ๐ฆ **Multi-Language Support** - Python, Node.js, React, and more
- ๐งช **Advanced Build Stages** - SonarQube, Snyk, Codecov, ESLint, Bandit integration
- ๐ง **Intelligent Notifications** - Slack, Email, Webhooks with smart alerting rules
- ๐ **Pipeline Templates** - Reusable templates for faster setup
- ๐ **Template Inheritance** - Extend and customize existing templates
- โ๏ธ **Interactive CLI** - User-friendly prompts and rich console output
- ๐ก๏ธ **Security First** - Built-in security scanning and best practices
## ๐ Quick Start
### Installation
```bash
# 1. Clone and setup
git clone
cd pipeline_creator
# 2. Create virtual environment
python -m venv .venv
source .venv/bin/activate # Mac/Linux
# or .venv\Scripts\activate # Windows
# 3. Install dependencies
pip install -e .
pip install aiohttp email-validator # For notifications
```
### Create Your First Pipeline
```bash
# 1. Initialize a new pipeline
pipeline init
# 2. Use a template for quick setup (optional)
pipeline templates use react-app -P app_name=my-app
# 3. Generate AWS infrastructure
pipeline generate
# 4. Deploy your pipeline
pipeline deploy
```
## ๐ Complete Command Reference
### Core Pipeline Commands
#### `pipeline init`
Initialize pipeline configuration in your project.
```bash
pipeline init # Interactive setup
pipeline init --name my-app # Quick setup with name
```
#### `pipeline generate`
Generate AWS CDK infrastructure files.
```bash
pipeline generate # Generate all infrastructure
pipeline generate --force # Overwrite existing files
```
#### `pipeline deploy`
Deploy your pipeline to AWS.
```bash
pipeline deploy # Deploy with confirmation
pipeline deploy --auto-approve # Skip confirmations
```
#### `pipeline status`
Check your pipeline status.
```bash
pipeline status # Show current status
pipeline status --detailed # Include execution history
```
#### `pipeline logs`
View pipeline logs.
```bash
pipeline logs # Latest execution logs
pipeline logs --build-id # Specific build logs
```
### ๐งช Extra Build Stages
#### `pipeline add-stage`
Add specialized build stages to your pipeline.
```bash
pipeline add-stage # Interactive stage selection
pipeline add-stage sonarqube # Add SonarQube analysis
pipeline add-stage snyk # Add security scanning
pipeline add-stage codecov # Add coverage reporting
pipeline add-stage docker # Add Docker build
```
**Available Stages:**
- ๐ **SonarQube Cloud** - Code quality analysis
- ๐ก๏ธ **Snyk Security** - Vulnerability scanning
- ๐ **Codecov** - Coverage reporting
- ๐ณ **Docker Build** - Container builds
- ๐งน **ESLint** - JavaScript/TypeScript linting
- ๐ **Bandit** - Python security linting
- โ๏ธ **Custom Stages** - Define your own build steps
### ๐ง Notification System
#### `pipeline notifications`
Intelligent notification management with smart alerting rules.
```bash
# Setup notifications
pipeline notifications setup # Interactive setup
pipeline notifications setup -c slack # Setup specific channel
# Check status
pipeline notifications status # View current config
# Test notifications
pipeline notifications test # Send test messages
# Disable notifications
pipeline notifications disable # Disable all channels
```
**Supported Channels:**
- ๐ง **Email** - HTML/text email notifications via SMTP
- ๐ข **Slack** - Rich webhook notifications with formatting
- ๐ **Webhooks** - Custom HTTP endpoints with JSON payloads
**Smart Features:**
- โก **Failure Alerts** - Always notify on pipeline failures
- ๐ **Recovery Notifications** - Alert when pipeline recovers
- ๐ **Spam Prevention** - Intelligent rules to reduce noise
- ๐ **Event History** - Track notification patterns
### ๐ Template System
#### `pipeline templates`
Powerful template system for reusable pipeline configurations.
```bash
# List available templates
pipeline templates list # All templates
pipeline templates list --category api # Filter by category
# Get template information
pipeline templates info react-app # Detailed template info
# Use templates
pipeline templates use react-app \
-P app_name=my-app \
-P test_coverage_threshold=90
# Create custom templates
pipeline templates create my-template \
--description "My custom pipeline" \
--category web-frontend \
--author "My Team"
# Template inheritance
pipeline templates extend react-app enhanced-react \
--description "Enhanced React template"
# Share templates
pipeline templates export react-app template.json
pipeline templates import-template template.json
```
**Predefined Templates:**
- ๐ **react-app** - Complete React application with S3 + CloudFront
- ๐ **python-api** - Python/FastAPI API with ECS Fargate
- ๐จ **nodejs-api** - Node.js/Express API with containers
**Template Categories:**
- `web-frontend` - Frontend applications
- `web-backend` - Backend services
- `api` - API services
- `microservice` - Microservices
- `mobile` - Mobile applications
- `data-processing` - Data pipelines
- `ml-ai` - Machine Learning workflows
## ๐ ๏ธ Prerequisites
- **Python 3.8+** with pip
- **AWS CLI** configured (`aws configure`)
- **Node.js 16+** (for AWS CDK)
- **Docker** (optional, for containerized builds)
## ๐ Project Structure
After initialization, your project will have:
```
your-project/
โโโ pipeline.json # Main pipeline configuration
โโโ .pipeline/
โ โโโ cdk/ # Generated CDK files
โ โโโ config.json # Internal configuration
โ โโโ templates/ # User templates (if any)
โโโ buildspec.yml # CodeBuild specification
```
## ๐ฏ Configuration Examples
### Basic Python API Pipeline
```json
{
"name": "my-python-api",
"project_type": "python",
"runtime": {
"language": "python",
"version": "3.11"
},
"build": {
"commands": [
"pip install -r requirements.txt",
"pytest tests/",
"docker build -t my-api ."
]
},
"deploy": {
"type": "ecs-fargate",
"config": {
"container_port": 8000,
"cpu": 256,
"memory": 512
}
}
}
```
### React App with Extra Stages
```json
{
"name": "my-react-app",
"project_type": "react",
"extra_stages": [
{
"name": "sonarqube",
"type": "sonarqube_cloud",
"config": {
"project_key": "my-sonar-key",
"sources": "src"
}
},
{
"name": "security-scan",
"type": "snyk",
"config": {
"language": "nodejs",
"severity_threshold": "high"
}
}
],
"notifications": {
"enabled": true,
"channels": ["slack", "email"],
"events": ["pipeline_failed", "deploy_completed"]
}
}
```
## ๐ Advanced Usage
### Environment Variables
Set these environment variables for enhanced functionality:
```bash
export SONAR_TOKEN="your-sonar-token"
export SNYK_TOKEN="your-snyk-token"
export CODECOV_TOKEN="your-codecov-token"
export SLACK_WEBHOOK_URL="your-slack-webhook"
```
### Custom Build Stages
Add custom build logic to your pipeline:
```json
{
"extra_stages": [
{
"name": "custom-build",
"type": "custom",
"config": {
"commands": [
"echo 'Running custom build steps'",
"npm run custom-script",
"python custom_script.py"
],
"environment_variables": {
"CUSTOM_VAR": "custom_value"
}
}
}
]
}
```
## ๐งช Testing
```bash
# Run all tests
pytest
# Run with coverage
pytest --cov=pipeline_creator --cov-report=html
# Run specific test modules
pytest tests/test_templates.py
pytest tests/test_notifications.py
```
## ๐ค Contributing
We welcome contributions! Here's how to get started:
1. **Fork** the repository
2. **Create** a feature branch (`git checkout -b feature/amazing-feature`)
3. **Install** development dependencies (`pip install -e .[dev]`)
4. **Write** tests for your changes
5. **Run** tests (`pytest`)
6. **Commit** your changes (`git commit -m 'Add amazing feature'`)
7. **Push** to the branch (`git push origin feature/amazing-feature`)
8. **Create** a Pull Request
### Development Setup
```bash
# Install development dependencies
pip install -e .[dev]
# Install pre-commit hooks
pre-commit install
# Run linting
flake8 pipeline_creator/
black pipeline_creator/
# Run type checking
mypy pipeline_creator/
```
## ๐ Documentation
- [Getting Started Guide](docs/getting-started.md)
- [Template Creation Guide](docs/templates.md)
- [Notification Setup](docs/notifications.md)
- [Advanced Configuration](docs/advanced.md)
- [API Reference](docs/api.md)
## โ Troubleshooting
### Common Issues
**Q: "ModuleNotFoundError" when running commands**
A: Make sure you've activated your virtual environment and installed dependencies:
```bash
source .venv/bin/activate
pip install -e .
```
**Q: AWS deployment fails with permissions error**
A: Ensure your AWS credentials have the necessary permissions:
```bash
aws sts get-caller-identity # Check current identity
aws configure list # Check configuration
```
**Q: Notifications not working**
A: Check your notification configuration:
```bash
pipeline notifications status
pipeline notifications test
```
## ๐ What's New
### v0.3.0 - Template System
- โจ Complete template system with inheritance
- ๐ 3 predefined templates (React, Python API, Node.js API)
- ๐ Template import/export functionality
- ๐ฏ Interactive parameter configuration
### v0.2.0 - Smart Notifications
- ๐ง Multi-channel notification support (Email, Slack, Webhooks)
- โก Smart alerting rules to reduce spam
- ๐จ Rich HTML email templates
- ๐ Event history and analytics
### v0.1.0 - Core Features
- ๐๏ธ AWS CodePipeline generation with CDK
- ๐งช Extra build stages (SonarQube, Snyk, Codecov)
- โ๏ธ Interactive CLI with rich console output
- ๐ฆ Multi-language project support
## ๐ฎ What's Next
We're continuously improving Pipeline Creator CLI! Here's our exciting roadmap:
### ๐ฏ v0.4.0 - Multi-Environment Support (In Progress)
- ๐ **Environment Management** - Staging, production, and custom environments
- ๐ช **Approval Gates** - Manual approval workflows between environments
- ๐ **Progressive Deployments** - Blue-green and canary deployment strategies
- โ๏ธ **Environment-Specific Configs** - Different settings per environment
- ๐ **Automatic Rollbacks** - Smart rollback on deployment failures
- ๐ท๏ธ **Environment Tagging** - Resource organization and cost tracking
### ๐ v0.5.0 - Enhanced Pipeline Intelligence
- ๐ **Pipeline Analytics** - Performance metrics and deployment insights
- ๐ค **AI-Powered Optimization** - Automatic pipeline improvements suggestions
- ๐ **Dependency Analysis** - Smart dependency tracking and updates
- ๐ **Cost Optimization** - AWS cost analysis and recommendations
- ๐ **Scheduling** - Time-based deployments and maintenance windows
### ๐ก๏ธ v0.6.0 - Enterprise Security & Governance
- ๐ **RBAC Integration** - Role-based access control with AWS IAM
- ๐ **Compliance Templates** - SOC2, HIPAA, PCI-DSS compliant pipelines
- ๐ก๏ธ **Secret Management** - AWS Secrets Manager and Parameter Store integration
- ๐ **Audit Trails** - Comprehensive deployment and change logging
- ๐ **Policy Enforcement** - Automated policy compliance checking
### ๐ v0.7.0 - Multi-Cloud & Hybrid Support
- โ๏ธ **Azure DevOps** - Azure Pipelines generation and deployment
- ๐ง **Google Cloud Build** - GCP pipeline creation and management
- ๐ข **On-Premise Integration** - Jenkins and GitLab CI/CD support
- ๐ **Multi-Cloud Deployments** - Cross-cloud deployment strategies
- ๐ฆ **Universal Templates** - Cloud-agnostic pipeline templates
### ๐จ v0.8.0 - Developer Experience Enhancements
- ๐ฅ๏ธ **Web Dashboard** - Visual pipeline builder and monitoring
- ๐ฑ **Mobile App** - Pipeline monitoring on the go
- ๐ **IDE Extensions** - VS Code, IntelliJ, and other IDE integrations
- ๐ค **Git Integration** - Advanced Git hooks and branch strategies
- ๐ **Documentation Generator** - Auto-generate pipeline documentation
### ๐งช v0.9.0 - Advanced Testing & Quality
- ๐ค **Automated Testing** - AI-powered test generation and execution
- ๐ **Performance Testing** - Load testing integration (k6, JMeter)
- ๐ **Cross-Browser Testing** - Selenium Grid and Playwright support
- ๐ **Quality Gates** - Advanced quality metrics and thresholds
- ๐ **Bug Prevention** - Predictive analysis for common issues
### ๐ฆ v1.0.0 - Production Ready Enterprise Edition
- ๐ข **Enterprise Templates** - Industry-specific pipeline templates
- ๐ **Executive Dashboards** - C-level reporting and insights
- ๐ **Training Materials** - Comprehensive documentation and tutorials
- ๐ง **Professional Support** - Dedicated support channels
- ๐ **Performance Optimization** - Enterprise-scale performance tuning
## ๐ก Community Requests
Vote for features you'd like to see next! Open an issue with the `feature-request` label:
- ๐ **Python Package Publishing** - PyPI integration for Python projects
- ๐ฆ **Docker Registry Support** - Private registry integration (ECR, Docker Hub)
- ๐ **Kubernetes Deployments** - EKS and self-managed K8s support
- ๐ **GitOps Integration** - ArgoCD and Flux support
- ๐ง **Microsoft Teams** - Teams notification channel
- ๐ฏ **Terraform Integration** - Infrastructure as Code workflows
- ๐ **HashiCorp Vault** - Advanced secret management
- ๐ **Datadog Integration** - Enhanced monitoring and alerting
## ๐ค Contributing to the Roadmap
We value community input! Here's how you can influence our roadmap:
1. **๐ณ๏ธ Vote on Features** - Star issues you'd like prioritized
2. **๐ก Suggest Ideas** - Open feature request issues
3. **๐ ๏ธ Contribute Code** - Submit PRs for roadmap items
4. **๐ Report Issues** - Help us improve current features
5. **๐ Improve Docs** - Documentation contributions welcome
Join our [Discord Community](https://discord.gg/pipeline-creator) for roadmap discussions!
## ๐ License
MIT License - see the [LICENSE](LICENSE) file for details.
---
**Made with โค๏ธ by the Pipeline Creator Team**
*Streamlining DevOps, one pipeline at a time.*