jenkins-generator 1.0.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +8 -0
- package/DOCKER_COMPOSE_GUIDE.md +62 -0
- package/Dockerfile +23 -0
- package/README.md +240 -34
- package/dist/app.module.js +8 -0
- package/dist/app.module.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/config.interface.d.ts +42 -4
- package/dist/services/cicd-generator.service.d.ts +10 -1
- package/dist/services/cicd-generator.service.js +151 -20
- package/dist/services/cicd-generator.service.js.map +1 -1
- package/dist/services/cloud-provider.service.d.ts +1 -0
- package/dist/services/cloud-provider.service.js +135 -49
- package/dist/services/cloud-provider.service.js.map +1 -1
- package/dist/services/dashboard.service.d.ts +4 -0
- package/dist/services/dashboard.service.js +103 -0
- package/dist/services/dashboard.service.js.map +1 -0
- package/dist/services/docker-compose.service.d.ts +7 -0
- package/dist/services/docker-compose.service.js +113 -0
- package/dist/services/docker-compose.service.js.map +1 -0
- package/dist/services/environment.service.d.ts +10 -0
- package/dist/services/environment.service.js +163 -0
- package/dist/services/environment.service.js.map +1 -0
- package/dist/services/iac.service.d.ts +8 -0
- package/dist/services/iac.service.js +164 -0
- package/dist/services/iac.service.js.map +1 -0
- package/dist/services/jenkinsfile.service.d.ts +4 -1
- package/dist/services/jenkinsfile.service.js +153 -41
- package/dist/services/jenkinsfile.service.js.map +1 -1
- package/dist/services/notification.service.js +13 -15
- package/dist/services/notification.service.js.map +1 -1
- package/dist/services/prompt.service.d.ts +9 -0
- package/dist/services/prompt.service.js +637 -19
- package/dist/services/prompt.service.js.map +1 -1
- package/dist/services/validation.service.js +1 -1
- package/dist/services/validation.service.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docker-compose.yml +13 -0
- package/jest.config.js +12 -0
- package/package.json +8 -1
package/.dockerignore
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Docker Compose Guide 🐳
|
|
2
|
+
|
|
3
|
+
This guide explains how to use the automatically generated `docker-compose.yml` file for local development and infrastructure testing.
|
|
4
|
+
|
|
5
|
+
## Why Docker Compose?
|
|
6
|
+
|
|
7
|
+
When you configure external services (like databases, caches, or message queues) for your project, `jenkins-generator` creates a `docker-compose.yml` file in your project root. This allows you to:
|
|
8
|
+
|
|
9
|
+
1. **Test Locally**: Spin up the exact same infrastructure your app needs on your local machine.
|
|
10
|
+
2. **Validate Connections**: Ensure your app can connect to the services before deploying to Jenkins/Cloud.
|
|
11
|
+
3. **Consistent Environments**: Every developer on your team can run the same setup with one command.
|
|
12
|
+
|
|
13
|
+
## Getting Started
|
|
14
|
+
|
|
15
|
+
### Prerequisites
|
|
16
|
+
|
|
17
|
+
- **Docker Desktop** (Mac/Windows) or **Docker Engine** (Linux)
|
|
18
|
+
- **Docker Compose** (V2 is recommended)
|
|
19
|
+
|
|
20
|
+
### Usage
|
|
21
|
+
|
|
22
|
+
To start all services defined in your configuration:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
docker-compose up -d
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
To stop and remove containers:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
docker-compose down
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Generated Configuration
|
|
35
|
+
|
|
36
|
+
The `docker-compose.yml` includes:
|
|
37
|
+
|
|
38
|
+
- **Your Application**: Built from your `Dockerfile`.
|
|
39
|
+
- **External Services**: Official images for databases (PostgreSQL, MongoDB, etc.) with default credentials.
|
|
40
|
+
- **Network**: All services are on the same bridge network for easy communication.
|
|
41
|
+
- **Volumes**: Persistent storage for databases where applicable.
|
|
42
|
+
|
|
43
|
+
## Environment Variables
|
|
44
|
+
|
|
45
|
+
The generator also creates a `.env.template` file. To connect your app to the local Docker services:
|
|
46
|
+
|
|
47
|
+
1. Copy `.env.template` to `.env`.
|
|
48
|
+
2. The default values in `.env.template` are usually configured to match the `docker-compose.yml` defaults.
|
|
49
|
+
|
|
50
|
+
## Troubleshooting
|
|
51
|
+
|
|
52
|
+
### Port Conflicts
|
|
53
|
+
|
|
54
|
+
If you see an error like `Bind for 0.0.0.0:5432 failed: port is already allocated`, it means you have another service (like a local PostgreSQL) running on that port. Stop the local service or change the port in `docker-compose.yml`.
|
|
55
|
+
|
|
56
|
+
### Connection Refused
|
|
57
|
+
|
|
58
|
+
Ensure all containers are running using `docker-compose ps`. If a service crashed, check logs with `docker-compose logs <service-name>`.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
_Generated by jenkins-generator_
|
package/Dockerfile
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Build stage
|
|
2
|
+
FROM node:20-slim AS builder
|
|
3
|
+
|
|
4
|
+
WORKDIR /app
|
|
5
|
+
|
|
6
|
+
COPY package*.json ./
|
|
7
|
+
RUN npm install
|
|
8
|
+
|
|
9
|
+
COPY . .
|
|
10
|
+
RUN npm run build
|
|
11
|
+
|
|
12
|
+
# Production stage
|
|
13
|
+
FROM node:20-slim
|
|
14
|
+
|
|
15
|
+
WORKDIR /app
|
|
16
|
+
|
|
17
|
+
COPY package*.json ./
|
|
18
|
+
RUN npm install --production
|
|
19
|
+
|
|
20
|
+
COPY --from=builder /app/dist ./dist
|
|
21
|
+
|
|
22
|
+
# The tool is interactive, so we need to run it in a way that allows shell interaction
|
|
23
|
+
ENTRYPOINT ["node", "dist/cli.js"]
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Jenkins Generator 🚀
|
|
2
2
|
|
|
3
|
-
> **Automated Jenkins CI/CD pipeline generator for multi-cloud deployments**
|
|
3
|
+
> **Automated Jenkins CI/CD pipeline generator for multi-cloud deployments with external services support**
|
|
4
4
|
|
|
5
5
|
[](https://badge.fury.io/js/jenkins-generator)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
7
|
[](https://nodejs.org/)
|
|
8
8
|
|
|
9
|
-
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.
|
|
9
|
+
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!**
|
|
10
10
|
|
|
11
11
|
## ✨ Features
|
|
12
12
|
|
|
@@ -17,6 +17,19 @@ Never worry about CI/CD configuration again! This tool automatically generates p
|
|
|
17
17
|
- **GCP** - Cloud Run serverless containers
|
|
18
18
|
- **DigitalOcean** - App Platform deployments
|
|
19
19
|
|
|
20
|
+
### 🆕 External Services Configuration (v2.0.0)
|
|
21
|
+
|
|
22
|
+
- **🗄️ Databases** - PostgreSQL, MongoDB, MySQL, Redis, and more
|
|
23
|
+
- **⚡ Caching** - Redis, Memcached, ElastiCache
|
|
24
|
+
- **📨 Message Queues** - RabbitMQ, Kafka, SQS, Azure Service Bus
|
|
25
|
+
- **📦 Storage** - AWS S3, Azure Blob, Google Cloud Storage, MinIO
|
|
26
|
+
- **📧 Email Services** - SMTP, SendGrid, AWS SES, Mailgun
|
|
27
|
+
- **📊 Monitoring** - DataDog, Sentry, New Relic, Prometheus
|
|
28
|
+
- **🔧 Custom Services** - Any service your app needs
|
|
29
|
+
- **Automatic environment variable configuration**
|
|
30
|
+
- **Jenkins credentials management**
|
|
31
|
+
- **.env.template generation** for local development
|
|
32
|
+
|
|
20
33
|
### 🔒 Security First
|
|
21
34
|
|
|
22
35
|
- **AES-256 encryption** for credential storage
|
|
@@ -24,6 +37,7 @@ Never worry about CI/CD configuration again! This tool automatically generates p
|
|
|
24
37
|
- **Secure Jenkins credential references**
|
|
25
38
|
- **No hardcoded secrets** in generated files
|
|
26
39
|
- **Credential rotation reminders**
|
|
40
|
+
- **Automatic .gitignore updates** to protect .env files
|
|
27
41
|
|
|
28
42
|
### 📧 Multi-Channel Notifications
|
|
29
43
|
|
|
@@ -33,13 +47,15 @@ Never worry about CI/CD configuration again! This tool automatically generates p
|
|
|
33
47
|
- **Microsoft Teams** - Adaptive cards
|
|
34
48
|
- **Telegram** - Markdown formatted messages
|
|
35
49
|
|
|
36
|
-
### 🐳 Docker
|
|
50
|
+
### 🐳 Docker & Local Infrastructure
|
|
37
51
|
|
|
38
52
|
- **Automated image building** from your Dockerfile
|
|
53
|
+
- **Docker Compose generation** for local infrastructure testing 🆕
|
|
39
54
|
- **Registry push** to Docker Hub or private registry
|
|
40
55
|
- **Container orchestration** on cloud platforms
|
|
41
56
|
- **Health check verification**
|
|
42
57
|
- **Automatic cleanup** of old images
|
|
58
|
+
- **Environment variables injection** into containers
|
|
43
59
|
|
|
44
60
|
### 🧪 Testing Integration
|
|
45
61
|
|
|
@@ -50,8 +66,12 @@ Never worry about CI/CD configuration again! This tool automatically generates p
|
|
|
50
66
|
|
|
51
67
|
### 📊 Advanced Features
|
|
52
68
|
|
|
53
|
-
- **
|
|
54
|
-
- **
|
|
69
|
+
- **Infrastructure as Code (IaC)** - Automatic Terraform generation 🆕
|
|
70
|
+
- **Advanced Deployments** - Rolling, Blue-Green, and Canary strategies 🆕
|
|
71
|
+
- **Post-Deployment Dashboard** - Visual HTML summaries 🆕
|
|
72
|
+
- **Configuration Presets** - Save/Load configuration for speed 🆕
|
|
73
|
+
- **Health check endpoints** with retry logic
|
|
74
|
+
- **Load Balancer & stable DNS support**
|
|
55
75
|
- **Deployment tier management** (dev/staging/production)
|
|
56
76
|
- **Build retry logic**
|
|
57
77
|
- **Comprehensive logging**
|
|
@@ -66,6 +86,8 @@ Never worry about CI/CD configuration again! This tool automatically generates p
|
|
|
66
86
|
❌ Configure cloud deployment scripts
|
|
67
87
|
❌ Set up notifications for each platform
|
|
68
88
|
❌ Handle credentials securely
|
|
89
|
+
❌ Configure database connections manually
|
|
90
|
+
❌ Manage environment variables
|
|
69
91
|
❌ Document the entire process
|
|
70
92
|
❌ Maintain and update pipelines
|
|
71
93
|
```
|
|
@@ -75,7 +97,9 @@ Never worry about CI/CD configuration again! This tool automatically generates p
|
|
|
75
97
|
```
|
|
76
98
|
✅ Run one command: jenkins-generator
|
|
77
99
|
✅ Answer a few questions
|
|
100
|
+
✅ Configure databases, caching, queues automatically
|
|
78
101
|
✅ Get production-ready pipeline
|
|
102
|
+
✅ Automatic .env.template generation
|
|
79
103
|
✅ Complete documentation included
|
|
80
104
|
✅ Security best practices built-in
|
|
81
105
|
✅ Multi-cloud support out of the box
|
|
@@ -103,59 +127,94 @@ npm install --save-dev jenkins-generator
|
|
|
103
127
|
- **Dockerfile** in your project (or we'll guide you)
|
|
104
128
|
- **Jenkins** 2.0+ with required plugins
|
|
105
129
|
|
|
106
|
-
## 🚀 Quick Start
|
|
130
|
+
## 🚀 Quick Start (Local)
|
|
107
131
|
|
|
108
|
-
|
|
132
|
+
1. **Install Globably:**
|
|
109
133
|
|
|
110
134
|
```bash
|
|
111
|
-
|
|
135
|
+
npm install -g jenkins-generator
|
|
112
136
|
```
|
|
113
137
|
|
|
114
|
-
|
|
138
|
+
2. **Run in your project root:**
|
|
115
139
|
|
|
116
140
|
```bash
|
|
117
141
|
jenkins-generator
|
|
118
142
|
```
|
|
119
143
|
|
|
120
|
-
|
|
144
|
+
## 🐳 Usage with Docker
|
|
121
145
|
|
|
122
|
-
|
|
146
|
+
You can run the generator without installing Node.js by using our official Docker image.
|
|
123
147
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
148
|
+
### Pulling the image
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
docker pull your-dockerhub-username/jenkins-generator
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Running the container
|
|
155
|
+
|
|
156
|
+
To allow the generator to write files to your current directory, you must mount your project directory as a volume:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
docker run -it --rm -v $(pwd):/app your-dockerhub-username/jenkins-generator
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## 🛠️ Configuration Options
|
|
165
|
+
|
|
166
|
+
The generator will prompt you for:
|
|
167
|
+
|
|
168
|
+
- **Project Details**: Name, type (frontend/backend), language (JS/TS)
|
|
169
|
+
- **Git Info**: Repository URL and branch
|
|
170
|
+
- **Docker**: Dockerfile presence and path
|
|
171
|
+
- **External Services**: Databases, Caching, Storage, etc (NEW in v2.0!)
|
|
172
|
+
- **Cloud Provider**: AWS, Azure, GCP, or DigitalOcean
|
|
173
|
+
- **Deployment**: Instance types, regions, auto-scaling
|
|
174
|
+
- **Notifications**: Slack, Discord, Teams, Telegram, Email
|
|
175
|
+
|
|
176
|
+
---
|
|
132
177
|
|
|
133
178
|
### 4. Review Generated Files
|
|
134
179
|
|
|
135
180
|
```
|
|
136
181
|
your-project/
|
|
137
|
-
├── Jenkinsfile # 🎯 Main pipeline
|
|
182
|
+
├── Jenkinsfile # 🎯 Main pipeline with env vars
|
|
183
|
+
├── docker-compose.yml # 🐳 Local infrastructure testing 🆕
|
|
184
|
+
├── .env.template # 🆕 Template for local development
|
|
185
|
+
├── .gitignore # 🆕 Updated to exclude .env
|
|
138
186
|
└── .cicd/
|
|
139
187
|
├── README.md # 📖 Project documentation
|
|
140
|
-
├── CREDENTIALS_SETUP.md # 🔐 Credential guide
|
|
188
|
+
├── CREDENTIALS_SETUP.md # 🔐 Credential guide (with services)
|
|
141
189
|
├── config.encrypted.json # 🔒 Encrypted backup
|
|
142
190
|
└── .gitignore # 🚫 Protect secrets
|
|
143
191
|
```
|
|
144
192
|
|
|
145
|
-
### 5. Configure
|
|
193
|
+
### 5. Configure Services (New in v2.0.0!)
|
|
194
|
+
|
|
195
|
+
Copy `.env.template` to `.env` and fill in your values:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
cp .env.template .env
|
|
199
|
+
nano .env # or use your favorite editor
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### 6. Configure Jenkins
|
|
146
203
|
|
|
147
204
|
Follow the instructions in `.cicd/CREDENTIALS_SETUP.md` to:
|
|
148
205
|
|
|
149
206
|
- Add credentials to Jenkins
|
|
207
|
+
- Configure external service credentials 🆕
|
|
150
208
|
- Create pipeline job
|
|
151
209
|
- Connect to your repository
|
|
152
210
|
|
|
153
|
-
###
|
|
211
|
+
### 7. Deploy!
|
|
154
212
|
|
|
155
213
|
Push your code and watch Jenkins automatically:
|
|
156
214
|
|
|
157
215
|
- ✅ Checkout code
|
|
158
216
|
- ✅ Install dependencies
|
|
217
|
+
- ✅ **Load environment variables** 🆕
|
|
159
218
|
- ✅ Run tests
|
|
160
219
|
- ✅ Build application
|
|
161
220
|
- ✅ Create Docker image
|
|
@@ -166,7 +225,7 @@ Push your code and watch Jenkins automatically:
|
|
|
166
225
|
|
|
167
226
|
## 📚 Usage Examples
|
|
168
227
|
|
|
169
|
-
### Example 1: Node.js API on AWS
|
|
228
|
+
### Example 1: Node.js API with PostgreSQL on AWS
|
|
170
229
|
|
|
171
230
|
```bash
|
|
172
231
|
$ jenkins-generator
|
|
@@ -177,31 +236,105 @@ $ jenkins-generator
|
|
|
177
236
|
? Select project type: backend
|
|
178
237
|
? Select programming language: typescript
|
|
179
238
|
? Enter Git repository URL: https://github.com/user/my-api.git
|
|
180
|
-
?
|
|
181
|
-
|
|
182
|
-
|
|
239
|
+
? Does your application use external services? Yes
|
|
240
|
+
|
|
241
|
+
📦 Let's configure your external services...
|
|
242
|
+
|
|
243
|
+
? Select service type: Database
|
|
244
|
+
? Select database type: postgresql
|
|
245
|
+
? Database host environment variable name: DB_HOST
|
|
246
|
+
? Database password environment variable name: DB_PASSWORD
|
|
247
|
+
|
|
248
|
+
? Add another service? No
|
|
249
|
+
|
|
183
250
|
? Select cloud provider: aws
|
|
184
251
|
? Select AWS region: us-east-1
|
|
185
|
-
? Select instance type: t2.small
|
|
186
252
|
? Enable auto-scaling? Yes
|
|
187
253
|
|
|
188
254
|
✅ Jenkins pipeline generated successfully!
|
|
189
255
|
```
|
|
190
256
|
|
|
191
|
-
|
|
257
|
+
**Generated .env.template:**
|
|
258
|
+
|
|
259
|
+
```env
|
|
260
|
+
# postgres-main (postgresql)
|
|
261
|
+
DB_HOST=localhost
|
|
262
|
+
DB_PORT=5432
|
|
263
|
+
DB_NAME=myapp
|
|
264
|
+
DB_USERNAME=your_db_username_here
|
|
265
|
+
DB_PASSWORD=your_db_password_here
|
|
266
|
+
DATABASE_URL=your_database_url_here
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Example 2: React App with S3 Storage on GCP
|
|
192
270
|
|
|
193
271
|
```bash
|
|
194
272
|
$ jenkins-generator
|
|
195
273
|
|
|
196
274
|
? Enter your project name: my-react-app
|
|
197
275
|
? Select project type: frontend
|
|
198
|
-
?
|
|
199
|
-
|
|
200
|
-
? Select
|
|
276
|
+
? Does your application use external services? Yes
|
|
277
|
+
|
|
278
|
+
? Select service type: Storage
|
|
279
|
+
? Select storage service: s3
|
|
280
|
+
? Bucket name environment variable: S3_BUCKET
|
|
281
|
+
? Access key environment variable: S3_ACCESS_KEY
|
|
201
282
|
|
|
202
283
|
✅ Jenkins pipeline generated successfully!
|
|
203
284
|
```
|
|
204
285
|
|
|
286
|
+
## 🗄️ Supported External Services (v2.0.0)
|
|
287
|
+
|
|
288
|
+
### Databases
|
|
289
|
+
|
|
290
|
+
- PostgreSQL
|
|
291
|
+
- MongoDB
|
|
292
|
+
- MySQL / MariaDB
|
|
293
|
+
- Redis
|
|
294
|
+
- DynamoDB
|
|
295
|
+
- CosmosDB
|
|
296
|
+
|
|
297
|
+
### Caching
|
|
298
|
+
|
|
299
|
+
- Redis
|
|
300
|
+
- Memcached
|
|
301
|
+
- ElastiCache
|
|
302
|
+
|
|
303
|
+
### Message Queues
|
|
304
|
+
|
|
305
|
+
- RabbitMQ
|
|
306
|
+
- Apache Kafka
|
|
307
|
+
- AWS SQS
|
|
308
|
+
- Azure Service Bus
|
|
309
|
+
|
|
310
|
+
### Storage
|
|
311
|
+
|
|
312
|
+
- AWS S3
|
|
313
|
+
- Azure Blob Storage
|
|
314
|
+
- Google Cloud Storage
|
|
315
|
+
- MinIO
|
|
316
|
+
- DigitalOcean Spaces
|
|
317
|
+
|
|
318
|
+
### Email Services
|
|
319
|
+
|
|
320
|
+
- SMTP
|
|
321
|
+
- SendGrid
|
|
322
|
+
- AWS SES
|
|
323
|
+
- Mailgun
|
|
324
|
+
- Postmark
|
|
325
|
+
|
|
326
|
+
### Monitoring
|
|
327
|
+
|
|
328
|
+
- DataDog
|
|
329
|
+
- New Relic
|
|
330
|
+
- Sentry
|
|
331
|
+
- Prometheus
|
|
332
|
+
- Grafana
|
|
333
|
+
|
|
334
|
+
### Custom Services
|
|
335
|
+
|
|
336
|
+
- Any service with custom environment variables
|
|
337
|
+
|
|
205
338
|
## 🏗️ What Gets Generated
|
|
206
339
|
|
|
207
340
|
### Jenkinsfile
|
|
@@ -210,6 +343,7 @@ Complete Jenkins pipeline with:
|
|
|
210
343
|
|
|
211
344
|
- Git checkout
|
|
212
345
|
- Dependency installation
|
|
346
|
+
- **External services environment variables** 🆕
|
|
213
347
|
- Test execution (optional)
|
|
214
348
|
- Application build
|
|
215
349
|
- Docker image creation
|
|
@@ -218,11 +352,35 @@ Complete Jenkins pipeline with:
|
|
|
218
352
|
- Health checks
|
|
219
353
|
- Notifications
|
|
220
354
|
|
|
355
|
+
**Example Jenkinsfile Environment Block:**
|
|
356
|
+
|
|
357
|
+
```groovy
|
|
358
|
+
environment {
|
|
359
|
+
// Cloud credentials
|
|
360
|
+
AWS_ACCESS_KEY_ID = credentials('aws-access-key-id')
|
|
361
|
+
|
|
362
|
+
// Database credentials (auto-generated)
|
|
363
|
+
DB_HOST = '${env.DB_HOST ?: ""}'
|
|
364
|
+
DB_USERNAME = credentials('db-username')
|
|
365
|
+
DB_PASSWORD = credentials('db-password')
|
|
366
|
+
|
|
367
|
+
// Redis credentials
|
|
368
|
+
REDIS_HOST = '${env.REDIS_HOST ?: ""}'
|
|
369
|
+
REDIS_PASSWORD = credentials('redis-password')
|
|
370
|
+
|
|
371
|
+
// S3 credentials
|
|
372
|
+
S3_BUCKET = '${env.S3_BUCKET ?: ""}'
|
|
373
|
+
S3_ACCESS_KEY = credentials('s3-access-key')
|
|
374
|
+
}
|
|
375
|
+
```
|
|
376
|
+
|
|
221
377
|
### Documentation
|
|
222
378
|
|
|
223
379
|
- **README.md** - Project-specific pipeline documentation
|
|
224
|
-
- **CREDENTIALS_SETUP.md** - Step-by-step Jenkins credential setup
|
|
380
|
+
- **CREDENTIALS_SETUP.md** - Step-by-step Jenkins credential setup (includes external services) 🆕
|
|
225
381
|
- **config.encrypted.json** - Encrypted configuration backup
|
|
382
|
+
- **.env.template** - Template for local development 🆕
|
|
383
|
+
- **EXTERNAL_SERVICES_GUIDE.md** - Complete guide for services configuration 🆕
|
|
226
384
|
|
|
227
385
|
## 🔧 Supported Cloud Providers
|
|
228
386
|
|
|
@@ -241,10 +399,13 @@ Complete Jenkins pipeline with:
|
|
|
241
399
|
- **No plain-text secrets** in generated files
|
|
242
400
|
- **Security best practices** documentation
|
|
243
401
|
- **Credential rotation** reminders
|
|
402
|
+
- **Automatic .gitignore** protection for .env files 🆕
|
|
403
|
+
- **Secret vs non-secret detection** for environment variables 🆕
|
|
244
404
|
|
|
245
405
|
## 📖 Documentation
|
|
246
406
|
|
|
247
407
|
- [Setup Guide](./SETUP_GUIDE.md) - Complete installation and setup
|
|
408
|
+
- [External Services Guide](./EXTERNAL_SERVICES_GUIDE.md) - Configuration for databases, caching, etc. 🆕
|
|
248
409
|
- [Deployment Checklist](./DEPLOYMENT_CHECKLIST.md) - Pre/post deployment steps
|
|
249
410
|
- [Troubleshooting](#troubleshooting) - Common issues and solutions
|
|
250
411
|
|
|
@@ -304,6 +465,13 @@ npm config get prefix
|
|
|
304
465
|
- Check path is relative to project root
|
|
305
466
|
- Verify file name is exactly `Dockerfile` (case-sensitive)
|
|
306
467
|
|
|
468
|
+
### Issue: "Cannot connect to database"
|
|
469
|
+
|
|
470
|
+
- Verify database credentials in Jenkins
|
|
471
|
+
- Check network connectivity from Jenkins to database
|
|
472
|
+
- Ensure firewall rules allow connection
|
|
473
|
+
- Verify environment variables are loaded correctly
|
|
474
|
+
|
|
307
475
|
### Issue: "Deployment failed"
|
|
308
476
|
|
|
309
477
|
- Verify cloud provider credentials in Jenkins
|
|
@@ -315,6 +483,43 @@ npm config get prefix
|
|
|
315
483
|
|
|
316
484
|
For more troubleshooting, check the generated `.cicd/README.md` in your project.
|
|
317
485
|
|
|
486
|
+
## 🆕 What's New in v2.2.0
|
|
487
|
+
|
|
488
|
+
### Major Features
|
|
489
|
+
|
|
490
|
+
- ✅ **Infrastructure as Code (IaC)** - Generate Terraform scripts for AWS, Azure, GCP, and DigitalOcean
|
|
491
|
+
- ✅ **Docker Compose Generation** - Automatic local infrastructure setup (versioned and validated) 🆕
|
|
492
|
+
- ✅ **OIDC Authentication** - Support for secure, token-based authentication (Web Identity Federation)
|
|
493
|
+
- ✅ **Deployment Strategies** - Integrated Rolling, Blue-Green, and Canary deployment support
|
|
494
|
+
- ✅ **Visual Dashboard** - Post-deployment HTML summary for quick status overview
|
|
495
|
+
- ✅ **Configuration Presets** - Save your answers to `jenkins-generator-config.json` for rapid re-runs
|
|
496
|
+
- ✅ **Improved Validation** - Robust Git URL and port validation suite
|
|
497
|
+
|
|
498
|
+
## 🆕 What's New in v2.1.0
|
|
499
|
+
|
|
500
|
+
### Major Features
|
|
501
|
+
|
|
502
|
+
- ✅ **Load Balancer Integration** - Support for stable DNS URLs in deployment and health checks
|
|
503
|
+
- ✅ **Enhanced Health Checks** - Robust curl-based retries with dynamic URL extraction
|
|
504
|
+
- ✅ **Multi-Cloud Registry support** - Native integration with ECR, ACR, GCR, and DO Registry
|
|
505
|
+
- ✅ **Full Containerization** - Ready-to-use Docker image for easy distribution
|
|
506
|
+
|
|
507
|
+
## 🆕 What's New in v2.0.0
|
|
508
|
+
|
|
509
|
+
### Major Features
|
|
510
|
+
|
|
511
|
+
- ✅ **External Services Configuration** - Automatically configure databases, caching, queues, storage, and more
|
|
512
|
+
- ✅ **Environment Variables Management** - Automatic generation and injection
|
|
513
|
+
- ✅ **.env.template Generation** - For local development
|
|
514
|
+
- ✅ **20+ Services Supported** - PostgreSQL, MongoDB, Redis, S3, SMTP, Kafka, and more
|
|
515
|
+
- ✅ **Automatic Jenkins Credentials** - Generates complete credential setup guide
|
|
516
|
+
- ✅ **Security Enhancements** - Automatic secret detection and .gitignore updates
|
|
517
|
+
- ✅ **Complete Documentation** - New EXTERNAL_SERVICES_GUIDE.md
|
|
518
|
+
|
|
519
|
+
### Breaking Changes
|
|
520
|
+
|
|
521
|
+
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.
|
|
522
|
+
|
|
318
523
|
## 🤝 Contributing
|
|
319
524
|
|
|
320
525
|
Contributions are welcome! Please:
|
|
@@ -350,6 +555,7 @@ If this tool helped you, please:
|
|
|
350
555
|
- 🐦 Tweet about it
|
|
351
556
|
- 📝 Write a blog post
|
|
352
557
|
- 💬 Tell your friends
|
|
558
|
+
- You can also [buy me a coffee](For this please mail me at sulabhadhikari90@gmail.com)
|
|
353
559
|
|
|
354
560
|
---
|
|
355
561
|
|
|
@@ -361,5 +567,5 @@ _Stop configuring CI/CD manually. Start deploying automatically!_
|
|
|
361
567
|
npm install -g jenkins-generator
|
|
362
568
|
cd your-project
|
|
363
569
|
jenkins-generator
|
|
364
|
-
#
|
|
570
|
+
# Configure your services, deploy! 🎉
|
|
365
571
|
```
|
package/dist/app.module.js
CHANGED
|
@@ -15,6 +15,10 @@ const cloud_provider_service_1 = require("./services/cloud-provider.service");
|
|
|
15
15
|
const security_service_1 = require("./services/security.service");
|
|
16
16
|
const validation_service_1 = require("./services/validation.service");
|
|
17
17
|
const notification_service_1 = require("./services/notification.service");
|
|
18
|
+
const environment_service_1 = require("./services/environment.service");
|
|
19
|
+
const iac_service_1 = require("./services/iac.service");
|
|
20
|
+
const dashboard_service_1 = require("./services/dashboard.service");
|
|
21
|
+
const docker_compose_service_1 = require("./services/docker-compose.service");
|
|
18
22
|
let AppModule = class AppModule {
|
|
19
23
|
};
|
|
20
24
|
exports.AppModule = AppModule;
|
|
@@ -29,6 +33,10 @@ exports.AppModule = AppModule = __decorate([
|
|
|
29
33
|
security_service_1.SecurityService,
|
|
30
34
|
validation_service_1.ValidationService,
|
|
31
35
|
notification_service_1.NotificationService,
|
|
36
|
+
environment_service_1.EnvironmentService,
|
|
37
|
+
iac_service_1.IaCService,
|
|
38
|
+
dashboard_service_1.DashboardService,
|
|
39
|
+
docker_compose_service_1.DockerComposeService,
|
|
32
40
|
],
|
|
33
41
|
})
|
|
34
42
|
], AppModule);
|
package/dist/app.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,8EAAyE;AACzE,8DAA0D;AAC1D,wEAAoE;AACpE,8EAAyE;AACzE,kEAA8D;AAC9D,sEAAkE;AAClE,0EAAsE;
|
|
1
|
+
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,8EAAyE;AACzE,8DAA0D;AAC1D,wEAAoE;AACpE,8EAAyE;AACzE,kEAA8D;AAC9D,sEAAkE;AAClE,0EAAsE;AACtE,wEAAoE;AACpE,wDAAoD;AACpD,oEAAgE;AAChE,8EAAyE;AAkBlE,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAhBrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,EAAE;QACX,SAAS,EAAE;YACT,6CAAoB;YACpB,8BAAa;YACb,wCAAkB;YAClB,6CAAoB;YACpB,kCAAe;YACf,sCAAiB;YACjB,0CAAmB;YACnB,wCAAkB;YAClB,wBAAU;YACV,oCAAgB;YAChB,6CAAoB;SACrB;KACF,CAAC;GACW,SAAS,CAAG"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -23,4 +23,5 @@ __exportStar(require("./services/prompt.service"), exports);
|
|
|
23
23
|
__exportStar(require("./services/security.service"), exports);
|
|
24
24
|
__exportStar(require("./services/validation.service"), exports);
|
|
25
25
|
__exportStar(require("./interfaces/config.interface"), exports);
|
|
26
|
+
__exportStar(require("./services/environment.service"), exports);
|
|
26
27
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,oEAAkD;AAClD,oEAAkD;AAClD,iEAA+C;AAC/C,kEAAgD;AAChD,4DAA0C;AAC1C,8DAA4C;AAC5C,gEAA8C;AAC9C,gEAA8C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,oEAAkD;AAClD,oEAAkD;AAClD,iEAA+C;AAC/C,kEAAgD;AAChD,4DAA0C;AAC1C,8DAA4C;AAC5C,gEAA8C;AAC9C,gEAA8C;AAC9C,iEAA+C"}
|
|
@@ -9,6 +9,17 @@ export interface ProjectConfig {
|
|
|
9
9
|
runTests: boolean;
|
|
10
10
|
testCommand?: string;
|
|
11
11
|
buildCommand?: string;
|
|
12
|
+
requiresEnvFile: boolean;
|
|
13
|
+
envFilePath?: string;
|
|
14
|
+
externalServices: ExternalService[];
|
|
15
|
+
}
|
|
16
|
+
export interface ExternalService {
|
|
17
|
+
type: 'database' | 'cache' | 'queue' | 'storage' | 'email' | 'monitoring' | 'custom';
|
|
18
|
+
name: string;
|
|
19
|
+
service: string;
|
|
20
|
+
envVariables: EnvVariable[];
|
|
21
|
+
connectionString?: string;
|
|
22
|
+
requiresInfrastructure: boolean;
|
|
12
23
|
}
|
|
13
24
|
export interface CloudConfig {
|
|
14
25
|
provider: 'aws' | 'azure' | 'gcp' | 'digitalocean';
|
|
@@ -16,22 +27,40 @@ export interface CloudConfig {
|
|
|
16
27
|
region: string;
|
|
17
28
|
instanceType: string;
|
|
18
29
|
deploymentConfig: DeploymentConfig;
|
|
30
|
+
managedServices: ManagedService[];
|
|
31
|
+
}
|
|
32
|
+
export interface ManagedService {
|
|
33
|
+
type: 'database' | 'cache' | 'queue' | 'storage';
|
|
34
|
+
service: string;
|
|
35
|
+
tier: string;
|
|
36
|
+
autoProvision: boolean;
|
|
37
|
+
existingResourceId?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface EnvVariable {
|
|
40
|
+
key: string;
|
|
41
|
+
value?: string;
|
|
42
|
+
isSecret: boolean;
|
|
43
|
+
description: string;
|
|
19
44
|
}
|
|
20
45
|
export interface AWSCredentials {
|
|
21
|
-
accessKeyId
|
|
22
|
-
secretAccessKey
|
|
46
|
+
accessKeyId?: string;
|
|
47
|
+
secretAccessKey?: string;
|
|
23
48
|
region: string;
|
|
49
|
+
useOIDC: boolean;
|
|
50
|
+
oidcRoleArn?: string;
|
|
24
51
|
}
|
|
25
52
|
export interface AzureCredentials {
|
|
26
53
|
subscriptionId: string;
|
|
27
54
|
clientId: string;
|
|
28
|
-
clientSecret
|
|
55
|
+
clientSecret?: string;
|
|
29
56
|
tenantId: string;
|
|
57
|
+
useOIDC: boolean;
|
|
30
58
|
}
|
|
31
59
|
export interface GCPCredentials {
|
|
32
60
|
projectId: string;
|
|
33
|
-
keyFile
|
|
61
|
+
keyFile?: string;
|
|
34
62
|
region: string;
|
|
63
|
+
useOIDC: boolean;
|
|
35
64
|
}
|
|
36
65
|
export interface DOCredentials {
|
|
37
66
|
apiToken: string;
|
|
@@ -44,6 +73,12 @@ export interface DeploymentConfig {
|
|
|
44
73
|
maxInstances?: number;
|
|
45
74
|
healthCheckPath: string;
|
|
46
75
|
port: number;
|
|
76
|
+
useLoadBalancer: boolean;
|
|
77
|
+
loadBalancerUrl?: string;
|
|
78
|
+
deploymentStrategy: 'rolling' | 'blue-green' | 'canary';
|
|
79
|
+
environmentVariables: {
|
|
80
|
+
[key: string]: string;
|
|
81
|
+
};
|
|
47
82
|
}
|
|
48
83
|
export interface NotificationConfig {
|
|
49
84
|
email: string;
|
|
@@ -67,4 +102,7 @@ export interface JenkinsConfig {
|
|
|
67
102
|
agentLabel: string;
|
|
68
103
|
timeout: number;
|
|
69
104
|
retryCount: number;
|
|
105
|
+
environmentVariables: {
|
|
106
|
+
[key: string]: string;
|
|
107
|
+
};
|
|
70
108
|
}
|