jenkins-generator 1.0.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/.prettierrc +4 -0
- package/README.md +365 -0
- package/dist/app.controller.d.ts +6 -0
- package/dist/app.controller.js +35 -0
- package/dist/app.controller.js.map +1 -0
- package/dist/app.controller.spec.d.ts +1 -0
- package/dist/app.controller.spec.js +21 -0
- package/dist/app.controller.spec.js.map +1 -0
- package/dist/app.module.d.ts +2 -0
- package/dist/app.module.js +35 -0
- package/dist/app.module.js.map +1 -0
- package/dist/app.service.d.ts +3 -0
- package/dist/app.service.js +20 -0
- package/dist/app.service.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +32 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/config.interface.d.ts +70 -0
- package/dist/interfaces/config.interface.js +3 -0
- package/dist/interfaces/config.interface.js.map +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +3 -0
- package/dist/main.js.map +1 -0
- package/dist/services/cicd-generator.service.d.ts +14 -0
- package/dist/services/cicd-generator.service.js +158 -0
- package/dist/services/cicd-generator.service.js.map +1 -0
- package/dist/services/cloud-provider.service.d.ts +9 -0
- package/dist/services/cloud-provider.service.js +230 -0
- package/dist/services/cloud-provider.service.js.map +1 -0
- package/dist/services/jenkinsfile.service.d.ts +14 -0
- package/dist/services/jenkinsfile.service.js +414 -0
- package/dist/services/jenkinsfile.service.js.map +1 -0
- package/dist/services/notification.service.d.ts +10 -0
- package/dist/services/notification.service.js +235 -0
- package/dist/services/notification.service.js.map +1 -0
- package/dist/services/prompt.service.d.ts +16 -0
- package/dist/services/prompt.service.js +415 -0
- package/dist/services/prompt.service.js.map +1 -0
- package/dist/services/security.service.d.ts +9 -0
- package/dist/services/security.service.js +95 -0
- package/dist/services/security.service.js.map +1 -0
- package/dist/services/validation.service.d.ts +8 -0
- package/dist/services/validation.service.js +140 -0
- package/dist/services/validation.service.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/eslint.config.mjs +34 -0
- package/nest-cli.json +8 -0
- package/package.json +67 -0
- package/tsconfig.build.json +4 -0
package/.prettierrc
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
# Jenkins Generator ๐
|
|
2
|
+
|
|
3
|
+
> **Automated Jenkins CI/CD pipeline generator for multi-cloud deployments**
|
|
4
|
+
|
|
5
|
+
[](https://badge.fury.io/js/jenkins-generator)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://nodejs.org/)
|
|
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.
|
|
10
|
+
|
|
11
|
+
## โจ Features
|
|
12
|
+
|
|
13
|
+
### ๐ Multi-Cloud Support
|
|
14
|
+
|
|
15
|
+
- **AWS** - ECS Fargate deployments with auto-scaling
|
|
16
|
+
- **Azure** - Container Instances with resource groups
|
|
17
|
+
- **GCP** - Cloud Run serverless containers
|
|
18
|
+
- **DigitalOcean** - App Platform deployments
|
|
19
|
+
|
|
20
|
+
### ๐ Security First
|
|
21
|
+
|
|
22
|
+
- **AES-256 encryption** for credential storage
|
|
23
|
+
- **Masked sensitive data** in logs and output
|
|
24
|
+
- **Secure Jenkins credential references**
|
|
25
|
+
- **No hardcoded secrets** in generated files
|
|
26
|
+
- **Credential rotation reminders**
|
|
27
|
+
|
|
28
|
+
### ๐ง Multi-Channel Notifications
|
|
29
|
+
|
|
30
|
+
- **Email** - HTML formatted with build details
|
|
31
|
+
- **Slack** - Rich attachments with color coding
|
|
32
|
+
- **Discord** - Embedded messages with status
|
|
33
|
+
- **Microsoft Teams** - Adaptive cards
|
|
34
|
+
- **Telegram** - Markdown formatted messages
|
|
35
|
+
|
|
36
|
+
### ๐ณ Docker-Based Deployments
|
|
37
|
+
|
|
38
|
+
- **Automated image building** from your Dockerfile
|
|
39
|
+
- **Registry push** to Docker Hub or private registry
|
|
40
|
+
- **Container orchestration** on cloud platforms
|
|
41
|
+
- **Health check verification**
|
|
42
|
+
- **Automatic cleanup** of old images
|
|
43
|
+
|
|
44
|
+
### ๐งช Testing Integration
|
|
45
|
+
|
|
46
|
+
- **Optional test execution** before deployment
|
|
47
|
+
- **Configurable test commands**
|
|
48
|
+
- **Test result publishing** in Jenkins
|
|
49
|
+
- **Retry logic** for flaky tests
|
|
50
|
+
|
|
51
|
+
### ๐ Advanced Features
|
|
52
|
+
|
|
53
|
+
- **Auto-scaling configuration**
|
|
54
|
+
- **Health check endpoints**
|
|
55
|
+
- **Deployment tier management** (dev/staging/production)
|
|
56
|
+
- **Build retry logic**
|
|
57
|
+
- **Comprehensive logging**
|
|
58
|
+
- **Post-deployment verification**
|
|
59
|
+
|
|
60
|
+
## ๐ฏ Why Use This?
|
|
61
|
+
|
|
62
|
+
**Before:**
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
โ Manually write Jenkinsfile (hours of work)
|
|
66
|
+
โ Configure cloud deployment scripts
|
|
67
|
+
โ Set up notifications for each platform
|
|
68
|
+
โ Handle credentials securely
|
|
69
|
+
โ Document the entire process
|
|
70
|
+
โ Maintain and update pipelines
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**After:**
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
โ
Run one command: jenkins-generator
|
|
77
|
+
โ
Answer a few questions
|
|
78
|
+
โ
Get production-ready pipeline
|
|
79
|
+
โ
Complete documentation included
|
|
80
|
+
โ
Security best practices built-in
|
|
81
|
+
โ
Multi-cloud support out of the box
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## ๐ฆ Installation
|
|
85
|
+
|
|
86
|
+
### Global Installation (Recommended)
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
npm install -g jenkins-generator
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Local Installation
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
npm install --save-dev jenkins-generator
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Requirements
|
|
99
|
+
|
|
100
|
+
- **Node.js** 16.0.0 or higher
|
|
101
|
+
- **npm** 7.0.0 or higher
|
|
102
|
+
- **Git** repository
|
|
103
|
+
- **Dockerfile** in your project (or we'll guide you)
|
|
104
|
+
- **Jenkins** 2.0+ with required plugins
|
|
105
|
+
|
|
106
|
+
## ๐ Quick Start
|
|
107
|
+
|
|
108
|
+
### 1. Navigate to Your Project
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
cd your-awesome-project
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### 2. Run the Generator
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
jenkins-generator
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### 3. Answer Questions
|
|
121
|
+
|
|
122
|
+
The CLI will ask you about:
|
|
123
|
+
|
|
124
|
+
- Project details (name, type, language)
|
|
125
|
+
- Git repository and branch
|
|
126
|
+
- Docker configuration
|
|
127
|
+
- Testing preferences
|
|
128
|
+
- Cloud provider selection
|
|
129
|
+
- Deployment settings
|
|
130
|
+
- Notification channels
|
|
131
|
+
- Jenkins configuration
|
|
132
|
+
|
|
133
|
+
### 4. Review Generated Files
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
your-project/
|
|
137
|
+
โโโ Jenkinsfile # ๐ฏ Main pipeline
|
|
138
|
+
โโโ .cicd/
|
|
139
|
+
โโโ README.md # ๐ Project documentation
|
|
140
|
+
โโโ CREDENTIALS_SETUP.md # ๐ Credential guide
|
|
141
|
+
โโโ config.encrypted.json # ๐ Encrypted backup
|
|
142
|
+
โโโ .gitignore # ๐ซ Protect secrets
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### 5. Configure Jenkins
|
|
146
|
+
|
|
147
|
+
Follow the instructions in `.cicd/CREDENTIALS_SETUP.md` to:
|
|
148
|
+
|
|
149
|
+
- Add credentials to Jenkins
|
|
150
|
+
- Create pipeline job
|
|
151
|
+
- Connect to your repository
|
|
152
|
+
|
|
153
|
+
### 6. Deploy!
|
|
154
|
+
|
|
155
|
+
Push your code and watch Jenkins automatically:
|
|
156
|
+
|
|
157
|
+
- โ
Checkout code
|
|
158
|
+
- โ
Install dependencies
|
|
159
|
+
- โ
Run tests
|
|
160
|
+
- โ
Build application
|
|
161
|
+
- โ
Create Docker image
|
|
162
|
+
- โ
Push to registry
|
|
163
|
+
- โ
Deploy to cloud
|
|
164
|
+
- โ
Verify health
|
|
165
|
+
- โ
Send notifications
|
|
166
|
+
|
|
167
|
+
## ๐ Usage Examples
|
|
168
|
+
|
|
169
|
+
### Example 1: Node.js API on AWS
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
$ jenkins-generator
|
|
173
|
+
|
|
174
|
+
๐ Jenkins Generator
|
|
175
|
+
|
|
176
|
+
? Enter your project name: my-api
|
|
177
|
+
? Select project type: backend
|
|
178
|
+
? Select programming language: typescript
|
|
179
|
+
? 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
|
|
183
|
+
? Select cloud provider: aws
|
|
184
|
+
? Select AWS region: us-east-1
|
|
185
|
+
? Select instance type: t2.small
|
|
186
|
+
? Enable auto-scaling? Yes
|
|
187
|
+
|
|
188
|
+
โ
Jenkins pipeline generated successfully!
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Example 2: React App on GCP
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
$ jenkins-generator
|
|
195
|
+
|
|
196
|
+
? Enter your project name: my-react-app
|
|
197
|
+
? Select project type: frontend
|
|
198
|
+
? Select programming language: javascript
|
|
199
|
+
? Select cloud provider: gcp
|
|
200
|
+
? Select GCP region: us-central1
|
|
201
|
+
|
|
202
|
+
โ
Jenkins pipeline generated successfully!
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## ๐๏ธ What Gets Generated
|
|
206
|
+
|
|
207
|
+
### Jenkinsfile
|
|
208
|
+
|
|
209
|
+
Complete Jenkins pipeline with:
|
|
210
|
+
|
|
211
|
+
- Git checkout
|
|
212
|
+
- Dependency installation
|
|
213
|
+
- Test execution (optional)
|
|
214
|
+
- Application build
|
|
215
|
+
- Docker image creation
|
|
216
|
+
- Registry push
|
|
217
|
+
- Cloud deployment
|
|
218
|
+
- Health checks
|
|
219
|
+
- Notifications
|
|
220
|
+
|
|
221
|
+
### Documentation
|
|
222
|
+
|
|
223
|
+
- **README.md** - Project-specific pipeline documentation
|
|
224
|
+
- **CREDENTIALS_SETUP.md** - Step-by-step Jenkins credential setup
|
|
225
|
+
- **config.encrypted.json** - Encrypted configuration backup
|
|
226
|
+
|
|
227
|
+
## ๐ง Supported Cloud Providers
|
|
228
|
+
|
|
229
|
+
| Provider | Service | Features |
|
|
230
|
+
| ---------------- | ------------------- | --------------------------------------------- |
|
|
231
|
+
| **AWS** | ECS Fargate | Auto-scaling, Health checks, CloudWatch logs |
|
|
232
|
+
| **Azure** | Container Instances | Resource groups, Managed identities |
|
|
233
|
+
| **GCP** | Cloud Run | Serverless, Auto-scaling, Built-in monitoring |
|
|
234
|
+
| **DigitalOcean** | App Platform | Simple deployment, Automatic SSL |
|
|
235
|
+
|
|
236
|
+
## ๐ Security Features
|
|
237
|
+
|
|
238
|
+
- **AES-256 Encryption** for credential storage
|
|
239
|
+
- **Masked credentials** in all output and logs
|
|
240
|
+
- **Jenkins credential storage** integration
|
|
241
|
+
- **No plain-text secrets** in generated files
|
|
242
|
+
- **Security best practices** documentation
|
|
243
|
+
- **Credential rotation** reminders
|
|
244
|
+
|
|
245
|
+
## ๐ Documentation
|
|
246
|
+
|
|
247
|
+
- [Setup Guide](./SETUP_GUIDE.md) - Complete installation and setup
|
|
248
|
+
- [Deployment Checklist](./DEPLOYMENT_CHECKLIST.md) - Pre/post deployment steps
|
|
249
|
+
- [Troubleshooting](#troubleshooting) - Common issues and solutions
|
|
250
|
+
|
|
251
|
+
## ๐ ๏ธ Requirements
|
|
252
|
+
|
|
253
|
+
### Jenkins Plugins
|
|
254
|
+
|
|
255
|
+
Required plugins (automatically documented in generated files):
|
|
256
|
+
|
|
257
|
+
- Docker Pipeline
|
|
258
|
+
- Git Plugin
|
|
259
|
+
- Email Extension Plugin
|
|
260
|
+
- Pipeline Plugin
|
|
261
|
+
- Credentials Binding Plugin
|
|
262
|
+
- Blue Ocean (optional)
|
|
263
|
+
|
|
264
|
+
### Cloud Provider Credentials
|
|
265
|
+
|
|
266
|
+
You'll need credentials for your chosen cloud provider:
|
|
267
|
+
|
|
268
|
+
**AWS:**
|
|
269
|
+
|
|
270
|
+
- Access Key ID
|
|
271
|
+
- Secret Access Key
|
|
272
|
+
|
|
273
|
+
**Azure:**
|
|
274
|
+
|
|
275
|
+
- Subscription ID
|
|
276
|
+
- Client ID
|
|
277
|
+
- Client Secret
|
|
278
|
+
- Tenant ID
|
|
279
|
+
|
|
280
|
+
**GCP:**
|
|
281
|
+
|
|
282
|
+
- Project ID
|
|
283
|
+
- Service Account Key File
|
|
284
|
+
|
|
285
|
+
**DigitalOcean:**
|
|
286
|
+
|
|
287
|
+
- API Token
|
|
288
|
+
|
|
289
|
+
## ๐ Troubleshooting
|
|
290
|
+
|
|
291
|
+
### Issue: "Command not found"
|
|
292
|
+
|
|
293
|
+
```bash
|
|
294
|
+
# Reinstall globally
|
|
295
|
+
npm install -g jenkins-generator
|
|
296
|
+
|
|
297
|
+
# Or check npm global bin path
|
|
298
|
+
npm config get prefix
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### Issue: "Dockerfile not found"
|
|
302
|
+
|
|
303
|
+
- Ensure Dockerfile exists at specified path
|
|
304
|
+
- Check path is relative to project root
|
|
305
|
+
- Verify file name is exactly `Dockerfile` (case-sensitive)
|
|
306
|
+
|
|
307
|
+
### Issue: "Deployment failed"
|
|
308
|
+
|
|
309
|
+
- Verify cloud provider credentials in Jenkins
|
|
310
|
+
- Check instance type availability in selected region
|
|
311
|
+
- Review deployment logs in cloud console
|
|
312
|
+
- Ensure sufficient permissions/quotas
|
|
313
|
+
|
|
314
|
+
### More Help
|
|
315
|
+
|
|
316
|
+
For more troubleshooting, check the generated `.cicd/README.md` in your project.
|
|
317
|
+
|
|
318
|
+
## ๐ค Contributing
|
|
319
|
+
|
|
320
|
+
Contributions are welcome! Please:
|
|
321
|
+
|
|
322
|
+
1. Fork the repository
|
|
323
|
+
2. Create a feature branch
|
|
324
|
+
3. Make your changes
|
|
325
|
+
4. Add tests if applicable
|
|
326
|
+
5. Submit a pull request
|
|
327
|
+
|
|
328
|
+
## ๐ License
|
|
329
|
+
|
|
330
|
+
MIT License - see [LICENSE](LICENSE) file for details
|
|
331
|
+
|
|
332
|
+
## ๐ Acknowledgments
|
|
333
|
+
|
|
334
|
+
- Built with [NestJS](https://nestjs.com/)
|
|
335
|
+
- Powered by [TypeScript](https://www.typescriptlang.org/)
|
|
336
|
+
- CLI powered by [Inquirer](https://github.com/SBoudrias/Inquirer.js)
|
|
337
|
+
- Styled with [Chalk](https://github.com/chalk/chalk)
|
|
338
|
+
|
|
339
|
+
## ๐ Support
|
|
340
|
+
|
|
341
|
+
- ๐ง **Email:** support@yourcompany.com
|
|
342
|
+
- ๐ **Issues:** [GitHub Issues](https://github.com/yourusername/jenkins-generator/issues)
|
|
343
|
+
- ๐ **Docs:** Full documentation in generated `.cicd/` folder
|
|
344
|
+
|
|
345
|
+
## โญ Show Your Support
|
|
346
|
+
|
|
347
|
+
If this tool helped you, please:
|
|
348
|
+
|
|
349
|
+
- โญ Star the repository
|
|
350
|
+
- ๐ฆ Tweet about it
|
|
351
|
+
- ๐ Write a blog post
|
|
352
|
+
- ๐ฌ Tell your friends
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
**Made with โค๏ธ by developers, for developers**
|
|
357
|
+
|
|
358
|
+
_Stop configuring CI/CD manually. Start deploying automatically!_
|
|
359
|
+
|
|
360
|
+
```bash
|
|
361
|
+
npm install -g jenkins-generator
|
|
362
|
+
cd your-project
|
|
363
|
+
jenkins-generator
|
|
364
|
+
# That's it! ๐
|
|
365
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AppController = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const app_service_1 = require("./app.service");
|
|
15
|
+
let AppController = class AppController {
|
|
16
|
+
appService;
|
|
17
|
+
constructor(appService) {
|
|
18
|
+
this.appService = appService;
|
|
19
|
+
}
|
|
20
|
+
getHello() {
|
|
21
|
+
return this.appService.getHello();
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.AppController = AppController;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, common_1.Get)(),
|
|
27
|
+
__metadata("design:type", Function),
|
|
28
|
+
__metadata("design:paramtypes", []),
|
|
29
|
+
__metadata("design:returntype", String)
|
|
30
|
+
], AppController.prototype, "getHello", null);
|
|
31
|
+
exports.AppController = AppController = __decorate([
|
|
32
|
+
(0, common_1.Controller)(),
|
|
33
|
+
__metadata("design:paramtypes", [app_service_1.AppService])
|
|
34
|
+
], AppController);
|
|
35
|
+
//# sourceMappingURL=app.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.controller.js","sourceRoot":"","sources":["../src/app.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiD;AACjD,+CAA2C;AAGpC,IAAM,aAAa,GAAnB,MAAM,aAAa;IACK;IAA7B,YAA6B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAGvD,QAAQ;QACN,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;IACpC,CAAC;CACF,CAAA;AAPY,sCAAa;AAIxB;IADC,IAAA,YAAG,GAAE;;;;6CAGL;wBANU,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAE8B,wBAAU;GADxC,aAAa,CAOzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const testing_1 = require("@nestjs/testing");
|
|
4
|
+
const app_controller_1 = require("./app.controller");
|
|
5
|
+
const app_service_1 = require("./app.service");
|
|
6
|
+
describe('AppController', () => {
|
|
7
|
+
let appController;
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
const app = await testing_1.Test.createTestingModule({
|
|
10
|
+
controllers: [app_controller_1.AppController],
|
|
11
|
+
providers: [app_service_1.AppService],
|
|
12
|
+
}).compile();
|
|
13
|
+
appController = app.get(app_controller_1.AppController);
|
|
14
|
+
});
|
|
15
|
+
describe('root', () => {
|
|
16
|
+
it('should return "Hello World!"', () => {
|
|
17
|
+
expect(appController.getHello()).toBe('Hello World!');
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=app.controller.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.controller.spec.js","sourceRoot":"","sources":["../src/app.controller.spec.ts"],"names":[],"mappings":";;AAAA,6CAAsD;AACtD,qDAAiD;AACjD,+CAA2C;AAE3C,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,IAAI,aAA4B,CAAC;IAEjC,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,MAAM,GAAG,GAAkB,MAAM,cAAI,CAAC,mBAAmB,CAAC;YACxD,WAAW,EAAE,CAAC,8BAAa,CAAC;YAC5B,SAAS,EAAE,CAAC,wBAAU,CAAC;SACxB,CAAC,CAAC,OAAO,EAAE,CAAC;QAEb,aAAa,GAAG,GAAG,CAAC,GAAG,CAAgB,8BAAa,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;QACpB,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;YACtC,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.AppModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const cicd_generator_service_1 = require("./services/cicd-generator.service");
|
|
12
|
+
const prompt_service_1 = require("./services/prompt.service");
|
|
13
|
+
const jenkinsfile_service_1 = require("./services/jenkinsfile.service");
|
|
14
|
+
const cloud_provider_service_1 = require("./services/cloud-provider.service");
|
|
15
|
+
const security_service_1 = require("./services/security.service");
|
|
16
|
+
const validation_service_1 = require("./services/validation.service");
|
|
17
|
+
const notification_service_1 = require("./services/notification.service");
|
|
18
|
+
let AppModule = class AppModule {
|
|
19
|
+
};
|
|
20
|
+
exports.AppModule = AppModule;
|
|
21
|
+
exports.AppModule = AppModule = __decorate([
|
|
22
|
+
(0, common_1.Module)({
|
|
23
|
+
imports: [],
|
|
24
|
+
providers: [
|
|
25
|
+
cicd_generator_service_1.CICDGeneratorService,
|
|
26
|
+
prompt_service_1.PromptService,
|
|
27
|
+
jenkinsfile_service_1.JenkinsFileService,
|
|
28
|
+
cloud_provider_service_1.CloudProviderService,
|
|
29
|
+
security_service_1.SecurityService,
|
|
30
|
+
validation_service_1.ValidationService,
|
|
31
|
+
notification_service_1.NotificationService,
|
|
32
|
+
],
|
|
33
|
+
})
|
|
34
|
+
], AppModule);
|
|
35
|
+
//# sourceMappingURL=app.module.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.AppService = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
let AppService = class AppService {
|
|
12
|
+
getHello() {
|
|
13
|
+
return 'Hello World!';
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
exports.AppService = AppService;
|
|
17
|
+
exports.AppService = AppService = __decorate([
|
|
18
|
+
(0, common_1.Injectable)()
|
|
19
|
+
], AppService);
|
|
20
|
+
//# sourceMappingURL=app.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.service.js","sourceRoot":"","sources":["../src/app.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAGrC,IAAM,UAAU,GAAhB,MAAM,UAAU;IACrB,QAAQ;QACN,OAAO,cAAc,CAAC;IACxB,CAAC;CACF,CAAA;AAJY,gCAAU;qBAAV,UAAU;IADtB,IAAA,mBAAU,GAAE;GACA,UAAU,CAItB"}
|
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const core_1 = require("@nestjs/core");
|
|
8
|
+
const app_module_1 = require("./app.module");
|
|
9
|
+
const cicd_generator_service_1 = require("./services/cicd-generator.service");
|
|
10
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
11
|
+
const ora_1 = __importDefault(require("ora"));
|
|
12
|
+
async function bootstrap() {
|
|
13
|
+
console.log(chalk_1.default.blue.bold('\n๐ Auto CICD Generator\n'));
|
|
14
|
+
const spinner = (0, ora_1.default)('Initializing...').start();
|
|
15
|
+
try {
|
|
16
|
+
const app = await core_1.NestFactory.createApplicationContext(app_module_1.AppModule, {
|
|
17
|
+
logger: false,
|
|
18
|
+
});
|
|
19
|
+
spinner.succeed('Initialized successfully');
|
|
20
|
+
const cicdGenerator = app.get(cicd_generator_service_1.CICDGeneratorService);
|
|
21
|
+
await cicdGenerator.run();
|
|
22
|
+
await app.close();
|
|
23
|
+
console.log(chalk_1.default.green.bold('\nโ
CICD Pipeline generated successfully!\n'));
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
spinner.fail('Failed to initialize');
|
|
27
|
+
console.error(chalk_1.default.red('\nโ Error:'), error.message);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
bootstrap();
|
|
32
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;AAEA,uCAA2C;AAC3C,6CAAyC;AACzC,8EAAyE;AACzE,kDAA0B;AAC1B,8CAAsB;AAEtB,KAAK,UAAU,SAAS;IACtB,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC,CAAC;IAE3D,MAAM,OAAO,GAAG,IAAA,aAAG,EAAC,iBAAiB,CAAC,CAAC,KAAK,EAAE,CAAC;IAE/C,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,wBAAwB,CAAC,sBAAS,EAAE;YAChE,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;QAEH,OAAO,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC;QAE5C,MAAM,aAAa,GAAG,GAAG,CAAC,GAAG,CAAC,6CAAoB,CAAC,CAAC;QAEpD,MAAM,aAAa,CAAC,GAAG,EAAE,CAAC;QAE1B,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC;QAElB,OAAO,CAAC,GAAG,CACT,eAAK,CAAC,KAAK,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAChE,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACrC,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QACtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,SAAS,EAAE,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './app.module';
|
|
2
|
+
export * from './services/cicd-generator.service';
|
|
3
|
+
export * from './services/cloud-provider.service';
|
|
4
|
+
export * from './services/jenkinsfile.service';
|
|
5
|
+
export * from './services/notification.service';
|
|
6
|
+
export * from './services/prompt.service';
|
|
7
|
+
export * from './services/security.service';
|
|
8
|
+
export * from './services/validation.service';
|
|
9
|
+
export * from './interfaces/config.interface';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./app.module"), exports);
|
|
18
|
+
__exportStar(require("./services/cicd-generator.service"), exports);
|
|
19
|
+
__exportStar(require("./services/cloud-provider.service"), exports);
|
|
20
|
+
__exportStar(require("./services/jenkinsfile.service"), exports);
|
|
21
|
+
__exportStar(require("./services/notification.service"), exports);
|
|
22
|
+
__exportStar(require("./services/prompt.service"), exports);
|
|
23
|
+
__exportStar(require("./services/security.service"), exports);
|
|
24
|
+
__exportStar(require("./services/validation.service"), exports);
|
|
25
|
+
__exportStar(require("./interfaces/config.interface"), exports);
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export interface ProjectConfig {
|
|
2
|
+
projectName: string;
|
|
3
|
+
projectType: 'frontend' | 'backend' | 'fullstack';
|
|
4
|
+
language: 'javascript' | 'typescript';
|
|
5
|
+
repository: string;
|
|
6
|
+
branch: string;
|
|
7
|
+
hasDockerfile: boolean;
|
|
8
|
+
dockerfilePath?: string;
|
|
9
|
+
runTests: boolean;
|
|
10
|
+
testCommand?: string;
|
|
11
|
+
buildCommand?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface CloudConfig {
|
|
14
|
+
provider: 'aws' | 'azure' | 'gcp' | 'digitalocean';
|
|
15
|
+
credentials: AWSCredentials | AzureCredentials | GCPCredentials | DOCredentials;
|
|
16
|
+
region: string;
|
|
17
|
+
instanceType: string;
|
|
18
|
+
deploymentConfig: DeploymentConfig;
|
|
19
|
+
}
|
|
20
|
+
export interface AWSCredentials {
|
|
21
|
+
accessKeyId: string;
|
|
22
|
+
secretAccessKey: string;
|
|
23
|
+
region: string;
|
|
24
|
+
}
|
|
25
|
+
export interface AzureCredentials {
|
|
26
|
+
subscriptionId: string;
|
|
27
|
+
clientId: string;
|
|
28
|
+
clientSecret: string;
|
|
29
|
+
tenantId: string;
|
|
30
|
+
}
|
|
31
|
+
export interface GCPCredentials {
|
|
32
|
+
projectId: string;
|
|
33
|
+
keyFile: string;
|
|
34
|
+
region: string;
|
|
35
|
+
}
|
|
36
|
+
export interface DOCredentials {
|
|
37
|
+
apiToken: string;
|
|
38
|
+
region: string;
|
|
39
|
+
}
|
|
40
|
+
export interface DeploymentConfig {
|
|
41
|
+
tier: string;
|
|
42
|
+
autoScaling: boolean;
|
|
43
|
+
minInstances?: number;
|
|
44
|
+
maxInstances?: number;
|
|
45
|
+
healthCheckPath: string;
|
|
46
|
+
port: number;
|
|
47
|
+
}
|
|
48
|
+
export interface NotificationConfig {
|
|
49
|
+
email: string;
|
|
50
|
+
platforms: NotificationPlatform[];
|
|
51
|
+
webhookUrls?: {
|
|
52
|
+
[key: string]: string;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export interface NotificationPlatform {
|
|
56
|
+
type: 'slack' | 'discord' | 'teams' | 'telegram';
|
|
57
|
+
webhook?: string;
|
|
58
|
+
apiKey?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface CICDConfig {
|
|
61
|
+
project: ProjectConfig;
|
|
62
|
+
cloud: CloudConfig;
|
|
63
|
+
notifications: NotificationConfig;
|
|
64
|
+
jenkinsConfig: JenkinsConfig;
|
|
65
|
+
}
|
|
66
|
+
export interface JenkinsConfig {
|
|
67
|
+
agentLabel: string;
|
|
68
|
+
timeout: number;
|
|
69
|
+
retryCount: number;
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.interface.js","sourceRoot":"","sources":["../../src/interfaces/config.interface.ts"],"names":[],"mappings":""}
|