Package Exports
- jenkins-generator
- jenkins-generator/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jenkins-generator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Jenkins Generator ๐
Automated Jenkins CI/CD pipeline generator for multi-cloud deployments with external services support
Never worry about CI/CD configuration again! This tool automatically generates production-ready Jenkins pipelines for AWS, Azure, GCP, and DigitalOcean with just a few questions. Now with automatic external services configuration!
โจ Features
๐ Multi-Cloud Support
- AWS - ECS Fargate deployments with auto-scaling
- Azure - Container Instances with resource groups
- GCP - Cloud Run serverless containers
- DigitalOcean - App Platform deployments
๐ External Services Configuration (v2.0.0)
- ๐๏ธ Databases - PostgreSQL, MongoDB, MySQL, Redis, and more
- โก Caching - Redis, Memcached, ElastiCache
- ๐จ Message Queues - RabbitMQ, Kafka, SQS, Azure Service Bus
- ๐ฆ Storage - AWS S3, Azure Blob, Google Cloud Storage, MinIO
- ๐ง Email Services - SMTP, SendGrid, AWS SES, Mailgun
- ๐ Monitoring - DataDog, Sentry, New Relic, Prometheus
- ๐ง Custom Services - Any service your app needs
- Automatic environment variable configuration
- Jenkins credentials management
- .env.template generation for local development
๐ Security First
- AES-256 encryption for credential storage
- Masked sensitive data in logs and output
- Secure Jenkins credential references
- No hardcoded secrets in generated files
- Credential rotation reminders
- Automatic .gitignore updates to protect .env files
๐ง Multi-Channel Notifications
- Email - HTML formatted with build details
- Slack - Rich attachments with color coding
- Discord - Embedded messages with status
- Microsoft Teams - Adaptive cards
- Telegram - Markdown formatted messages
๐ณ Docker & Local Infrastructure
- Automated image building from your Dockerfile
- Docker Compose generation for local infrastructure testing ๐
- Registry push to Docker Hub or private registry
- Container orchestration on cloud platforms
- Health check verification
- Automatic cleanup of old images
- Environment variables injection into containers
๐งช Testing Integration
- Optional test execution before deployment
- Configurable test commands
- Test result publishing in Jenkins
- Retry logic for flaky tests
๐ Advanced Features
- Infrastructure as Code (IaC) - Automatic Terraform generation ๐
- Advanced Deployments - Rolling, Blue-Green, and Canary strategies ๐
- Post-Deployment Dashboard - Visual HTML summaries ๐
- Configuration Presets - Save/Load configuration for speed ๐
- Health check endpoints with retry logic
- Load Balancer & stable DNS support
- Deployment tier management (dev/staging/production)
- Build retry logic
- Comprehensive logging
- Post-deployment verification
๐ฏ Why Use This?
Before:
โ Manually write Jenkinsfile (hours of work)
โ Configure cloud deployment scripts
โ Set up notifications for each platform
โ Handle credentials securely
โ Configure database connections manually
โ Manage environment variables
โ Document the entire process
โ Maintain and update pipelinesAfter:
โ
Run one command: jenkins-generator
โ
Answer a few questions
โ
Configure databases, caching, queues automatically
โ
Get production-ready pipeline
โ
Automatic .env.template generation
โ
Complete documentation included
โ
Security best practices built-in
โ
Multi-cloud support out of the box๐ฆ Installation
Global Installation (Recommended)
npm install -g jenkins-generatorLocal Installation
npm install --save-dev jenkins-generatorRequirements
- Node.js 16.0.0 or higher
- npm 7.0.0 or higher
- Git repository
- Dockerfile in your project (or we'll guide you)
- Jenkins 2.0+ with required plugins
๐ Quick Start (Local)
- Install Globably:
npm install -g jenkins-generator- Run in your project root:
jenkins-generator๐ณ Usage with Docker
You can run the generator without installing Node.js by using our official Docker image.
Pulling the image
docker pull your-dockerhub-username/jenkins-generatorRunning the container
To allow the generator to write files to your current directory, you must mount your project directory as a volume:
docker run -it --rm -v $(pwd):/app your-dockerhub-username/jenkins-generator๐ ๏ธ Configuration Options
The generator will prompt you for:
- Project Details: Name, type (frontend/backend), language (JS/TS)
- Git Info: Repository URL and branch
- Docker: Dockerfile presence and path
- External Services: Databases, Caching, Storage, etc (NEW in v2.0!)
- Cloud Provider: AWS, Azure, GCP, or DigitalOcean
- Deployment: Instance types, regions, auto-scaling
- Notifications: Slack, Discord, Teams, Telegram, Email
4. Review Generated Files
your-project/
โโโ Jenkinsfile # ๐ฏ Main pipeline with env vars
โโโ docker-compose.yml # ๐ณ Local infrastructure testing ๐
โโโ .env.template # ๐ Template for local development
โโโ .gitignore # ๐ Updated to exclude .env
โโโ .cicd/
โโโ README.md # ๐ Project documentation
โโโ CREDENTIALS_SETUP.md # ๐ Credential guide (with services)
โโโ config.encrypted.json # ๐ Encrypted backup
โโโ .gitignore # ๐ซ Protect secrets5. Configure Services (New in v2.0.0!)
Copy .env.template to .env and fill in your values:
cp .env.template .env
nano .env # or use your favorite editor6. Configure Jenkins
Follow the instructions in .cicd/CREDENTIALS_SETUP.md to:
- Add credentials to Jenkins
- Configure external service credentials ๐
- Create pipeline job
- Connect to your repository
7. Deploy!
Push your code and watch Jenkins automatically:
- โ Checkout code
- โ Install dependencies
- โ Load environment variables ๐
- โ Run tests
- โ Build application
- โ Create Docker image
- โ Push to registry
- โ Deploy to cloud
- โ Verify health
- โ Send notifications
๐ Usage Examples
Example 1: Node.js API with PostgreSQL on AWS
$ jenkins-generator
๐ Jenkins Generator
? Enter your project name: my-api
? Select project type: backend
? Select programming language: typescript
? Enter Git repository URL: https://github.com/user/my-api.git
? Does your application use external services? Yes
๐ฆ Let's configure your external services...
? Select service type: Database
? Select database type: postgresql
? Database host environment variable name: DB_HOST
? Database password environment variable name: DB_PASSWORD
? Add another service? No
? Select cloud provider: aws
? Select AWS region: us-east-1
? Enable auto-scaling? Yes
โ
Jenkins pipeline generated successfully!Generated .env.template:
# postgres-main (postgresql)
DB_HOST=localhost
DB_PORT=5432
DB_NAME=myapp
DB_USERNAME=your_db_username_here
DB_PASSWORD=your_db_password_here
DATABASE_URL=your_database_url_hereExample 2: React App with S3 Storage on GCP
$ jenkins-generator
? Enter your project name: my-react-app
? Select project type: frontend
? Does your application use external services? Yes
? Select service type: Storage
? Select storage service: s3
? Bucket name environment variable: S3_BUCKET
? Access key environment variable: S3_ACCESS_KEY
โ
Jenkins pipeline generated successfully!๐๏ธ Supported External Services (v2.0.0)
Databases
- PostgreSQL
- MongoDB
- MySQL / MariaDB
- Redis
- DynamoDB
- CosmosDB
Caching
- Redis
- Memcached
- ElastiCache
Message Queues
- RabbitMQ
- Apache Kafka
- AWS SQS
- Azure Service Bus
Storage
- AWS S3
- Azure Blob Storage
- Google Cloud Storage
- MinIO
- DigitalOcean Spaces
Email Services
- SMTP
- SendGrid
- AWS SES
- Mailgun
- Postmark
Monitoring
- DataDog
- New Relic
- Sentry
- Prometheus
- Grafana
Custom Services
- Any service with custom environment variables
๐๏ธ What Gets Generated
Jenkinsfile
Complete Jenkins pipeline with:
- Git checkout
- Dependency installation
- External services environment variables ๐
- Test execution (optional)
- Application build
- Docker image creation
- Registry push
- Cloud deployment
- Health checks
- Notifications
Example Jenkinsfile Environment Block:
environment {
// Cloud credentials
AWS_ACCESS_KEY_ID = credentials('aws-access-key-id')
// Database credentials (auto-generated)
DB_HOST = '${env.DB_HOST ?: ""}'
DB_USERNAME = credentials('db-username')
DB_PASSWORD = credentials('db-password')
// Redis credentials
REDIS_HOST = '${env.REDIS_HOST ?: ""}'
REDIS_PASSWORD = credentials('redis-password')
// S3 credentials
S3_BUCKET = '${env.S3_BUCKET ?: ""}'
S3_ACCESS_KEY = credentials('s3-access-key')
}Documentation
- README.md - Project-specific pipeline documentation
- CREDENTIALS_SETUP.md - Step-by-step Jenkins credential setup (includes external services) ๐
- config.encrypted.json - Encrypted configuration backup
- .env.template - Template for local development ๐
- EXTERNAL_SERVICES_GUIDE.md - Complete guide for services configuration ๐
๐ง Supported Cloud Providers
| Provider | Service | Features |
|---|---|---|
| AWS | ECS Fargate | Auto-scaling, Health checks, CloudWatch logs |
| Azure | Container Instances | Resource groups, Managed identities |
| GCP | Cloud Run | Serverless, Auto-scaling, Built-in monitoring |
| DigitalOcean | App Platform | Simple deployment, Automatic SSL |
๐ Security Features
- AES-256 Encryption for credential storage
- Masked credentials in all output and logs
- Jenkins credential storage integration
- No plain-text secrets in generated files
- Security best practices documentation
- Credential rotation reminders
- Automatic .gitignore protection for .env files ๐
- Secret vs non-secret detection for environment variables ๐
๐ Documentation
- Setup Guide - Complete installation and setup
- External Services Guide - Configuration for databases, caching, etc. ๐
- Deployment Checklist - Pre/post deployment steps
- Troubleshooting - Common issues and solutions
๐ ๏ธ Requirements
Jenkins Plugins
Required plugins (automatically documented in generated files):
- Docker Pipeline
- Git Plugin
- Email Extension Plugin
- Pipeline Plugin
- Credentials Binding Plugin
- Blue Ocean (optional)
Cloud Provider Credentials
You'll need credentials for your chosen cloud provider:
AWS:
- Access Key ID
- Secret Access Key
Azure:
- Subscription ID
- Client ID
- Client Secret
- Tenant ID
GCP:
- Project ID
- Service Account Key File
DigitalOcean:
- API Token
๐ Troubleshooting
Issue: "Command not found"
# Reinstall globally
npm install -g jenkins-generator
# Or check npm global bin path
npm config get prefixIssue: "Dockerfile not found"
- Ensure Dockerfile exists at specified path
- Check path is relative to project root
- Verify file name is exactly
Dockerfile(case-sensitive)
Issue: "Cannot connect to database"
- Verify database credentials in Jenkins
- Check network connectivity from Jenkins to database
- Ensure firewall rules allow connection
- Verify environment variables are loaded correctly
Issue: "Deployment failed"
- Verify cloud provider credentials in Jenkins
- Check instance type availability in selected region
- Review deployment logs in cloud console
- Ensure sufficient permissions/quotas
More Help
For more troubleshooting, check the generated .cicd/README.md in your project.
๐ What's New in v2.2.0
Major Features
- โ Infrastructure as Code (IaC) - Generate Terraform scripts for AWS, Azure, GCP, and DigitalOcean
- โ Docker Compose Generation - Automatic local infrastructure setup (versioned and validated) ๐
- โ OIDC Authentication - Support for secure, token-based authentication (Web Identity Federation)
- โ Deployment Strategies - Integrated Rolling, Blue-Green, and Canary deployment support
- โ Visual Dashboard - Post-deployment HTML summary for quick status overview
- โ
Configuration Presets - Save your answers to
jenkins-generator-config.jsonfor rapid re-runs - โ Improved Validation - Robust Git URL and port validation suite
๐ What's New in v2.1.0
Major Features
- โ Load Balancer Integration - Support for stable DNS URLs in deployment and health checks
- โ Enhanced Health Checks - Robust curl-based retries with dynamic URL extraction
- โ Multi-Cloud Registry support - Native integration with ECR, ACR, GCR, and DO Registry
- โ Full Containerization - Ready-to-use Docker image for easy distribution
๐ What's New in v2.0.0
Major Features
- โ External Services Configuration - Automatically configure databases, caching, queues, storage, and more
- โ Environment Variables Management - Automatic generation and injection
- โ .env.template Generation - For local development
- โ 20+ Services Supported - PostgreSQL, MongoDB, Redis, S3, SMTP, Kafka, and more
- โ Automatic Jenkins Credentials - Generates complete credential setup guide
- โ Security Enhancements - Automatic secret detection and .gitignore updates
- โ Complete Documentation - New EXTERNAL_SERVICES_GUIDE.md
Breaking Changes
None! v2.0.0 is fully backward compatible with v1.0.0. If you don't configure external services, it works exactly like v1.0.0.
๐ค Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
๐ License
MIT License - see LICENSE file for details
๐ Acknowledgments
- Built with NestJS
- Powered by TypeScript
- CLI powered by Inquirer
- Styled with Chalk
๐ Support
- ๐ง Email: sulabhadhikari90@gmail.com
- ๐ Issues: GitHub Issues
- ๐ Docs: Full documentation in generated
.cicd/folder
โญ Show Your Support
If this tool helped you, please:
- โญ Star the repository
- ๐ฆ Tweet about it
- ๐ Write a blog post
- ๐ฌ Tell your friends
- You can also [buy me a coffee](For this please mail me at sulabhadhikari90@gmail.com)
Made with โค๏ธ by developers, for developers
Stop configuring CI/CD manually. Start deploying automatically!
npm install -g jenkins-generator
cd your-project
jenkins-generator
# Configure your services, deploy! ๐