jenkins-generator 1.0.1 โ†’ 2.0.1

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/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
  [![npm version](https://badge.fury.io/js/jenkins-generator.svg)](https://badge.fury.io/js/jenkins-generator)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
7
  [![Node.js](https://img.shields.io/badge/node-%3E%3D16.0.0-brightgreen.svg)](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
 
@@ -40,6 +54,7 @@ Never worry about CI/CD configuration again! This tool automatically generates p
40
54
  - **Container orchestration** on cloud platforms
41
55
  - **Health check verification**
42
56
  - **Automatic cleanup** of old images
57
+ - **Environment variables injection** into containers
43
58
 
44
59
  ### ๐Ÿงช Testing Integration
45
60
 
@@ -66,6 +81,8 @@ Never worry about CI/CD configuration again! This tool automatically generates p
66
81
  โŒ Configure cloud deployment scripts
67
82
  โŒ Set up notifications for each platform
68
83
  โŒ Handle credentials securely
84
+ โŒ Configure database connections manually
85
+ โŒ Manage environment variables
69
86
  โŒ Document the entire process
70
87
  โŒ Maintain and update pipelines
71
88
  ```
@@ -75,7 +92,9 @@ Never worry about CI/CD configuration again! This tool automatically generates p
75
92
  ```
76
93
  โœ… Run one command: jenkins-generator
77
94
  โœ… Answer a few questions
95
+ โœ… Configure databases, caching, queues automatically
78
96
  โœ… Get production-ready pipeline
97
+ โœ… Automatic .env.template generation
79
98
  โœ… Complete documentation included
80
99
  โœ… Security best practices built-in
81
100
  โœ… Multi-cloud support out of the box
@@ -125,6 +144,7 @@ The CLI will ask you about:
125
144
  - Git repository and branch
126
145
  - Docker configuration
127
146
  - Testing preferences
147
+ - **External services** (databases, caching, storage, etc.) ๐Ÿ†•
128
148
  - Cloud provider selection
129
149
  - Deployment settings
130
150
  - Notification channels
@@ -134,28 +154,41 @@ The CLI will ask you about:
134
154
 
135
155
  ```
136
156
  your-project/
137
- โ”œโ”€โ”€ Jenkinsfile # ๐ŸŽฏ Main pipeline
157
+ โ”œโ”€โ”€ Jenkinsfile # ๐ŸŽฏ Main pipeline with env vars
158
+ โ”œโ”€โ”€ .env.template # ๐Ÿ†• Template for local development
159
+ โ”œโ”€โ”€ .gitignore # ๐Ÿ†• Updated to exclude .env
138
160
  โ””โ”€โ”€ .cicd/
139
161
  โ”œโ”€โ”€ README.md # ๐Ÿ“– Project documentation
140
- โ”œโ”€โ”€ CREDENTIALS_SETUP.md # ๐Ÿ” Credential guide
162
+ โ”œโ”€โ”€ CREDENTIALS_SETUP.md # ๐Ÿ” Credential guide (with services)
141
163
  โ”œโ”€โ”€ config.encrypted.json # ๐Ÿ”’ Encrypted backup
142
164
  โ””โ”€โ”€ .gitignore # ๐Ÿšซ Protect secrets
143
165
  ```
144
166
 
145
- ### 5. Configure Jenkins
167
+ ### 5. Configure Services (New in v2.0.0!)
168
+
169
+ Copy `.env.template` to `.env` and fill in your values:
170
+
171
+ ```bash
172
+ cp .env.template .env
173
+ nano .env # or use your favorite editor
174
+ ```
175
+
176
+ ### 6. Configure Jenkins
146
177
 
147
178
  Follow the instructions in `.cicd/CREDENTIALS_SETUP.md` to:
148
179
 
149
180
  - Add credentials to Jenkins
181
+ - Configure external service credentials ๐Ÿ†•
150
182
  - Create pipeline job
151
183
  - Connect to your repository
152
184
 
153
- ### 6. Deploy!
185
+ ### 7. Deploy!
154
186
 
155
187
  Push your code and watch Jenkins automatically:
156
188
 
157
189
  - โœ… Checkout code
158
190
  - โœ… Install dependencies
191
+ - โœ… **Load environment variables** ๐Ÿ†•
159
192
  - โœ… Run tests
160
193
  - โœ… Build application
161
194
  - โœ… Create Docker image
@@ -166,7 +199,7 @@ Push your code and watch Jenkins automatically:
166
199
 
167
200
  ## ๐Ÿ“š Usage Examples
168
201
 
169
- ### Example 1: Node.js API on AWS
202
+ ### Example 1: Node.js API with PostgreSQL on AWS
170
203
 
171
204
  ```bash
172
205
  $ jenkins-generator
@@ -177,31 +210,105 @@ $ jenkins-generator
177
210
  ? Select project type: backend
178
211
  ? Select programming language: typescript
179
212
  ? Enter Git repository URL: https://github.com/user/my-api.git
180
- ? Enter branch name to deploy: master
181
- ? Does your project have a Dockerfile? Yes
182
- ? Should tests run before deployment? Yes
213
+ ? Does your application use external services? Yes
214
+
215
+ ๐Ÿ“ฆ Let's configure your external services...
216
+
217
+ ? Select service type: Database
218
+ ? Select database type: postgresql
219
+ ? Database host environment variable name: DB_HOST
220
+ ? Database password environment variable name: DB_PASSWORD
221
+
222
+ ? Add another service? No
223
+
183
224
  ? Select cloud provider: aws
184
225
  ? Select AWS region: us-east-1
185
- ? Select instance type: t2.small
186
226
  ? Enable auto-scaling? Yes
187
227
 
188
228
  โœ… Jenkins pipeline generated successfully!
189
229
  ```
190
230
 
191
- ### Example 2: React App on GCP
231
+ **Generated .env.template:**
232
+
233
+ ```env
234
+ # postgres-main (postgresql)
235
+ DB_HOST=localhost
236
+ DB_PORT=5432
237
+ DB_NAME=myapp
238
+ DB_USERNAME=your_db_username_here
239
+ DB_PASSWORD=your_db_password_here
240
+ DATABASE_URL=your_database_url_here
241
+ ```
242
+
243
+ ### Example 2: React App with S3 Storage on GCP
192
244
 
193
245
  ```bash
194
246
  $ jenkins-generator
195
247
 
196
248
  ? Enter your project name: my-react-app
197
249
  ? Select project type: frontend
198
- ? Select programming language: javascript
199
- ? Select cloud provider: gcp
200
- ? Select GCP region: us-central1
250
+ ? Does your application use external services? Yes
251
+
252
+ ? Select service type: Storage
253
+ ? Select storage service: s3
254
+ ? Bucket name environment variable: S3_BUCKET
255
+ ? Access key environment variable: S3_ACCESS_KEY
201
256
 
202
257
  โœ… Jenkins pipeline generated successfully!
203
258
  ```
204
259
 
260
+ ## ๐Ÿ—„๏ธ Supported External Services (v2.0.0)
261
+
262
+ ### Databases
263
+
264
+ - PostgreSQL
265
+ - MongoDB
266
+ - MySQL / MariaDB
267
+ - Redis
268
+ - DynamoDB
269
+ - CosmosDB
270
+
271
+ ### Caching
272
+
273
+ - Redis
274
+ - Memcached
275
+ - ElastiCache
276
+
277
+ ### Message Queues
278
+
279
+ - RabbitMQ
280
+ - Apache Kafka
281
+ - AWS SQS
282
+ - Azure Service Bus
283
+
284
+ ### Storage
285
+
286
+ - AWS S3
287
+ - Azure Blob Storage
288
+ - Google Cloud Storage
289
+ - MinIO
290
+ - DigitalOcean Spaces
291
+
292
+ ### Email Services
293
+
294
+ - SMTP
295
+ - SendGrid
296
+ - AWS SES
297
+ - Mailgun
298
+ - Postmark
299
+
300
+ ### Monitoring
301
+
302
+ - DataDog
303
+ - New Relic
304
+ - Sentry
305
+ - Prometheus
306
+ - Grafana
307
+
308
+ ### Custom Services
309
+
310
+ - Any service with custom environment variables
311
+
205
312
  ## ๐Ÿ—๏ธ What Gets Generated
206
313
 
207
314
  ### Jenkinsfile
@@ -210,6 +317,7 @@ Complete Jenkins pipeline with:
210
317
 
211
318
  - Git checkout
212
319
  - Dependency installation
320
+ - **External services environment variables** ๐Ÿ†•
213
321
  - Test execution (optional)
214
322
  - Application build
215
323
  - Docker image creation
@@ -218,11 +326,35 @@ Complete Jenkins pipeline with:
218
326
  - Health checks
219
327
  - Notifications
220
328
 
329
+ **Example Jenkinsfile Environment Block:**
330
+
331
+ ```groovy
332
+ environment {
333
+ // Cloud credentials
334
+ AWS_ACCESS_KEY_ID = credentials('aws-access-key-id')
335
+
336
+ // Database credentials (auto-generated)
337
+ DB_HOST = '${env.DB_HOST ?: ""}'
338
+ DB_USERNAME = credentials('db-username')
339
+ DB_PASSWORD = credentials('db-password')
340
+
341
+ // Redis credentials
342
+ REDIS_HOST = '${env.REDIS_HOST ?: ""}'
343
+ REDIS_PASSWORD = credentials('redis-password')
344
+
345
+ // S3 credentials
346
+ S3_BUCKET = '${env.S3_BUCKET ?: ""}'
347
+ S3_ACCESS_KEY = credentials('s3-access-key')
348
+ }
349
+ ```
350
+
221
351
  ### Documentation
222
352
 
223
353
  - **README.md** - Project-specific pipeline documentation
224
- - **CREDENTIALS_SETUP.md** - Step-by-step Jenkins credential setup
354
+ - **CREDENTIALS_SETUP.md** - Step-by-step Jenkins credential setup (includes external services) ๐Ÿ†•
225
355
  - **config.encrypted.json** - Encrypted configuration backup
356
+ - **.env.template** - Template for local development ๐Ÿ†•
357
+ - **EXTERNAL_SERVICES_GUIDE.md** - Complete guide for services configuration ๐Ÿ†•
226
358
 
227
359
  ## ๐Ÿ”ง Supported Cloud Providers
228
360
 
@@ -241,10 +373,13 @@ Complete Jenkins pipeline with:
241
373
  - **No plain-text secrets** in generated files
242
374
  - **Security best practices** documentation
243
375
  - **Credential rotation** reminders
376
+ - **Automatic .gitignore** protection for .env files ๐Ÿ†•
377
+ - **Secret vs non-secret detection** for environment variables ๐Ÿ†•
244
378
 
245
379
  ## ๐Ÿ“– Documentation
246
380
 
247
381
  - [Setup Guide](./SETUP_GUIDE.md) - Complete installation and setup
382
+ - [External Services Guide](./EXTERNAL_SERVICES_GUIDE.md) - Configuration for databases, caching, etc. ๐Ÿ†•
248
383
  - [Deployment Checklist](./DEPLOYMENT_CHECKLIST.md) - Pre/post deployment steps
249
384
  - [Troubleshooting](#troubleshooting) - Common issues and solutions
250
385
 
@@ -304,6 +439,13 @@ npm config get prefix
304
439
  - Check path is relative to project root
305
440
  - Verify file name is exactly `Dockerfile` (case-sensitive)
306
441
 
442
+ ### Issue: "Cannot connect to database"
443
+
444
+ - Verify database credentials in Jenkins
445
+ - Check network connectivity from Jenkins to database
446
+ - Ensure firewall rules allow connection
447
+ - Verify environment variables are loaded correctly
448
+
307
449
  ### Issue: "Deployment failed"
308
450
 
309
451
  - Verify cloud provider credentials in Jenkins
@@ -315,6 +457,22 @@ npm config get prefix
315
457
 
316
458
  For more troubleshooting, check the generated `.cicd/README.md` in your project.
317
459
 
460
+ ## ๐Ÿ†• What's New in v2.0.0
461
+
462
+ ### Major Features
463
+
464
+ - โœ… **External Services Configuration** - Automatically configure databases, caching, queues, storage, and more
465
+ - โœ… **Environment Variables Management** - Automatic generation and injection
466
+ - โœ… **.env.template Generation** - For local development
467
+ - โœ… **20+ Services Supported** - PostgreSQL, MongoDB, Redis, S3, SMTP, Kafka, and more
468
+ - โœ… **Automatic Jenkins Credentials** - Generates complete credential setup guide
469
+ - โœ… **Security Enhancements** - Automatic secret detection and .gitignore updates
470
+ - โœ… **Complete Documentation** - New EXTERNAL_SERVICES_GUIDE.md
471
+
472
+ ### Breaking Changes
473
+
474
+ 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.
475
+
318
476
  ## ๐Ÿค Contributing
319
477
 
320
478
  Contributions are welcome! Please:
@@ -350,6 +508,7 @@ If this tool helped you, please:
350
508
  - ๐Ÿฆ Tweet about it
351
509
  - ๐Ÿ“ Write a blog post
352
510
  - ๐Ÿ’ฌ Tell your friends
511
+ - You can also [buy me a coffee](For this please mail me at sulabhadhikari90@gmail.com)
353
512
 
354
513
  ---
355
514
 
@@ -361,5 +520,5 @@ _Stop configuring CI/CD manually. Start deploying automatically!_
361
520
  npm install -g jenkins-generator
362
521
  cd your-project
363
522
  jenkins-generator
364
- # That's it! ๐ŸŽ‰
523
+ # Configure your services, deploy! ๐ŸŽ‰
365
524
  ```
@@ -15,6 +15,7 @@ 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");
18
19
  let AppModule = class AppModule {
19
20
  };
20
21
  exports.AppModule = AppModule;
@@ -29,6 +30,7 @@ exports.AppModule = AppModule = __decorate([
29
30
  security_service_1.SecurityService,
30
31
  validation_service_1.ValidationService,
31
32
  notification_service_1.NotificationService,
33
+ environment_service_1.EnvironmentService,
32
34
  ],
33
35
  })
34
36
  ], AppModule);
@@ -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;AAc/D,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAZrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,EAAE;QACX,SAAS,EAAE;YACT,6CAAoB;YACpB,8BAAa;YACb,wCAAkB;YAClB,6CAAoB;YACpB,kCAAe;YACf,sCAAiB;YACjB,0CAAmB;SACpB;KACF,CAAC;GACW,SAAS,CAAG"}
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;AAe7D,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAbrB,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;SACnB;KACF,CAAC;GACW,SAAS,CAAG"}
package/dist/index.d.ts CHANGED
@@ -7,3 +7,4 @@ export * from './services/prompt.service';
7
7
  export * from './services/security.service';
8
8
  export * from './services/validation.service';
9
9
  export * from './interfaces/config.interface';
10
+ export * from './services/environment.service';
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,6 +27,20 @@ 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
46
  accessKeyId: string;
@@ -44,6 +69,9 @@ export interface DeploymentConfig {
44
69
  maxInstances?: number;
45
70
  healthCheckPath: string;
46
71
  port: number;
72
+ environmentVariables: {
73
+ [key: string]: string;
74
+ };
47
75
  }
48
76
  export interface NotificationConfig {
49
77
  email: string;
@@ -67,4 +95,7 @@ export interface JenkinsConfig {
67
95
  agentLabel: string;
68
96
  timeout: number;
69
97
  retryCount: number;
98
+ environmentVariables: {
99
+ [key: string]: string;
100
+ };
70
101
  }
@@ -2,13 +2,16 @@ import { PromptService } from './prompt.service';
2
2
  import { JenkinsFileService } from './jenkinsfile.service';
3
3
  import { SecurityService } from './security.service';
4
4
  import { ValidationService } from './validation.service';
5
+ import { EnvironmentService } from './environment.service';
5
6
  export declare class CICDGeneratorService {
6
7
  private readonly promptService;
7
8
  private readonly jenkinsFileService;
8
9
  private readonly securityService;
9
10
  private readonly validationService;
10
- constructor(promptService: PromptService, jenkinsFileService: JenkinsFileService, securityService: SecurityService, validationService: ValidationService);
11
+ private readonly environmentService;
12
+ constructor(promptService: PromptService, jenkinsFileService: JenkinsFileService, securityService: SecurityService, validationService: ValidationService, environmentService: EnvironmentService);
11
13
  run(): Promise<void>;
12
14
  private writeFiles;
15
+ private updateRootGitignore;
13
16
  private displaySummary;
14
17
  }
@@ -51,6 +51,7 @@ const prompt_service_1 = require("./prompt.service");
51
51
  const jenkinsfile_service_1 = require("./jenkinsfile.service");
52
52
  const security_service_1 = require("./security.service");
53
53
  const validation_service_1 = require("./validation.service");
54
+ const environment_service_1 = require("./environment.service");
54
55
  const fs = __importStar(require("fs-extra"));
55
56
  const path = __importStar(require("path"));
56
57
  const chalk_1 = __importDefault(require("chalk"));
@@ -60,11 +61,13 @@ let CICDGeneratorService = class CICDGeneratorService {
60
61
  jenkinsFileService;
61
62
  securityService;
62
63
  validationService;
63
- constructor(promptService, jenkinsFileService, securityService, validationService) {
64
+ environmentService;
65
+ constructor(promptService, jenkinsFileService, securityService, validationService, environmentService) {
64
66
  this.promptService = promptService;
65
67
  this.jenkinsFileService = jenkinsFileService;
66
68
  this.securityService = securityService;
67
69
  this.validationService = validationService;
70
+ this.environmentService = environmentService;
68
71
  }
69
72
  async run() {
70
73
  try {
@@ -73,7 +76,7 @@ let CICDGeneratorService = class CICDGeneratorService {
73
76
  try {
74
77
  const packageJson = await this.validationService.readPackageJson();
75
78
  spinner.succeed('Project structure validated');
76
- console.log(chalk_1.default.gray(`Found projhect: ${packageJson.name}`));
79
+ console.log(chalk_1.default.gray(`Found project: ${packageJson.name}\n`));
77
80
  }
78
81
  catch (error) {
79
82
  spinner.fail('Project validation failed');
@@ -86,16 +89,22 @@ let CICDGeneratorService = class CICDGeneratorService {
86
89
  generatingSpinner.succeed('Jenkinsfile generated');
87
90
  const credentialsGuide = this.jenkinsFileService.generateCredentialsSetupGuide(config);
88
91
  const readme = this.jenkinsFileService.generateReadme(config);
92
+ let envTemplate = '';
93
+ if (config.project.externalServices &&
94
+ config.project.externalServices.length > 0) {
95
+ envTemplate = this.environmentService.generateEnvFileTemplate(config.project.externalServices);
96
+ }
89
97
  const writingSpinner = (0, ora_1.default)('Writing files...').start();
90
- await this.writeFiles(jenkinsfile, credentialsGuide, readme, config);
98
+ await this.writeFiles(jenkinsfile, credentialsGuide, readme, envTemplate, config);
91
99
  writingSpinner.succeed('Files written successfully');
92
100
  this.displaySummary(config);
93
101
  }
94
102
  catch (error) {
95
- console.error(chalk_1.default.red('\nโŒ Error:'), error);
103
+ console.error(chalk_1.default.red('\nโŒ Error:'), error.message);
104
+ throw error;
96
105
  }
97
106
  }
98
- async writeFiles(jenkinsfile, credentialsGuide, readme, config) {
107
+ async writeFiles(jenkinsfile, credentialsGuide, readme, envTemplate, config) {
99
108
  const rootDir = process.cwd();
100
109
  const cicdDir = path.join(rootDir, '.cicd');
101
110
  await fs.ensureDir(cicdDir);
@@ -105,17 +114,58 @@ let CICDGeneratorService = class CICDGeneratorService {
105
114
  await fs.writeFile(credentialsPath, credentialsGuide);
106
115
  const readmePath = path.join(cicdDir, 'README.md');
107
116
  await fs.writeFile(readmePath, readme);
117
+ if (envTemplate) {
118
+ const envTemplatePath = path.join(rootDir, '.env.template');
119
+ await fs.writeFile(envTemplatePath, envTemplate);
120
+ console.log(chalk_1.default.green('\n๐Ÿ“„ Generated .env.template for local development'));
121
+ }
108
122
  const configPath = path.join(cicdDir, 'config.encrypted.json');
109
123
  const encryptedConfig = this.securityService.encryptCredentials(config);
110
124
  await fs.writeFile(configPath, JSON.stringify({ encrypted: encryptedConfig }, null, 2));
111
125
  const gitignorePath = path.join(cicdDir, '.gitignore');
112
126
  await fs.writeFile(gitignorePath, 'config.encrypted.json\n*.log\n');
127
+ await this.updateRootGitignore(rootDir);
113
128
  console.log(chalk_1.default.green('\n๐Ÿ“ Generated files:'));
114
129
  console.log(chalk_1.default.gray(` โ”œโ”€ Jenkinsfile (${jenkinsfilePath})`));
130
+ if (envTemplate) {
131
+ console.log(chalk_1.default.gray(` โ”œโ”€ .env.template (for local development)`));
132
+ }
115
133
  console.log(chalk_1.default.gray(` โ”œโ”€ .cicd/CREDENTIALS_SETUP.md`));
116
134
  console.log(chalk_1.default.gray(` โ”œโ”€ .cicd/README.md`));
117
135
  console.log(chalk_1.default.gray(` โ””โ”€ .cicd/config.encrypted.json`));
118
136
  }
137
+ async updateRootGitignore(rootDir) {
138
+ const gitignorePath = path.join(rootDir, '.gitignore');
139
+ try {
140
+ let gitignoreContent = '';
141
+ if (await fs.pathExists(gitignorePath)) {
142
+ gitignoreContent = await fs.readFile(gitignorePath, 'utf-8');
143
+ }
144
+ const entriesToAdd = [
145
+ '# Environment variables',
146
+ '.env',
147
+ '.env.local',
148
+ '.env.*.local',
149
+ ];
150
+ let needsUpdate = false;
151
+ const newEntries = [];
152
+ for (const entry of entriesToAdd) {
153
+ if (!gitignoreContent.includes(entry)) {
154
+ newEntries.push(entry);
155
+ needsUpdate = true;
156
+ }
157
+ }
158
+ if (needsUpdate) {
159
+ const separator = gitignoreContent ? '\n\n' : '';
160
+ gitignoreContent += separator + newEntries.join('\n') + '\n';
161
+ await fs.writeFile(gitignorePath, gitignoreContent);
162
+ console.log(chalk_1.default.gray(' โ”œโ”€ Updated .gitignore to exclude .env files'));
163
+ }
164
+ }
165
+ catch (error) {
166
+ console.log(chalk_1.default.yellow(' โš ๏ธ Could not update .gitignore (non-critical)'));
167
+ }
168
+ }
119
169
  displaySummary(config) {
120
170
  console.log(chalk_1.default.green.bold('\nโœ… CICD Pipeline Generated Successfully!\n'));
121
171
  console.log(chalk_1.default.cyan('๐Ÿ“‹ Configuration Summary:'));
@@ -130,19 +180,37 @@ let CICDGeneratorService = class CICDGeneratorService {
130
180
  console.log(chalk_1.default.white(` Instance: ${config.cloud.instanceType}`));
131
181
  console.log(chalk_1.default.white(` Tests: ${config.project.runTests ? 'Enabled' : 'Disabled'}`));
132
182
  console.log(chalk_1.default.white(` Auto-scaling: ${config.cloud.deploymentConfig.autoScaling ? 'Enabled' : 'Disabled'}`));
183
+ if (config.project.externalServices &&
184
+ config.project.externalServices.length > 0) {
185
+ console.log(chalk_1.default.white(` External Services: ${config.project.externalServices.length} configured`));
186
+ for (const service of config.project.externalServices) {
187
+ console.log(chalk_1.default.gray(` - ${service.name} (${service.service})`));
188
+ }
189
+ }
133
190
  console.log(chalk_1.default.gray('โ”€'.repeat(60)));
134
191
  console.log(chalk_1.default.yellow('\n๐Ÿ“ Next Steps:\n'));
135
192
  console.log(chalk_1.default.white(' 1. Review the generated Jenkinsfile in your project root'));
136
- console.log(chalk_1.default.white(' 2. Read .cicd/CREDENTIALS_SETUP.md for Jenkins credential setup'));
137
- console.log(chalk_1.default.white(' 3. Configure Jenkins credentials as specified'));
138
- console.log(chalk_1.default.white(' 4. Create a new Jenkins Pipeline job'));
139
- console.log(chalk_1.default.white(' 5. Point Jenkins to your repository'));
140
- console.log(chalk_1.default.white(' 6. Run the pipeline and monitor deployment'));
193
+ if (config.project.externalServices &&
194
+ config.project.externalServices.length > 0) {
195
+ console.log(chalk_1.default.white(' 2. Copy .env.template to .env and fill in your values'));
196
+ console.log(chalk_1.default.white(' 3. Read .cicd/CREDENTIALS_SETUP.md for Jenkins credential setup'));
197
+ }
198
+ else {
199
+ console.log(chalk_1.default.white(' 2. Read .cicd/CREDENTIALS_SETUP.md for Jenkins credential setup'));
200
+ }
201
+ console.log(chalk_1.default.white(' 4. Configure Jenkins credentials as specified'));
202
+ console.log(chalk_1.default.white(' 5. Create a new Jenkins Pipeline job'));
203
+ console.log(chalk_1.default.white(' 6. Point Jenkins to your repository'));
204
+ console.log(chalk_1.default.white(' 7. Run the pipeline and monitor deployment'));
141
205
  console.log(chalk_1.default.yellow('\nโš ๏ธ Important Security Notes:\n'));
142
- console.log(chalk_1.default.red(' โ€ข NEVER commit .cicd/config.encrypted.json to version control'));
206
+ console.log(chalk_1.default.red(' โ€ข NEVER commit .env or .cicd/config.encrypted.json to version control'));
143
207
  console.log(chalk_1.default.red(' โ€ข Always use Jenkins credential storage for sensitive data'));
144
208
  console.log(chalk_1.default.red(' โ€ข Review and rotate credentials regularly'));
145
209
  console.log(chalk_1.default.red(' โ€ข Keep your Jenkinsfile in version control'));
210
+ if (config.project.externalServices &&
211
+ config.project.externalServices.length > 0) {
212
+ console.log(chalk_1.default.red(' โ€ข .env.template is safe to commit, but NEVER commit .env'));
213
+ }
146
214
  console.log(chalk_1.default.cyan('\n๐Ÿš€ Your CI/CD pipeline is ready for deployment!\n'));
147
215
  console.log(chalk_1.default.gray(`For detailed documentation, check .cicd/README.md\n`));
148
216
  }
@@ -153,6 +221,7 @@ exports.CICDGeneratorService = CICDGeneratorService = __decorate([
153
221
  __metadata("design:paramtypes", [prompt_service_1.PromptService,
154
222
  jenkinsfile_service_1.JenkinsFileService,
155
223
  security_service_1.SecurityService,
156
- validation_service_1.ValidationService])
224
+ validation_service_1.ValidationService,
225
+ environment_service_1.EnvironmentService])
157
226
  ], CICDGeneratorService);
158
227
  //# sourceMappingURL=cicd-generator.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cicd-generator.service.js","sourceRoot":"","sources":["../../src/services/cicd-generator.service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G,CAAC,eAAK,CAAC,GAAG,CAAC,6CAA6C,CAAC,CAAC,CAAC;QACtE,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC,CAAC;QAEvE,OAAO,CAAC,GAAG,CACT,eAAK,CAAC,IAAI,CAAC,qDAAqD,CAAC,CAClE,CAAC;QACF,OAAO,CAAC,GAAG,CACT,eAAK,CAAC,IAAI,CAAC,qDAAqD,CAAC,CAClE,CAAC;IACJ,CAAC;CACF,CAAA;AA1JY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;qCAGuB,8BAAa;QACR,wCAAkB;QACrB,kCAAe;QACb,sCAAiB;GAL5C,oBAAoB,CA0JhC"}
1
+ {"version":3,"file":"cicd-generator.service.js","sourceRoot":"","sources":["../../src/services/cicd-generator.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,qDAAiD;AACjD,+DAA2D;AAC3D,yDAAqD;AACrD,6DAAyD;AACzD,+DAA2D;AAC3D,6CAA+B;AAC/B,2CAA6B;AAC7B,kDAA0B;AAC1B,8CAAsB;AAGf,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAEZ;IACA;IACA;IACA;IACA;IALnB,YACmB,aAA4B,EAC5B,kBAAsC,EACtC,eAAgC,EAChC,iBAAoC,EACpC,kBAAsC;QAJtC,kBAAa,GAAb,aAAa,CAAe;QAC5B,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,oBAAe,GAAf,eAAe,CAAiB;QAChC,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,uBAAkB,GAAlB,kBAAkB,CAAoB;IACtD,CAAC;IAEJ,KAAK,CAAC,GAAG;QACP,IAAI,CAAC;YACH,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC,CAAC;YAG5D,MAAM,OAAO,GAAG,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