proagents 1.6.19 → 1.6.21
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/.claude/settings.local.json +13 -1
- package/.proagents/.cursorrules +25 -10
- package/.proagents/.windsurfrules +25 -10
- package/.proagents/AGENTS.md +30 -11
- package/.proagents/AI_INSTRUCTIONS.md +86 -30
- package/.proagents/BOLT.md +25 -10
- package/.proagents/CLAUDE.md +25 -10
- package/.proagents/GEMINI.md +25 -10
- package/.proagents/KIRO.md +25 -10
- package/.proagents/LOVABLE.md +25 -10
- package/.proagents/PROAGENTS.md +96 -343
- package/.proagents/REPLIT.md +25 -10
- package/.proagents/activity.log +1 -0
- package/.proagents/custom-commands.yaml +0 -1
- package/.proagents/docs/command-details.md +1 -2
- package/.proagents/getting-started/ai-training-setup.md +0 -1
- package/.proagents/performance/README.md +59 -0
- package/.proagents/performance/bundle-analysis.md +375 -0
- package/.proagents/performance/load-testing.md +563 -0
- package/.proagents/performance/runtime-metrics.md +489 -0
- package/.proagents/performance/web-vitals.md +425 -0
- package/.proagents/platforms.yaml +66 -0
- package/.proagents/proagents.config.yaml +0 -1
- package/.proagents/prompts/ai-add.md +80 -0
- package/.proagents/prompts/ai-list.md +41 -0
- package/.proagents/prompts/ai-remove.md +112 -0
- package/.proagents/prompts/ai-sync.md +96 -0
- package/.proagents/workflow-modes/entry-modes.md +1 -6
- package/lib/commands/ai.js +100 -48
- package/lib/commands/init.js +89 -22
- package/package.json +1 -1
- package/.proagents/ANTIGRAVITY.md +0 -61
- package/.proagents/CHATGPT.md +0 -57
- package/.proagents/GROQ.md +0 -57
- package/.proagents/api-versioning/README.md +0 -257
- package/.proagents/api-versioning/changelog-template.md +0 -225
- package/.proagents/api-versioning/deprecation-workflow.md +0 -470
- package/.proagents/api-versioning/versioning-strategy.md +0 -291
- package/.proagents/automation/README.md +0 -38
- package/.proagents/automation/ai-behavior-rules.md +0 -339
- package/.proagents/automation/ai-prompt-injection.md +0 -331
- package/.proagents/automation/auto-decisions.md +0 -535
- package/.proagents/automation/decision-defaults.yaml +0 -317
- package/.proagents/cache/README.md +0 -110
- package/.proagents/cache/analysis-metadata.json +0 -76
- package/.proagents/cache/conventions.json +0 -125
- package/.proagents/cache/dependencies.json +0 -85
- package/.proagents/cache/features.json +0 -115
- package/.proagents/cache/patterns.json +0 -105
- package/.proagents/cache/schemas/conventions-schema.json +0 -138
- package/.proagents/cache/schemas/dependencies-schema.json +0 -95
- package/.proagents/cache/schemas/features-schema.json +0 -104
- package/.proagents/cache/schemas/metadata-schema.json +0 -83
- package/.proagents/cache/schemas/patterns-schema.json +0 -136
- package/.proagents/cache/schemas/structure-schema.json +0 -72
- package/.proagents/cache/structure.json +0 -109
- package/.proagents/checklists/README.md +0 -261
- package/.proagents/checklists/code-quality.md +0 -137
- package/.proagents/checklists/code-review.md +0 -148
- package/.proagents/checklists/pr-checklist.md +0 -78
- package/.proagents/checklists/pre-deployment.md +0 -132
- package/.proagents/checklists/pre-implementation.md +0 -80
- package/.proagents/checklists/testing.md +0 -120
- package/.proagents/checkpoints.json +0 -13
- package/.proagents/cicd/README.md +0 -338
- package/.proagents/cicd/azure-devops.md +0 -267
- package/.proagents/cicd/github-actions.md +0 -375
- package/.proagents/cicd/gitlab-ci.md +0 -278
- package/.proagents/cicd/jenkins.md +0 -317
- package/.proagents/collaboration/README.md +0 -143
- package/.proagents/collaboration/roles.md +0 -248
- package/.proagents/collaboration/sessions.md +0 -390
- package/.proagents/collaboration/sync.md +0 -358
- package/.proagents/cost/README.md +0 -48
- package/.proagents/cost/cost-template.md +0 -283
- package/.proagents/cost/estimation-framework.md +0 -287
- package/.proagents/database/README.md +0 -72
- package/.proagents/database/examples/001-create-users.sql +0 -129
- package/.proagents/database/examples/002-add-preferences.sql +0 -94
- package/.proagents/database/examples/003-add-index.sql +0 -105
- package/.proagents/database/examples/004-rename-column.sql +0 -122
- package/.proagents/database/examples/005-add-foreign-key.sql +0 -142
- package/.proagents/database/examples/006-data-migration.sql +0 -196
- package/.proagents/database/examples/007-drop-column.sql +0 -163
- package/.proagents/database/examples/README.md +0 -89
- package/.proagents/database/migration-workflow.md +0 -478
- package/.proagents/database/rollback-scripts.md +0 -487
- package/.proagents/database/safety-checks.md +0 -447
- package/.proagents/git/README.md +0 -68
- package/.proagents/git/branch-strategy.md +0 -164
- package/.proagents/git/commit-conventions.md +0 -241
- package/.proagents/git/pr-workflow.md +0 -286
- package/.proagents/git/rollback-procedures.md +0 -416
- package/.proagents/ide-integration/README.md +0 -124
- package/.proagents/ide-integration/cline-config.md +0 -429
- package/.proagents/ide-integration/continue-config.md +0 -380
- package/.proagents/ide-integration/cursor-rules.md +0 -280
- package/.proagents/ide-integration/github-copilot.md +0 -384
- package/.proagents/ide-integration/windsurf-rules.md +0 -314
- package/.proagents/integrations/README.md +0 -97
- package/.proagents/integrations/pm/README.md +0 -344
- package/.proagents/learning/README.md +0 -136
- package/.proagents/learning/adaptation.md +0 -305
- package/.proagents/learning/data-collection.md +0 -283
- package/.proagents/learning/implementation-guide.md +0 -865
- package/.proagents/learning/reports.md +0 -306
- package/.proagents/mcp/README.md +0 -133
- package/.proagents/mcp/context-providers.md +0 -442
- package/.proagents/mcp/server-config.md +0 -306
- package/.proagents/mcp/tools-definition.md +0 -513
- package/.proagents/pm-integration/README.md +0 -151
- package/.proagents/pm-integration/asana.md +0 -346
- package/.proagents/pm-integration/github-issues.md +0 -308
- package/.proagents/pm-integration/gitlab-issues.md +0 -482
- package/.proagents/pm-integration/jira.md +0 -364
- package/.proagents/pm-integration/linear.md +0 -409
- package/.proagents/pm-integration/notion.md +0 -275
- package/.proagents/pm-integration/sync-config.md +0 -533
- package/.proagents/pm-integration/trello.md +0 -159
- package/.proagents/rules/README.md +0 -179
- package/.proagents/rules/custom-rules-template.yaml +0 -286
- package/.proagents/rules/custom-rules.md +0 -754
- package/.proagents/rules/validation-rules-template.yaml +0 -517
- package/.proagents/runbooks/README.md +0 -219
- package/.proagents/runbooks/dependency-vulnerability.md +0 -505
- package/.proagents/runbooks/incident-response.md +0 -451
- package/.proagents/runbooks/performance-degradation.md +0 -584
- package/.proagents/runbooks/production-debugging.md +0 -489
- package/.proagents/sprints/README.md +0 -58
- package/.proagents/team/README.md +0 -256
- package/.proagents/team/code-ownership.md +0 -306
- package/.proagents/team/communication-templates.md +0 -441
- package/.proagents/team/handoff-protocol.md +0 -380
- package/.proagents/team/ide-setup/README.md +0 -103
- package/.proagents/team/ide-setup/cursor.md +0 -276
- package/.proagents/team/ide-setup/jetbrains.md +0 -330
- package/.proagents/team/ide-setup/neovim.md +0 -640
- package/.proagents/team/ide-setup/vscode.md +0 -348
- package/.proagents/team/onboarding.md +0 -278
- package/.proagents/time-tracking.json +0 -19
- package/.proagents/troubleshooting/README.md +0 -730
- package/.proagents/troubleshooting/ai-issues.md +0 -601
- package/.proagents/troubleshooting/workflow-issues.md +0 -571
|
@@ -1,338 +0,0 @@
|
|
|
1
|
-
# CI/CD Pipeline Templates
|
|
2
|
-
|
|
3
|
-
Pre-configured continuous integration and deployment pipelines.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Overview
|
|
8
|
-
|
|
9
|
-
Ready-to-use CI/CD templates for popular platforms, integrated with ProAgents workflow.
|
|
10
|
-
|
|
11
|
-
## Documentation
|
|
12
|
-
|
|
13
|
-
| Document | Description |
|
|
14
|
-
|----------|-------------|
|
|
15
|
-
| [GitHub Actions](./github-actions.md) | GitHub CI/CD templates |
|
|
16
|
-
| [GitLab CI](./gitlab-ci.md) | GitLab pipeline templates |
|
|
17
|
-
| [Jenkins](./jenkins.md) | Jenkins pipeline templates |
|
|
18
|
-
| [Azure DevOps](./azure-devops.md) | Azure Pipelines templates |
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## Quick Start
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
# Generate CI/CD config for your platform
|
|
26
|
-
proagents cicd init github-actions
|
|
27
|
-
|
|
28
|
-
# Validate pipeline config
|
|
29
|
-
proagents cicd validate
|
|
30
|
-
|
|
31
|
-
# Test pipeline locally
|
|
32
|
-
proagents cicd test
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
---
|
|
36
|
-
|
|
37
|
-
## GitHub Actions Template
|
|
38
|
-
|
|
39
|
-
```yaml
|
|
40
|
-
# .github/workflows/ci.yml
|
|
41
|
-
name: CI
|
|
42
|
-
|
|
43
|
-
on:
|
|
44
|
-
push:
|
|
45
|
-
branches: [main, develop]
|
|
46
|
-
pull_request:
|
|
47
|
-
branches: [main]
|
|
48
|
-
|
|
49
|
-
jobs:
|
|
50
|
-
test:
|
|
51
|
-
runs-on: ubuntu-latest
|
|
52
|
-
steps:
|
|
53
|
-
- uses: actions/checkout@v4
|
|
54
|
-
|
|
55
|
-
- name: Setup Node.js
|
|
56
|
-
uses: actions/setup-node@v4
|
|
57
|
-
with:
|
|
58
|
-
node-version: '20'
|
|
59
|
-
cache: 'npm'
|
|
60
|
-
|
|
61
|
-
- name: Install dependencies
|
|
62
|
-
run: npm ci
|
|
63
|
-
|
|
64
|
-
- name: Run linting
|
|
65
|
-
run: npm run lint
|
|
66
|
-
|
|
67
|
-
- name: Run tests
|
|
68
|
-
run: npm test -- --coverage
|
|
69
|
-
|
|
70
|
-
- name: Upload coverage
|
|
71
|
-
uses: codecov/codecov-action@v3
|
|
72
|
-
|
|
73
|
-
security:
|
|
74
|
-
runs-on: ubuntu-latest
|
|
75
|
-
steps:
|
|
76
|
-
- uses: actions/checkout@v4
|
|
77
|
-
|
|
78
|
-
- name: Security scan
|
|
79
|
-
run: npx proagents security scan --ci
|
|
80
|
-
|
|
81
|
-
build:
|
|
82
|
-
needs: [test, security]
|
|
83
|
-
runs-on: ubuntu-latest
|
|
84
|
-
steps:
|
|
85
|
-
- uses: actions/checkout@v4
|
|
86
|
-
|
|
87
|
-
- name: Build
|
|
88
|
-
run: npm run build
|
|
89
|
-
|
|
90
|
-
- name: Upload artifacts
|
|
91
|
-
uses: actions/upload-artifact@v3
|
|
92
|
-
with:
|
|
93
|
-
name: build
|
|
94
|
-
path: dist/
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
---
|
|
98
|
-
|
|
99
|
-
## GitLab CI Template
|
|
100
|
-
|
|
101
|
-
```yaml
|
|
102
|
-
# .gitlab-ci.yml
|
|
103
|
-
stages:
|
|
104
|
-
- test
|
|
105
|
-
- security
|
|
106
|
-
- build
|
|
107
|
-
- deploy
|
|
108
|
-
|
|
109
|
-
variables:
|
|
110
|
-
NODE_VERSION: "20"
|
|
111
|
-
|
|
112
|
-
test:
|
|
113
|
-
stage: test
|
|
114
|
-
image: node:${NODE_VERSION}
|
|
115
|
-
script:
|
|
116
|
-
- npm ci
|
|
117
|
-
- npm run lint
|
|
118
|
-
- npm test -- --coverage
|
|
119
|
-
coverage: '/Lines\s*:\s*(\d+\.?\d*)%/'
|
|
120
|
-
artifacts:
|
|
121
|
-
reports:
|
|
122
|
-
coverage_report:
|
|
123
|
-
coverage_format: cobertura
|
|
124
|
-
path: coverage/cobertura-coverage.xml
|
|
125
|
-
|
|
126
|
-
security:
|
|
127
|
-
stage: security
|
|
128
|
-
script:
|
|
129
|
-
- npx proagents security scan --ci
|
|
130
|
-
allow_failure: false
|
|
131
|
-
|
|
132
|
-
build:
|
|
133
|
-
stage: build
|
|
134
|
-
script:
|
|
135
|
-
- npm ci
|
|
136
|
-
- npm run build
|
|
137
|
-
artifacts:
|
|
138
|
-
paths:
|
|
139
|
-
- dist/
|
|
140
|
-
|
|
141
|
-
deploy:staging:
|
|
142
|
-
stage: deploy
|
|
143
|
-
script:
|
|
144
|
-
- npx proagents deploy --env staging
|
|
145
|
-
environment:
|
|
146
|
-
name: staging
|
|
147
|
-
only:
|
|
148
|
-
- develop
|
|
149
|
-
|
|
150
|
-
deploy:production:
|
|
151
|
-
stage: deploy
|
|
152
|
-
script:
|
|
153
|
-
- npx proagents deploy --env production
|
|
154
|
-
environment:
|
|
155
|
-
name: production
|
|
156
|
-
when: manual
|
|
157
|
-
only:
|
|
158
|
-
- main
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
---
|
|
162
|
-
|
|
163
|
-
## Pipeline Stages
|
|
164
|
-
|
|
165
|
-
### Standard Pipeline
|
|
166
|
-
|
|
167
|
-
```
|
|
168
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
169
|
-
│ CI/CD Pipeline │
|
|
170
|
-
├─────────────────────────────────────────────────────────────┤
|
|
171
|
-
│ │
|
|
172
|
-
│ ┌────────┐ ┌──────────┐ ┌───────┐ ┌────────┐ │
|
|
173
|
-
│ │ Test │──▶│ Security │──▶│ Build │──▶│ Deploy │ │
|
|
174
|
-
│ └────────┘ └──────────┘ └───────┘ └────────┘ │
|
|
175
|
-
│ │ │ │ │ │
|
|
176
|
-
│ ▼ ▼ ▼ ▼ │
|
|
177
|
-
│ Lint Scan Compile Staging │
|
|
178
|
-
│ Unit Audit Bundle Production │
|
|
179
|
-
│ Coverage SAST Artifacts │
|
|
180
|
-
│ │
|
|
181
|
-
└─────────────────────────────────────────────────────────────┘
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
### Stage Configuration
|
|
185
|
-
|
|
186
|
-
```yaml
|
|
187
|
-
# proagents.config.yaml
|
|
188
|
-
cicd:
|
|
189
|
-
stages:
|
|
190
|
-
test:
|
|
191
|
-
parallel: true
|
|
192
|
-
jobs:
|
|
193
|
-
- lint
|
|
194
|
-
- unit_tests
|
|
195
|
-
- integration_tests
|
|
196
|
-
|
|
197
|
-
security:
|
|
198
|
-
required: true
|
|
199
|
-
jobs:
|
|
200
|
-
- dependency_audit
|
|
201
|
-
- sast_scan
|
|
202
|
-
- secret_scan
|
|
203
|
-
|
|
204
|
-
build:
|
|
205
|
-
jobs:
|
|
206
|
-
- compile
|
|
207
|
-
- bundle
|
|
208
|
-
- docker_build
|
|
209
|
-
|
|
210
|
-
deploy:
|
|
211
|
-
environments:
|
|
212
|
-
staging:
|
|
213
|
-
auto_deploy: true
|
|
214
|
-
branch: "develop"
|
|
215
|
-
|
|
216
|
-
production:
|
|
217
|
-
auto_deploy: false
|
|
218
|
-
branch: "main"
|
|
219
|
-
require_approval: true
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
---
|
|
223
|
-
|
|
224
|
-
## Branch Strategies
|
|
225
|
-
|
|
226
|
-
### GitFlow
|
|
227
|
-
|
|
228
|
-
```yaml
|
|
229
|
-
cicd:
|
|
230
|
-
branching:
|
|
231
|
-
strategy: "gitflow"
|
|
232
|
-
|
|
233
|
-
branches:
|
|
234
|
-
main:
|
|
235
|
-
deploy_to: "production"
|
|
236
|
-
protected: true
|
|
237
|
-
|
|
238
|
-
develop:
|
|
239
|
-
deploy_to: "staging"
|
|
240
|
-
|
|
241
|
-
"feature/*":
|
|
242
|
-
run_tests: true
|
|
243
|
-
deploy_to: "preview"
|
|
244
|
-
|
|
245
|
-
"hotfix/*":
|
|
246
|
-
run_tests: true
|
|
247
|
-
deploy_to: "staging"
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
### Trunk-Based
|
|
251
|
-
|
|
252
|
-
```yaml
|
|
253
|
-
cicd:
|
|
254
|
-
branching:
|
|
255
|
-
strategy: "trunk"
|
|
256
|
-
|
|
257
|
-
branches:
|
|
258
|
-
main:
|
|
259
|
-
deploy_to: "production"
|
|
260
|
-
require_pr: true
|
|
261
|
-
|
|
262
|
-
"feature/*":
|
|
263
|
-
run_tests: true
|
|
264
|
-
preview_deploy: true
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
---
|
|
268
|
-
|
|
269
|
-
## Caching
|
|
270
|
-
|
|
271
|
-
### Dependency Caching
|
|
272
|
-
|
|
273
|
-
```yaml
|
|
274
|
-
# GitHub Actions
|
|
275
|
-
- uses: actions/cache@v3
|
|
276
|
-
with:
|
|
277
|
-
path: ~/.npm
|
|
278
|
-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
279
|
-
restore-keys: |
|
|
280
|
-
${{ runner.os }}-node-
|
|
281
|
-
|
|
282
|
-
# GitLab CI
|
|
283
|
-
cache:
|
|
284
|
-
key: ${CI_COMMIT_REF_SLUG}
|
|
285
|
-
paths:
|
|
286
|
-
- node_modules/
|
|
287
|
-
```
|
|
288
|
-
|
|
289
|
-
---
|
|
290
|
-
|
|
291
|
-
## Notifications
|
|
292
|
-
|
|
293
|
-
```yaml
|
|
294
|
-
cicd:
|
|
295
|
-
notifications:
|
|
296
|
-
on_success:
|
|
297
|
-
channels: ["slack:#deployments"]
|
|
298
|
-
|
|
299
|
-
on_failure:
|
|
300
|
-
channels: ["slack:#alerts"]
|
|
301
|
-
mention: ["@oncall"]
|
|
302
|
-
|
|
303
|
-
on_approval_needed:
|
|
304
|
-
channels: ["slack:#deployments"]
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
---
|
|
308
|
-
|
|
309
|
-
## Commands
|
|
310
|
-
|
|
311
|
-
```bash
|
|
312
|
-
# Initialize CI/CD config
|
|
313
|
-
proagents cicd init [platform]
|
|
314
|
-
|
|
315
|
-
# Validate config
|
|
316
|
-
proagents cicd validate
|
|
317
|
-
|
|
318
|
-
# Run pipeline locally
|
|
319
|
-
proagents cicd run
|
|
320
|
-
|
|
321
|
-
# View pipeline status
|
|
322
|
-
proagents cicd status
|
|
323
|
-
|
|
324
|
-
# Trigger deployment
|
|
325
|
-
proagents cicd deploy staging
|
|
326
|
-
```
|
|
327
|
-
|
|
328
|
-
---
|
|
329
|
-
|
|
330
|
-
## Best Practices
|
|
331
|
-
|
|
332
|
-
1. **Fail Fast**: Run quick checks first
|
|
333
|
-
2. **Parallelize**: Run independent jobs in parallel
|
|
334
|
-
3. **Cache Dependencies**: Speed up builds
|
|
335
|
-
4. **Pin Versions**: Use specific tool versions
|
|
336
|
-
5. **Secure Secrets**: Never expose in logs
|
|
337
|
-
6. **Require Reviews**: For production deployments
|
|
338
|
-
7. **Monitor Pipelines**: Track build times and failures
|
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
# Azure DevOps Pipeline Templates
|
|
2
|
-
|
|
3
|
-
Azure Pipelines YAML configurations.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Complete Pipeline
|
|
8
|
-
|
|
9
|
-
```yaml
|
|
10
|
-
# azure-pipelines.yml
|
|
11
|
-
trigger:
|
|
12
|
-
branches:
|
|
13
|
-
include:
|
|
14
|
-
- main
|
|
15
|
-
- develop
|
|
16
|
-
paths:
|
|
17
|
-
exclude:
|
|
18
|
-
- README.md
|
|
19
|
-
- docs/*
|
|
20
|
-
|
|
21
|
-
pr:
|
|
22
|
-
branches:
|
|
23
|
-
include:
|
|
24
|
-
- main
|
|
25
|
-
- develop
|
|
26
|
-
|
|
27
|
-
pool:
|
|
28
|
-
vmImage: 'ubuntu-latest'
|
|
29
|
-
|
|
30
|
-
variables:
|
|
31
|
-
nodeVersion: '20.x'
|
|
32
|
-
npm_config_cache: $(Pipeline.Workspace)/.npm
|
|
33
|
-
|
|
34
|
-
stages:
|
|
35
|
-
- stage: Validate
|
|
36
|
-
displayName: 'Validate'
|
|
37
|
-
jobs:
|
|
38
|
-
- job: Lint
|
|
39
|
-
displayName: 'Lint & Type Check'
|
|
40
|
-
steps:
|
|
41
|
-
- task: NodeTool@0
|
|
42
|
-
inputs:
|
|
43
|
-
versionSpec: $(nodeVersion)
|
|
44
|
-
displayName: 'Install Node.js'
|
|
45
|
-
|
|
46
|
-
- task: Cache@2
|
|
47
|
-
inputs:
|
|
48
|
-
key: 'npm | "$(Agent.OS)" | package-lock.json'
|
|
49
|
-
restoreKeys: |
|
|
50
|
-
npm | "$(Agent.OS)"
|
|
51
|
-
path: $(npm_config_cache)
|
|
52
|
-
displayName: 'Cache npm'
|
|
53
|
-
|
|
54
|
-
- script: npm ci
|
|
55
|
-
displayName: 'Install dependencies'
|
|
56
|
-
|
|
57
|
-
- script: npm run lint
|
|
58
|
-
displayName: 'Run ESLint'
|
|
59
|
-
|
|
60
|
-
- script: npm run type-check
|
|
61
|
-
displayName: 'Run TypeScript check'
|
|
62
|
-
|
|
63
|
-
- stage: Test
|
|
64
|
-
displayName: 'Test'
|
|
65
|
-
dependsOn: Validate
|
|
66
|
-
jobs:
|
|
67
|
-
- job: UnitTests
|
|
68
|
-
displayName: 'Unit Tests'
|
|
69
|
-
steps:
|
|
70
|
-
- task: NodeTool@0
|
|
71
|
-
inputs:
|
|
72
|
-
versionSpec: $(nodeVersion)
|
|
73
|
-
|
|
74
|
-
- script: npm ci
|
|
75
|
-
displayName: 'Install dependencies'
|
|
76
|
-
|
|
77
|
-
- script: npm run test:unit -- --coverage
|
|
78
|
-
displayName: 'Run unit tests'
|
|
79
|
-
|
|
80
|
-
- task: PublishTestResults@2
|
|
81
|
-
inputs:
|
|
82
|
-
testResultsFormat: 'JUnit'
|
|
83
|
-
testResultsFiles: '**/junit.xml'
|
|
84
|
-
condition: always()
|
|
85
|
-
|
|
86
|
-
- task: PublishCodeCoverageResults@1
|
|
87
|
-
inputs:
|
|
88
|
-
codeCoverageTool: 'Cobertura'
|
|
89
|
-
summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage/cobertura-coverage.xml'
|
|
90
|
-
|
|
91
|
-
- job: IntegrationTests
|
|
92
|
-
displayName: 'Integration Tests'
|
|
93
|
-
services:
|
|
94
|
-
postgres:
|
|
95
|
-
image: postgres:15
|
|
96
|
-
ports:
|
|
97
|
-
- 5432:5432
|
|
98
|
-
env:
|
|
99
|
-
POSTGRES_DB: test_db
|
|
100
|
-
POSTGRES_USER: test
|
|
101
|
-
POSTGRES_PASSWORD: test
|
|
102
|
-
steps:
|
|
103
|
-
- task: NodeTool@0
|
|
104
|
-
inputs:
|
|
105
|
-
versionSpec: $(nodeVersion)
|
|
106
|
-
|
|
107
|
-
- script: npm ci
|
|
108
|
-
displayName: 'Install dependencies'
|
|
109
|
-
|
|
110
|
-
- script: npm run test:integration
|
|
111
|
-
displayName: 'Run integration tests'
|
|
112
|
-
env:
|
|
113
|
-
DATABASE_URL: postgresql://test:test@localhost:5432/test_db
|
|
114
|
-
|
|
115
|
-
- stage: Security
|
|
116
|
-
displayName: 'Security'
|
|
117
|
-
dependsOn: Validate
|
|
118
|
-
jobs:
|
|
119
|
-
- job: SecurityScan
|
|
120
|
-
displayName: 'Security Scan'
|
|
121
|
-
steps:
|
|
122
|
-
- task: NodeTool@0
|
|
123
|
-
inputs:
|
|
124
|
-
versionSpec: $(nodeVersion)
|
|
125
|
-
|
|
126
|
-
- script: npm ci
|
|
127
|
-
displayName: 'Install dependencies'
|
|
128
|
-
|
|
129
|
-
- script: npm audit --audit-level=high
|
|
130
|
-
displayName: 'NPM Audit'
|
|
131
|
-
continueOnError: true
|
|
132
|
-
|
|
133
|
-
- stage: Build
|
|
134
|
-
displayName: 'Build'
|
|
135
|
-
dependsOn:
|
|
136
|
-
- Test
|
|
137
|
-
- Security
|
|
138
|
-
jobs:
|
|
139
|
-
- job: Build
|
|
140
|
-
displayName: 'Build Application'
|
|
141
|
-
steps:
|
|
142
|
-
- task: NodeTool@0
|
|
143
|
-
inputs:
|
|
144
|
-
versionSpec: $(nodeVersion)
|
|
145
|
-
|
|
146
|
-
- script: npm ci
|
|
147
|
-
displayName: 'Install dependencies'
|
|
148
|
-
|
|
149
|
-
- script: npm run build
|
|
150
|
-
displayName: 'Build'
|
|
151
|
-
|
|
152
|
-
- publish: $(System.DefaultWorkingDirectory)/dist
|
|
153
|
-
artifact: build
|
|
154
|
-
displayName: 'Publish build artifact'
|
|
155
|
-
|
|
156
|
-
- stage: DeployStaging
|
|
157
|
-
displayName: 'Deploy to Staging'
|
|
158
|
-
dependsOn: Build
|
|
159
|
-
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))
|
|
160
|
-
jobs:
|
|
161
|
-
- deployment: DeployStaging
|
|
162
|
-
displayName: 'Deploy to Staging'
|
|
163
|
-
environment: 'staging'
|
|
164
|
-
strategy:
|
|
165
|
-
runOnce:
|
|
166
|
-
deploy:
|
|
167
|
-
steps:
|
|
168
|
-
- download: current
|
|
169
|
-
artifact: build
|
|
170
|
-
|
|
171
|
-
- script: |
|
|
172
|
-
npx proagents deploy --env staging
|
|
173
|
-
displayName: 'Deploy to staging'
|
|
174
|
-
env:
|
|
175
|
-
DEPLOY_TOKEN: $(STAGING_DEPLOY_TOKEN)
|
|
176
|
-
|
|
177
|
-
- stage: DeployProduction
|
|
178
|
-
displayName: 'Deploy to Production'
|
|
179
|
-
dependsOn: Build
|
|
180
|
-
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
|
|
181
|
-
jobs:
|
|
182
|
-
- deployment: DeployProduction
|
|
183
|
-
displayName: 'Deploy to Production'
|
|
184
|
-
environment: 'production'
|
|
185
|
-
strategy:
|
|
186
|
-
runOnce:
|
|
187
|
-
deploy:
|
|
188
|
-
steps:
|
|
189
|
-
- download: current
|
|
190
|
-
artifact: build
|
|
191
|
-
|
|
192
|
-
- script: |
|
|
193
|
-
npx proagents deploy --env production
|
|
194
|
-
displayName: 'Deploy to production'
|
|
195
|
-
env:
|
|
196
|
-
DEPLOY_TOKEN: $(PROD_DEPLOY_TOKEN)
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
---
|
|
200
|
-
|
|
201
|
-
## Template Usage
|
|
202
|
-
|
|
203
|
-
```yaml
|
|
204
|
-
# azure-pipelines.yml
|
|
205
|
-
resources:
|
|
206
|
-
repositories:
|
|
207
|
-
- repository: templates
|
|
208
|
-
type: git
|
|
209
|
-
name: MyProject/pipeline-templates
|
|
210
|
-
|
|
211
|
-
extends:
|
|
212
|
-
template: node-app.yml@templates
|
|
213
|
-
parameters:
|
|
214
|
-
nodeVersion: '20.x'
|
|
215
|
-
runIntegrationTests: true
|
|
216
|
-
deployToStaging: true
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
---
|
|
220
|
-
|
|
221
|
-
## Multi-Stage with Approvals
|
|
222
|
-
|
|
223
|
-
```yaml
|
|
224
|
-
stages:
|
|
225
|
-
- stage: DeployProduction
|
|
226
|
-
jobs:
|
|
227
|
-
- deployment: Production
|
|
228
|
-
environment: 'production' # Requires approval in Azure DevOps
|
|
229
|
-
strategy:
|
|
230
|
-
runOnce:
|
|
231
|
-
deploy:
|
|
232
|
-
steps:
|
|
233
|
-
- script: echo "Deploying..."
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
---
|
|
237
|
-
|
|
238
|
-
## Matrix Strategy
|
|
239
|
-
|
|
240
|
-
```yaml
|
|
241
|
-
jobs:
|
|
242
|
-
- job: Test
|
|
243
|
-
strategy:
|
|
244
|
-
matrix:
|
|
245
|
-
Node18:
|
|
246
|
-
nodeVersion: '18.x'
|
|
247
|
-
Node20:
|
|
248
|
-
nodeVersion: '20.x'
|
|
249
|
-
Node22:
|
|
250
|
-
nodeVersion: '22.x'
|
|
251
|
-
steps:
|
|
252
|
-
- task: NodeTool@0
|
|
253
|
-
inputs:
|
|
254
|
-
versionSpec: $(nodeVersion)
|
|
255
|
-
- script: npm test
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
---
|
|
259
|
-
|
|
260
|
-
## Best Practices
|
|
261
|
-
|
|
262
|
-
1. **Use Stages**: Organize pipeline into logical stages
|
|
263
|
-
2. **Caching**: Cache npm dependencies
|
|
264
|
-
3. **Environments**: Use environments for deployment approvals
|
|
265
|
-
4. **Templates**: Use templates for reusable pipelines
|
|
266
|
-
5. **Service Containers**: Use for database/service dependencies
|
|
267
|
-
6. **Variable Groups**: Store secrets in variable groups
|