-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitverse-ci.yml
More file actions
706 lines (591 loc) · 17.3 KB
/
.gitverse-ci.yml
File metadata and controls
706 lines (591 loc) · 17.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
# 🚀 GitVerse Configuration
## 📋 **GitVerse Setup Guide**
GitVerse - российская платформа для совместной разработки и DevOps.
### **🎯 Быстрая настройка**
#### **1. Создание проекта в GitVerse**
```bash
# 1. Зарегистрируйтесь на https://gitverse.ru
# 2. Создайте организацию
# 3. Создайте новый проект
# 4. Скопируйте URL репозитория
# 5. Клонируйте проект локально
git clone <your-gitverse-repo-url>
cd <project-name>
```
#### **2. Настройка CI/CD в GitVerse**
```yaml
# Создайте файл .gitverse-ci.yml в корне проекта
# Перейдите в Настройки проекта → CI/CD
# Включите CI/CD и настройте переменные окружения
```
---
## ⚙️ **GitVerse CI/CD Pipeline**
### **📄 .gitverse-ci.yml** (Основной пайплайн)
```yaml
version: 1.0
name: "Katya AI REChain Mesh CI/CD"
stages:
- name: validate
jobs:
- name: "Code Quality"
image: "cirrusci/flutter:stable"
commands:
- flutter config --enable-web
- flutter config --enable-linux-desktop
- flutter config --enable-android
- flutter config --enable-ios
- flutter pub get
- dart format --set-exit-if-changed .
- flutter analyze
- flutter pub audit
- name: test
jobs:
- name: "Unit Tests"
image: "cirrusci/flutter:stable"
commands:
- flutter config --enable-web
- flutter config --enable-linux-desktop
- flutter pub get
- flutter test --coverage
- flutter test --tags=integration
- flutter test --tags=performance
artifacts:
- coverage/
- test-results/
coverage:
format: cobertura
path: coverage/lcov.info
- name: "Widget Tests"
image: "cirrusci/flutter:stable"
commands:
- flutter config --enable-web
- flutter pub get
- flutter test --tags=widget
- name: build
jobs:
- name: "Multi-Platform Build"
image: "cirrusci/flutter:stable"
commands:
# Android builds
- flutter build apk --release
- flutter build appbundle --release
# iOS builds
- flutter build ios --release --no-codesign
# Web builds
- flutter build web --release
# Desktop builds
- flutter build linux --release
- flutter build windows --release
- flutter build macos --release
artifacts:
- build/
- android/app/build/outputs/
- ios/build/
only:
branches:
- main
- develop
tags:
- v*
- name: security
jobs:
- name: "Security Scan"
image: "securecodewarrior/github-action-sarif-to-gitlab-ci:latest"
commands:
- flutter pub audit --json
- flutter analyze --security
- echo "Running dependency security check..."
artifacts:
- security-reports/
only:
branches:
- main
- develop
- name: deploy
jobs:
- name: "Deploy to Staging"
image: "google/cloud-sdk:alpine"
commands:
- gcloud auth activate-service-account --key-file $GCLOUD_SERVICE_KEY
- gcloud config set project $GCLOUD_PROJECT_ID
- gcloud config set compute/zone $GCLOUD_ZONE
- gcloud container clusters get-credentials $K8S_CLUSTER_NAME
- kubectl set image deployment/katya-rechain-mesh frontend=$GIT_COMMIT -n staging
- kubectl rollout status deployment/katya-rechain-mesh -n staging --timeout=600s
environment:
name: staging
url: https://staging.your-domain.ru
only:
branches:
- develop
- name: "Deploy to Production"
image: "google/cloud-sdk:alpine"
commands:
- gcloud auth activate-service-account --key-file $GCLOUD_SERVICE_KEY
- gcloud config set project $GCLOUD_PROJECT_ID
- gcloud config set compute/zone $GCLOUD_ZONE
- gcloud container clusters get-credentials $K8S_CLUSTER_NAME
- kubectl set image deployment/katya-rechain-mesh frontend=$GIT_COMMIT -n production
- kubectl rollout status deployment/katya-rechain-mesh -n production --timeout=600s
environment:
name: production
url: https://your-domain.ru
only:
branches:
- main
tags:
- v*
- name: notify
jobs:
- name: "Discord Notification"
image: "curlimages/curl:latest"
commands:
- |
if [ "$BUILD_STATUS" == "success" ]; then
curl -X POST -H 'Content-type: application/json' \
--data '{"text":"🚀 Build completed successfully! '"$PROJECT_NAME"' - '"$BRANCH_NAME"'"}' \
$DISCORD_WEBHOOK_URL
fi
when: always
only:
branches:
- main
- develop
# Глобальные переменные окружения
environment:
variables:
FLUTTER_VERSION: "3.24.0"
DART_VERSION: "3.5.0"
NODE_ENV: "production"
BLOCKCHAIN_API_KEY: "your_blockchain_key"
AI_API_KEY: "your_ai_key"
# Кэширование зависимостей
cache:
- key: flutter-packages
paths:
- .pub-cache/
files:
- pubspec.lock
- key: build-artifacts
paths:
- build/
- android/app/build/outputs/
```
---
## 🔧 **GitVerse Project Settings**
### **📄 .gitverse/config.yml** (Конфигурация проекта)
```yaml
# Конфигурация проекта GitVerse
project:
name: "katya-ai-rechain-mesh"
description: "AI-powered blockchain gaming IoT social mesh network"
visibility: "private" # private, public, internal
language: "Dart"
license: "MIT"
# Настройки CI/CD
ci_cd:
enabled: true
timeout: 3600 # 1 час
max_concurrent_jobs: 5
# Переменные окружения
variables:
FLUTTER_VERSION: "3.24.0"
DART_VERSION: "3.5.0"
NODE_ENV: "production"
BLOCKCHAIN_API_KEY: "secure_value"
AI_API_KEY: "secure_value"
KUBE_CONTEXT: "your-cluster"
KUBE_NAMESPACE: "production"
GCLOUD_PROJECT_ID: "your-project-id"
# Уведомления
notifications:
discord:
enabled: true
webhook_url: "https://discord.com/api/webhooks/..."
slack:
enabled: false
webhook_url: "https://hooks.slack.com/services/..."
email:
enabled: true
recipients: ["dev@your-domain.ru"]
# Настройки безопасности
security:
code_analysis:
enabled: true
tools: ["flutter_analyze", "custom_lint", "dart_code_metrics"]
dependency_scanning:
enabled: true
schedule: "weekly"
vulnerability_management:
enabled: true
auto_update: true
# Настройки развертывания
deployment:
environments:
staging:
kubernetes:
namespace: "staging"
cluster: "your-staging-cluster"
auto_deploy: true
branches: ["develop"]
production:
kubernetes:
namespace: "production"
cluster: "your-production-cluster"
auto_deploy: false
branches: ["main"]
tags: ["v*"]
# Настройки мониторинга
monitoring:
enabled: true
dashboards:
- name: "Application Performance"
url: "https://grafana.your-domain.ru/d/app-performance"
- name: "Infrastructure"
url: "https://grafana.your-domain.ru/d/infrastructure"
- name: "Security"
url: "https://grafana.your-domain.ru/d/security"
# Настройки качества кода
quality:
gates:
- name: "Code Coverage"
min_coverage: 80
enabled: true
- name: "Security Scan"
enabled: true
allow_failure: false
- name: "Performance Tests"
enabled: true
allow_failure: true
tools:
- name: "Flutter Analyze"
enabled: true
- name: "Dart Code Metrics"
enabled: true
- name: "Custom Lint"
enabled: true
```
---
## 📋 **GitVerse Issue Templates**
### **🐛 Bug Report Template**
```yaml
# .gitverse/issue_templates/bug_report.yml
name: "Bug Report"
title: "[Bug]: "
description: "Create a bug report"
labels: ["bug", "triage"]
assignees: []
fields:
- name: "version"
type: "input"
label: "Application Version"
description: "Version where the bug was found"
required: true
placeholder: "1.0.0"
- name: "platform"
type: "dropdown"
label: "Platform"
description: "Platform where bug occurs"
required: true
options:
- "Android"
- "iOS"
- "Web"
- "Desktop (Linux)"
- "Desktop (Windows)"
- "Desktop (macOS)"
- name: "description"
type: "textarea"
label: "Bug Description"
description: "Detailed description of the bug"
required: true
placeholder: |
Steps to reproduce:
1. Go to...
2. Click on...
3. Error occurs...
- name: "expected"
type: "textarea"
label: "Expected Behavior"
description: "What should happen instead"
required: true
- name: "actual"
type: "textarea"
label: "Actual Behavior"
description: "What actually happens"
required: true
- name: "environment"
type: "input"
label: "Environment"
description: "OS, browser, device, etc."
required: true
placeholder: "Android 12, Chrome 108, iPhone 14"
- name: "additional"
type: "textarea"
label: "Additional Information"
description: "Any additional context or information"
required: false
- name: "screenshots"
type: "file"
label: "Screenshots"
description: "Attach screenshots if applicable"
required: false
```
### **💡 Feature Request Template**
```yaml
# .gitverse/issue_templates/feature_request.yml
name: "Feature Request"
title: "[Feature]: "
description: "Suggest a new feature"
labels: ["enhancement", "triage"]
assignees: []
fields:
- name: "description"
type: "textarea"
label: "Feature Description"
description: "Detailed description of the feature"
required: true
placeholder: |
Describe the feature you want to add.
How should it work? What problems does it solve?
- name: "use_case"
type: "textarea"
label: "Use Cases"
description: "Examples of how this feature would be used"
required: true
placeholder: |
Example 1: User does X, gets Y
Example 2: In scenario Z, feature works like this
- name: "module"
type: "dropdown"
label: "Module"
description: "Which module this feature belongs to"
required: true
options:
- "Blockchain (Блокчейн)"
- "Gaming (Игры)"
- "IoT (Интернет вещей)"
- "Social (Социальные функции)"
- "AI (Искусственный интеллект)"
- "Infrastructure (Инфраструктура)"
- "Other (Другое)"
- name: "priority"
type: "dropdown"
label: "Priority"
description: "Feature priority"
required: true
options:
- "Critical (Критический)"
- "High (Высокий)"
- "Medium (Средний)"
- "Low (Низкий)"
- name: "alternatives"
type: "textarea"
label: "Alternative Solutions"
description: "Are there ways to solve this problem differently?"
required: false
- name: "additional"
type: "textarea"
label: "Additional Context"
description: "Any additional information"
required: false
```
---
## 🚀 **GitVerse Deployment Configuration**
### **📄 .gitverse/deployment.yml**
```yaml
# Конфигурация развертывания для GitVerse
deployment:
environments:
staging:
name: "Staging"
description: "Staging environment for testing"
kubernetes:
cluster: "staging-cluster"
namespace: "staging"
config_path: "k8s/staging/"
triggers:
branches: ["develop"]
auto_deploy: true
variables:
ENVIRONMENT: "staging"
DEBUG: "true"
production:
name: "Production"
description: "Production environment"
kubernetes:
cluster: "production-cluster"
namespace: "production"
config_path: "k8s/production/"
triggers:
branches: ["main"]
tags: ["v*"]
auto_deploy: false
variables:
ENVIRONMENT: "production"
DEBUG: "false"
# Стратегии развертывания
strategies:
rolling_update:
max_surge: "25%"
max_unavailable: "25%"
blue_green:
enabled: false
canary:
enabled: false
# Проверки здоровья
health_checks:
readiness_probe:
path: "/health"
port: 8080
initial_delay_seconds: 30
timeout_seconds: 5
liveness_probe:
path: "/health"
port: 8080
initial_delay_seconds: 60
timeout_seconds: 5
startup_probe:
path: "/health"
port: 8080
initial_delay_seconds: 10
timeout_seconds: 5
# Откат
rollback:
enabled: true
max_history: 10
auto_rollback: false
```
---
## 📚 **GitVerse Documentation**
### **📄 README_GITVERSE.md**
```markdown
# 🚀 Katya AI REChain Mesh - GitVerse Setup
## 📋 **Quick Start**
### **1. Create Project in GitVerse**
1. Register at [GitVerse](https://gitverse.ru)
2. Create an organization
3. Create a new project
4. Copy the repository URL
5. Clone the project locally:
```bash
git clone <your-gitverse-repo-url>
cd <project-name>
```
### **2. Setup CI/CD**
1. Go to **Project Settings → CI/CD**
2. Enable **CI/CD** for the project
3. Add environment variables:
- `FLUTTER_VERSION: "3.24.0"`
- `DART_VERSION: "3.5.0"`
- `BLOCKCHAIN_API_KEY: "your_key"`
- `AI_API_KEY: "your_key"`
### **3. First Run**
```bash
# Install dependencies
flutter pub get
# Check code
flutter analyze
# Run tests
flutter test
# Build application
flutter build web --release
```
## 🎯 **Project Structure**
```
📁 katya-ai-rechain-mesh/
├── 📁 .gitverse/ # GitVerse configurations
│ ├── 📄 config.yml # Project configuration
│ ├── 📄 deployment.yml # Deployment settings
│ └── 📄 ci.yml # CI/CD pipeline
├── 📁 lib/ # Flutter source code
├── 📁 test/ # Tests
├── 📁 k8s/ # Kubernetes manifests
├── 📁 helm/ # Helm charts
├── 📁 docs/ # Documentation
└── 📄 README.md # Main documentation
```
## 🔧 **Development Commands**
```bash
# Development mode
flutter run
# Build for all platforms
flutter build apk --release
flutter build ios --release
flutter build web --release
flutter build linux --release
# Testing
flutter test
flutter test --coverage
# Code analysis
flutter analyze
```
## 🚀 **Deployment**
### **Automatic Deployment**
- Push to `main` branch → Automatic build and deployment
- Push to `develop` branch → Deploy to staging
- Create tag → Release build
### **Manual Deployment**
```bash
# Build Docker image
docker build -t katya-rechain-mesh:1.0.0 .
# Deploy to Kubernetes
kubectl apply -f k8s/deployment.yml
# Or use Helm
helm install katya-rechain-mesh ./helm
```
## 📊 **Monitoring**
After deployment, monitoring is available at:
- **Prometheus**: http://monitoring.your-domain.ru:9090
- **Grafana**: http://monitoring.your-domain.ru:3000 (admin/admin)
- **Kibana**: http://monitoring.your-domain.ru:5601
## 🔒 **Security**
The project is configured according to:
- ✅ FZ-152 (Personal Data Protection)
- ✅ FZ-187 (Critical Infrastructure Security)
- ✅ GDPR compliance
- ✅ Regular vulnerability scanning
- ✅ Data encryption in transit and at rest
## 📞 **Support**
- **Documentation**: [Project Wiki](https://gitverse.ru/project/docs)
- **Issues**: [Create Issue](https://gitverse.ru/project/issues)
- **Discussions**: [Forum](https://gitverse.ru/project/discussions)
---
## 🎊 **Ready to Use!**
Your project is configured for GitVerse and ready for development, testing, and deployment! 🚀
```
---
## 📋 **GitVerse Migration Guide**
### **Migration from GitHub**
```bash
# 1. Create project in GitVerse
# 2. Export repository from GitHub
git clone --mirror <github-repo-url> old-repo
cd old-repo
git remote add gitverse <gitverse-repo-url>
git push --mirror gitverse
# 3. Setup CI/CD variables
# 4. Update documentation
# 5. Configure webhooks
```
### **Migration from GitLab**
```bash
# 1. Create project in GitVerse
# 2. Export from GitLab
# 3. Import to GitVerse
# 4. Setup environment variables
# 5. Update links in documentation
```
---
## 🎊 **GitVerse Setup Complete!**
**✅ Your project is ready for GitVerse:**
- ✅ **CI/CD configured** with full pipeline
- ✅ **Security ensured** with vulnerability scanning
- ✅ **Deployment automated** for all platforms
- ✅ **Monitoring configured** with dashboards
- ✅ **Documentation ready** for the team
- ✅ **Templates created** for efficient workflow
**🚀 Ready for development with GitVerse!** 🎉
```
---
**Next: Creating SourceCraft and other domestic platform configurations!** 🚀