@codigodoleo/wp-kit 3.5.0 → 5.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/lib/prompts/index.js +99 -0
- package/modules/docs/index.js +56 -1
- package/modules/docs/templates/README.md.hbs +33 -160
- package/modules/docs/templates/docs/Arquitetura.md.hbs +106 -0
- package/modules/docs/templates/docs/Deploy-Pipeline.md.hbs +85 -0
- package/modules/docs/templates/docs/Desenvolvimento.md.hbs +127 -0
- package/modules/docs/templates/docs/Getting-Started.md.hbs +83 -0
- package/modules/docs/templates/docs/Infraestrutura.md.hbs +65 -0
- package/modules/docs/templates/docs/Monitoramento.md.hbs +57 -0
- package/modules/docs/templates/docs/Sync-the-Production-DB-with-the-Staging-DB.md.hbs +68 -0
- package/modules/docs/templates/docs/Troubleshooting.md.hbs +65 -0
- package/modules/mu-plugin/index.js +143 -17
- package/modules/mu-plugin/prompts.js +7 -0
- package/modules/mu-plugin/templates/acorn/.gitignore.hbs +10 -0
- package/modules/mu-plugin/templates/acorn/README.md.hbs +46 -0
- package/modules/mu-plugin/templates/acorn/app/Providers/CoreServiceProvider.php.hbs +26 -0
- package/modules/mu-plugin/templates/acorn/composer.json.hbs +31 -0
- package/modules/mu-plugin/templates/acorn/config/app.php.hbs +43 -0
- package/modules/mu-plugin/templates/acorn/config/logging.php.hbs +59 -0
- package/modules/mu-plugin/templates/acorn/plugin.php.hbs +95 -0
- package/modules/mu-plugin/templates/acorn/resources/.gitkeep +0 -0
- package/modules/mu-plugin/templates/acorn/storage/framework/cache/.gitkeep +0 -0
- package/modules/mu-plugin/templates/acorn/storage/framework/sessions/.gitkeep +0 -0
- package/modules/mu-plugin/templates/acorn/storage/framework/views/.gitkeep +0 -0
- package/modules/mu-plugin/templates/bedrock-autoloader.php +28 -0
- package/modules/sage/templates/.lando.yml.hbs +4 -1
- package/package.json +1 -1
- package/templates/.lando.yml.hbs +0 -9
- package/modules/docs/templates/docs/Arquitetura.md +0 -420
- package/modules/docs/templates/docs/Deploy-Pipeline.md +0 -127
- package/modules/docs/templates/docs/Desenvolvimento.md +0 -1139
- package/modules/docs/templates/docs/Getting-Started.md +0 -523
- package/modules/docs/templates/docs/Infraestrutura.md +0 -240
- package/modules/docs/templates/docs/Monitoramento.md +0 -340
- package/modules/docs/templates/docs/Sync-the-Production-DB-with-the-Staging-DB.md +0 -7
- package/modules/docs/templates/docs/Troubleshooting.md +0 -3
|
@@ -1,420 +0,0 @@
|
|
|
1
|
-
# 🏗️ Arquitetura
|
|
2
|
-
|
|
3
|
-
Documentação completa da arquitetura técnica do site Pipefy, incluindo infraestrutura, tecnologias e planos futuros.
|
|
4
|
-
|
|
5
|
-
## 🎯 **Visão Geral da Arquitetura**
|
|
6
|
-
|
|
7
|
-
O site Pipefy é construído com uma arquitetura moderna e escalável, utilizando WordPress customizado em containers orquestrados por Kubernetes, com pipeline de CI/CD totalmente automatizado.
|
|
8
|
-
|
|
9
|
-
## 🏛️ **Arquitetura de Alto Nível**
|
|
10
|
-
|
|
11
|
-
```mermaid
|
|
12
|
-
graph TB
|
|
13
|
-
subgraph "👨💻 Desenvolvimento"
|
|
14
|
-
DEV[Desenvolvedores]
|
|
15
|
-
LOCAL[pipefy.lndo.site<br/>Lando + Docker]
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
subgraph "🔄 CI/CD Pipeline"
|
|
19
|
-
GITLAB[GitLab CI/CD]
|
|
20
|
-
REGISTRY[Container Registry]
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
subgraph "☁️ Cloud Infrastructure"
|
|
24
|
-
CF[CloudFlare<br/>CDN + DNS]
|
|
25
|
-
LB[Load Balancer<br/>OCI]
|
|
26
|
-
|
|
27
|
-
subgraph "🎛️ Kubernetes Cluster"
|
|
28
|
-
K8S_DEV[website-dev<br/>development-www.pipefy.com]
|
|
29
|
-
K8S_STG[website-stg<br/>staging-www.pipefy.com]
|
|
30
|
-
K8S_PROD[website-prod<br/>www.pipefy.com]
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
subgraph "💾 Persistence"
|
|
34
|
-
DB[MySQL Database]
|
|
35
|
-
STORAGE[File Storage]
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
DEV --> LOCAL
|
|
40
|
-
DEV --> GITLAB
|
|
41
|
-
GITLAB --> REGISTRY
|
|
42
|
-
GITLAB --> K8S_DEV
|
|
43
|
-
GITLAB --> K8S_STG
|
|
44
|
-
GITLAB --> K8S_PROD
|
|
45
|
-
|
|
46
|
-
CF --> LB
|
|
47
|
-
LB --> K8S_DEV
|
|
48
|
-
LB --> K8S_STG
|
|
49
|
-
LB --> K8S_PROD
|
|
50
|
-
|
|
51
|
-
K8S_DEV --> DB
|
|
52
|
-
K8S_STG --> DB
|
|
53
|
-
K8S_PROD --> DB
|
|
54
|
-
K8S_DEV --> STORAGE
|
|
55
|
-
K8S_STG --> STORAGE
|
|
56
|
-
K8S_PROD --> STORAGE
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## 🛠️ **Stack Tecnológico Detalhado**
|
|
60
|
-
|
|
61
|
-
### **Frontend & CMS**
|
|
62
|
-
|
|
63
|
-
| Componente | Tecnologia | Versão | Finalidade |
|
|
64
|
-
| ------------- | ------------------------- | ------ | --------------------------------------- |
|
|
65
|
-
| **CMS** | WordPress | Latest | Sistema de gerenciamento de conteúdo |
|
|
66
|
-
| **Tema** | Pipefy 2020 (Custom) | 1.1.7 | Interface e funcionalidades específicas |
|
|
67
|
-
| **Blocks** | Gutenberg Custom Blocks | - | Blocos personalizados para editores |
|
|
68
|
-
| **Languages** | PHP, JavaScript, CSS/Sass | - | Desenvolvimento frontend/backend |
|
|
69
|
-
|
|
70
|
-
### **Containerização & Orquestração**
|
|
71
|
-
|
|
72
|
-
| Componente | Tecnologia | Versão | Finalidade |
|
|
73
|
-
| ---------------- | ---------- | ------- | --------------------------------------- |
|
|
74
|
-
| **Containers** | Docker | 20.0+ | Containerização da aplicação |
|
|
75
|
-
| **Orquestração** | Kubernetes | 1.25+ | Gerenciamento de containers em produção |
|
|
76
|
-
| **Dev Local** | Lando | 3.0+ | Ambiente de desenvolvimento local |
|
|
77
|
-
| **🎯 Futuro** | **Helm** | **3.x** | **Gerenciamento de deployments K8s** |
|
|
78
|
-
|
|
79
|
-
### **CI/CD & DevOps**
|
|
80
|
-
|
|
81
|
-
| Componente | Tecnologia | Versão | Finalidade |
|
|
82
|
-
| ------------ | ------------------------- | ------ | ------------------------------- |
|
|
83
|
-
| **CI/CD** | GitLab CI/CD | - | Pipeline automatizado |
|
|
84
|
-
| **Registry** | GitLab Container Registry | - | Armazenamento de imagens Docker |
|
|
85
|
-
| **IaC** | Terraform | 1.5+ | Infraestrutura como código |
|
|
86
|
-
| **Secrets** | Kubernetes Secrets | - | Gerenciamento de credenciais |
|
|
87
|
-
|
|
88
|
-
### **Infraestrutura Cloud**
|
|
89
|
-
|
|
90
|
-
| Componente | Tecnologia | Versão | Finalidade |
|
|
91
|
-
| ------------------ | ------------------ | ------ | ---------------------------- |
|
|
92
|
-
| **Cloud Provider** | OCI (Oracle Cloud) | - | Infraestrutura principal |
|
|
93
|
-
| **CDN/DNS** | CloudFlare | - | CDN, DNS e proteção DDoS |
|
|
94
|
-
| **Load Balancer** | OCI Load Balancer | - | Distribuição de tráfego |
|
|
95
|
-
| **Database** | MySQL | 8.0+ | Banco de dados WordPress |
|
|
96
|
-
| **Storage** | OCI Object Storage | - | Arquivos estáticos e uploads |
|
|
97
|
-
|
|
98
|
-
## 🌍 **Ambientes e Namespaces**
|
|
99
|
-
|
|
100
|
-
### **Estrutura de Ambientes**
|
|
101
|
-
|
|
102
|
-
```yaml
|
|
103
|
-
# Kubernetes Namespaces Structure
|
|
104
|
-
environments:
|
|
105
|
-
local:
|
|
106
|
-
url: 'pipefy.lndo.site'
|
|
107
|
-
type: 'Lando Container'
|
|
108
|
-
purpose: 'Desenvolvimento local'
|
|
109
|
-
|
|
110
|
-
development:
|
|
111
|
-
url: 'development-www.pipefy.com'
|
|
112
|
-
namespace: 'website-dev'
|
|
113
|
-
branch: 'development'
|
|
114
|
-
auto_deploy: true
|
|
115
|
-
purpose: 'Testes contínuos e integração'
|
|
116
|
-
|
|
117
|
-
staging:
|
|
118
|
-
url: 'staging-www.pipefy.com'
|
|
119
|
-
namespace: 'website-stg'
|
|
120
|
-
branch: 'staging'
|
|
121
|
-
auto_deploy: false
|
|
122
|
-
purpose: 'Homologação e testes finais'
|
|
123
|
-
|
|
124
|
-
production:
|
|
125
|
-
url: 'www.pipefy.com'
|
|
126
|
-
namespace: 'website-prod'
|
|
127
|
-
branch: 'master'
|
|
128
|
-
auto_deploy: false
|
|
129
|
-
purpose: 'Site oficial em produção'
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
### **Recursos por Ambiente**
|
|
133
|
-
|
|
134
|
-
| Recurso | Development | Staging | Production |
|
|
135
|
-
| ------------------- | ----------- | ------- | ---------- |
|
|
136
|
-
| **CPU Requests** | 100m | 200m | 500m |
|
|
137
|
-
| **Memory Requests** | 256Mi | 512Mi | 1Gi |
|
|
138
|
-
| **CPU Limits** | 500m | 1 | 2 |
|
|
139
|
-
| **Memory Limits** | 512Mi | 1Gi | 2Gi |
|
|
140
|
-
| **Replicas** | 1 | 1 | 3 |
|
|
141
|
-
| **Storage** | 5Gi | 10Gi | 50Gi |
|
|
142
|
-
| **Backup** | Daily | Daily | Hourly |
|
|
143
|
-
|
|
144
|
-
## 📁 **Estrutura de Arquivos Kubernetes**
|
|
145
|
-
|
|
146
|
-
### **Organização Atual (Kubernetes Nativo)**
|
|
147
|
-
|
|
148
|
-
```
|
|
149
|
-
k8s/
|
|
150
|
-
├── 📂 base/ # Configurações base
|
|
151
|
-
│ ├── 📄 deployment.yaml # Deployment principal
|
|
152
|
-
│ ├── 📄 service.yaml # Service interno
|
|
153
|
-
│ ├── 📄 ingress.yaml # Ingress controller
|
|
154
|
-
│ ├── 📄 configmap.yaml # Configurações
|
|
155
|
-
│ └── 📄 secret.yaml # Secrets (template)
|
|
156
|
-
├── 📂 environments/
|
|
157
|
-
│ ├── 📂 development/ # Namespace website-dev
|
|
158
|
-
│ │ ├── 📄 kustomization.yaml
|
|
159
|
-
│ │ └── 📄 values-dev.yaml
|
|
160
|
-
│ ├── 📂 staging/ # Namespace website-stg
|
|
161
|
-
│ │ ├── 📄 kustomization.yaml
|
|
162
|
-
│ │ └── 📄 values-stg.yaml
|
|
163
|
-
│ └── 📂 production/ # Namespace website-prod
|
|
164
|
-
│ ├── 📄 kustomization.yaml
|
|
165
|
-
│ └── 📄 values-prod.yaml
|
|
166
|
-
└── 📄 README.md
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### **🎯 Estrutura Futura (Helm)**
|
|
170
|
-
|
|
171
|
-
```
|
|
172
|
-
helm/
|
|
173
|
-
├── 📂 pipefy-website/ # Chart principal
|
|
174
|
-
│ ├── 📄 Chart.yaml # Metadados do chart
|
|
175
|
-
│ ├── 📄 values.yaml # Valores padrão
|
|
176
|
-
│ ├── 📂 templates/ # Templates Kubernetes
|
|
177
|
-
│ │ ├── 📄 deployment.yaml
|
|
178
|
-
│ │ ├── 📄 service.yaml
|
|
179
|
-
│ │ ├── 📄 ingress.yaml
|
|
180
|
-
│ │ ├── 📄 configmap.yaml
|
|
181
|
-
│ │ └── 📄 secret.yaml
|
|
182
|
-
│ └── 📂 charts/ # Sub-charts (se necessário)
|
|
183
|
-
├── 📂 environments/
|
|
184
|
-
│ ├── 📄 values-dev.yaml # Valores para development
|
|
185
|
-
│ ├── 📄 values-stg.yaml # Valores para staging
|
|
186
|
-
│ └── 📄 values-prod.yaml # Valores para production
|
|
187
|
-
└── 📄 README.md
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
## 🔄 **Pipeline de Deploy**
|
|
191
|
-
|
|
192
|
-
### **Workflow Atual (Kubernetes)**
|
|
193
|
-
|
|
194
|
-
```mermaid
|
|
195
|
-
graph LR
|
|
196
|
-
A[Git Push] --> B[GitLab CI/CD]
|
|
197
|
-
B --> C[Build Image]
|
|
198
|
-
C --> D[Push Registry]
|
|
199
|
-
D --> E{Branch?}
|
|
200
|
-
|
|
201
|
-
E -->|development| F[kubectl apply dev]
|
|
202
|
-
E -->|staging| G[Manual Deploy STG]
|
|
203
|
-
E -->|master| H[Manual Deploy PROD]
|
|
204
|
-
|
|
205
|
-
F --> I[website-dev namespace]
|
|
206
|
-
G --> J[website-stg namespace]
|
|
207
|
-
H --> K[website-prod namespace]
|
|
208
|
-
|
|
209
|
-
I --> L[development-www.pipefy.com]
|
|
210
|
-
J --> M[staging-www.pipefy.com]
|
|
211
|
-
K --> N[www.pipefy.com]
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
### **🎯 Pipeline Futuro (Helm)**
|
|
215
|
-
|
|
216
|
-
```mermaid
|
|
217
|
-
graph LR
|
|
218
|
-
A[Git Push] --> B[GitLab CI/CD]
|
|
219
|
-
B --> C[Build Image]
|
|
220
|
-
C --> D[Push Registry]
|
|
221
|
-
D --> E{Branch?}
|
|
222
|
-
|
|
223
|
-
E -->|development| F[helm upgrade dev]
|
|
224
|
-
E -->|staging| G[helm upgrade stg]
|
|
225
|
-
E -->|master| H[helm upgrade prod]
|
|
226
|
-
|
|
227
|
-
F --> I[website-dev namespace]
|
|
228
|
-
G --> J[website-stg namespace]
|
|
229
|
-
H --> K[website-prod namespace]
|
|
230
|
-
|
|
231
|
-
I --> L[development-www.pipefy.com]
|
|
232
|
-
J --> M[staging-www.pipefy.com]
|
|
233
|
-
K --> N[www.pipefy.com]
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
## 🛡️ **Segurança e Monitoramento**
|
|
237
|
-
|
|
238
|
-
### **Segurança**
|
|
239
|
-
|
|
240
|
-
- **HTTPS Forçado**: Todos os ambientes com SSL/TLS
|
|
241
|
-
- **CloudFlare Protection**: DDoS protection e WAF
|
|
242
|
-
- **Kubernetes Secrets**: Credenciais criptografadas
|
|
243
|
-
- **Network Policies**: Isolamento de namespaces
|
|
244
|
-
- **RBAC**: Controle de acesso baseado em roles
|
|
245
|
-
|
|
246
|
-
### **Monitoramento**
|
|
247
|
-
|
|
248
|
-
```yaml
|
|
249
|
-
# Health Checks Configurados
|
|
250
|
-
health_checks:
|
|
251
|
-
liveness_probe:
|
|
252
|
-
path: '/wp-admin/admin-ajax.php'
|
|
253
|
-
interval: 30s
|
|
254
|
-
timeout: 5s
|
|
255
|
-
|
|
256
|
-
readiness_probe:
|
|
257
|
-
path: '/wp-json/wp/v2/'
|
|
258
|
-
interval: 10s
|
|
259
|
-
timeout: 3s
|
|
260
|
-
|
|
261
|
-
startup_probe:
|
|
262
|
-
path: '/'
|
|
263
|
-
interval: 10s
|
|
264
|
-
timeout: 30s
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
## 🗄️ **Persistência de Dados**
|
|
268
|
-
|
|
269
|
-
### **Banco de Dados**
|
|
270
|
-
|
|
271
|
-
```yaml
|
|
272
|
-
# MySQL Configuration
|
|
273
|
-
database:
|
|
274
|
-
engine: 'MySQL 8.0+'
|
|
275
|
-
storage: 'OCI Block Storage'
|
|
276
|
-
backup_frequency: 'Hourly (Prod) / Daily (Others)'
|
|
277
|
-
retention: '30 days'
|
|
278
|
-
high_availability: true # Produção apenas
|
|
279
|
-
|
|
280
|
-
connection_pooling:
|
|
281
|
-
max_connections: 100
|
|
282
|
-
pool_size: 20
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
### **Armazenamento de Arquivos**
|
|
286
|
-
|
|
287
|
-
```yaml
|
|
288
|
-
# WordPress Uploads & Assets
|
|
289
|
-
file_storage:
|
|
290
|
-
type: 'OCI Object Storage'
|
|
291
|
-
mount_path: '/app/dist/wp-content/uploads'
|
|
292
|
-
access_mode: 'ReadWriteMany'
|
|
293
|
-
|
|
294
|
-
backup:
|
|
295
|
-
frequency: 'Daily'
|
|
296
|
-
retention: '90 days'
|
|
297
|
-
|
|
298
|
-
cdn_integration:
|
|
299
|
-
provider: 'CloudFlare'
|
|
300
|
-
cache_ttl: '1 hour'
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
## 🚀 **Plano de Migração para Helm**
|
|
304
|
-
|
|
305
|
-
### **🎯 Objetivos da Migração**
|
|
306
|
-
|
|
307
|
-
- **Simplificação**: Deploy mais simples com `helm upgrade`
|
|
308
|
-
- **Versionamento**: Controle de versões de releases
|
|
309
|
-
- **Rollback**: Rollback automatizado em caso de problemas
|
|
310
|
-
- **Reutilização**: Templates reutilizáveis entre ambientes
|
|
311
|
-
- **Ecosystem**: Integração com ecosystem Helm
|
|
312
|
-
|
|
313
|
-
### **📅 Cronograma Planejado**
|
|
314
|
-
|
|
315
|
-
```mermaid
|
|
316
|
-
gantt
|
|
317
|
-
title Migração Kubernetes → Helm
|
|
318
|
-
dateFormat YYYY-MM-DD
|
|
319
|
-
section Preparação
|
|
320
|
-
Criação Charts Base :prep1, 2025-07-01, 2025-07-15
|
|
321
|
-
Templates Conversion :prep2, after prep1, 10d
|
|
322
|
-
section Ambientes
|
|
323
|
-
Development Migration :dev, after prep2, 5d
|
|
324
|
-
Staging Migration :stg, after dev, 5d
|
|
325
|
-
Production Migration :prod, after stg, 10d
|
|
326
|
-
section Finalização
|
|
327
|
-
Documentation Update :docs, after prod, 5d
|
|
328
|
-
Team Training :train, after docs, 5d
|
|
329
|
-
```
|
|
330
|
-
|
|
331
|
-
### **🔄 Estratégia de Migração**
|
|
332
|
-
|
|
333
|
-
1. **Fase 1**: Criação dos Helm Charts baseados nos YAMLs atuais
|
|
334
|
-
2. **Fase 2**: Teste em ambiente de Development
|
|
335
|
-
3. **Fase 3**: Migração Staging com validação completa
|
|
336
|
-
4. **Fase 4**: Migração Production com strategy Blue/Green
|
|
337
|
-
5. **Fase 5**: Cleanup dos manifestos K8s antigos
|
|
338
|
-
|
|
339
|
-
### **✅ Benefícios Esperados**
|
|
340
|
-
|
|
341
|
-
- **Deploy**: Redução de 50% no tempo de deploy
|
|
342
|
-
- **Manutenção**: Código mais limpo e organizados
|
|
343
|
-
- **Debugging**: Melhor rastreabilidade de mudanças
|
|
344
|
-
- **Collaboration**: Facilita contribuições da equipe
|
|
345
|
-
- **Standards**: Alinhamento com padrões da indústria
|
|
346
|
-
|
|
347
|
-
## 🔧 **Comandos de Infraestrutura**
|
|
348
|
-
|
|
349
|
-
### **Kubernetes Atual**
|
|
350
|
-
|
|
351
|
-
```bash
|
|
352
|
-
# Deploy para diferentes ambientes
|
|
353
|
-
kubectl apply -f k8s/environments/development/ -n website-dev
|
|
354
|
-
kubectl apply -f k8s/environments/staging/ -n website-stg
|
|
355
|
-
kubectl apply -f k8s/environments/production/ -n website-prod
|
|
356
|
-
|
|
357
|
-
# Verificar status
|
|
358
|
-
kubectl get pods -n website-prod
|
|
359
|
-
kubectl get services -n website-prod
|
|
360
|
-
kubectl get ingress -n website-prod
|
|
361
|
-
|
|
362
|
-
# Logs e debugging
|
|
363
|
-
kubectl logs -f deployment/pipefy-website -n website-prod
|
|
364
|
-
kubectl describe pod <pod-name> -n website-prod
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
### **🎯 Helm Futuro**
|
|
368
|
-
|
|
369
|
-
```bash
|
|
370
|
-
# Deploy usando Helm
|
|
371
|
-
helm upgrade --install pipefy-dev ./helm/pipefy-website -f helm/environments/values-dev.yaml -n website-dev
|
|
372
|
-
helm upgrade --install pipefy-stg ./helm/pipefy-website -f helm/environments/values-stg.yaml -n website-stg
|
|
373
|
-
helm upgrade --install pipefy-prod ./helm/pipefy-website -f helm/environments/values-prod.yaml -n website-prod
|
|
374
|
-
|
|
375
|
-
# Verificar releases
|
|
376
|
-
helm list -n website-prod
|
|
377
|
-
helm status pipefy-prod -n website-prod
|
|
378
|
-
|
|
379
|
-
# Rollback se necessário
|
|
380
|
-
helm rollback pipefy-prod 1 -n website-prod
|
|
381
|
-
```
|
|
382
|
-
|
|
383
|
-
## 📊 **Métricas e Performance**
|
|
384
|
-
|
|
385
|
-
### **SLAs Definidos**
|
|
386
|
-
|
|
387
|
-
| Métrica | Development | Staging | Production |
|
|
388
|
-
| ----------------- | ----------- | ------- | ---------- |
|
|
389
|
-
| **Uptime** | 95% | 99% | 99.9% |
|
|
390
|
-
| **Response Time** | < 2s | < 1.5s | < 1s |
|
|
391
|
-
| **Error Rate** | < 5% | < 2% | < 0.5% |
|
|
392
|
-
| **Deploy Time** | < 5min | < 10min | < 15min |
|
|
393
|
-
|
|
394
|
-
### **Recursos de Observabilidade**
|
|
395
|
-
|
|
396
|
-
- **Health Checks**: Configurados em todos os pods
|
|
397
|
-
- **Logs Centralizados**: Via GitLab CI/CD logs
|
|
398
|
-
- **Alertas**: Configuração via Kubernetes events
|
|
399
|
-
- **Dashboards**: Métricas de infraestrutura OCI
|
|
400
|
-
|
|
401
|
-
## 🎯 **Próximos Passos da Arquitetura**
|
|
402
|
-
|
|
403
|
-
1. **[Deploy Pipeline](Deploy-Pipeline)** - Processo detalhado de CI/CD
|
|
404
|
-
2. **[Infraestrutura](Infraestrutura)** - Configurações Terraform e OCI
|
|
405
|
-
3. **[Monitoramento](Monitoramento)** - Health checks e observabilidade
|
|
406
|
-
4. **[Helm Migration Guide](Helm-Migration)** - Guia da migração futura
|
|
407
|
-
|
|
408
|
-
## 📞 **Suporte Técnico**
|
|
409
|
-
|
|
410
|
-
- **Infraestrutura**: Equipe DevOps (ver [CODEOWNERS](https://gitlab.com/pipefy/wordpress/pipefy-website/-/blob/master/CODEOWNERS))
|
|
411
|
-
- **Kubernetes Issues**: [GitLab Issues - Label: infrastructure](https://gitlab.com/pipefy/wordpress/pipefy-website/-/issues?label_name=infrastructure)
|
|
412
|
-
- **Helm Planning**: [GitLab Issues - Label: helm-migration](https://gitlab.com/pipefy/wordpress/pipefy-website/-/issues?label_name=helm-migration)
|
|
413
|
-
|
|
414
|
-
---
|
|
415
|
-
|
|
416
|
-
📝 **Última atualização**: Junho 2025
|
|
417
|
-
🏗️ **Arquitetura atual**: Kubernetes nativo
|
|
418
|
-
🎯 **Próxima evolução**: Migração para Helm (Q3 2025)
|
|
419
|
-
☁️ **Cloud Provider**: OCI (Oracle Cloud Infrastructure)
|
|
420
|
-
🔄 **Pipeline**: GitLab CI/CD totalmente automatizado
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
# Pipeline CI/CD - Pipefy Website
|
|
2
|
-
|
|
3
|
-
## Visão Geral
|
|
4
|
-
|
|
5
|
-
Pipeline automatizado para deploy do WordPress da Pipefy com integração ao fluxo de desenvolvimento da equipe.
|
|
6
|
-
|
|
7
|
-
## Ambientes e Triggers
|
|
8
|
-
|
|
9
|
-
### Development
|
|
10
|
-
|
|
11
|
-
- **Trigger**: Push na branch `develop`
|
|
12
|
-
- **Namespace**: `website-dev`
|
|
13
|
-
- **URL Cache**: `assets-site.staticpipefy.com/development/`
|
|
14
|
-
|
|
15
|
-
### Staging
|
|
16
|
-
|
|
17
|
-
- **Trigger**: Push na branch `staging`
|
|
18
|
-
- **Namespace**: `website-stg`
|
|
19
|
-
- **URL Cache**: `assets-site.staticpipefy.com/staging/`
|
|
20
|
-
|
|
21
|
-
### Production
|
|
22
|
-
|
|
23
|
-
- **Trigger**: Push na branch `master` (apenas de branches `release/*` ou `hotfix/*`)
|
|
24
|
-
- **Namespace**: `website-prod`
|
|
25
|
-
- **URL Cache**: `assets-site.staticpipefy.com/production/`
|
|
26
|
-
|
|
27
|
-
## Stages do Pipeline
|
|
28
|
-
|
|
29
|
-
### 1. Validation
|
|
30
|
-
|
|
31
|
-
- **kubeval**: Valida arquivos Kubernetes antes do deploy
|
|
32
|
-
|
|
33
|
-
### 2. Compiler
|
|
34
|
-
|
|
35
|
-
- **build-wordpress**: Compila tema e plugins WordPress
|
|
36
|
-
|
|
37
|
-
### 3. Image Build
|
|
38
|
-
|
|
39
|
-
- **image-build**: Constrói imagem Docker com tag do commit
|
|
40
|
-
|
|
41
|
-
### 4. Deploy
|
|
42
|
-
|
|
43
|
-
- **deploy**: Deploy no ambiente (manual)
|
|
44
|
-
- **clear-cache**: Limpa cache do Cloudflare
|
|
45
|
-
|
|
46
|
-
### 5. Tests
|
|
47
|
-
|
|
48
|
-
- **smoke-stg-website**: Testes de fumaça no staging
|
|
49
|
-
- **smoke-prod-website**: Testes de fumaça na produção
|
|
50
|
-
|
|
51
|
-
### 6. Rollback
|
|
52
|
-
|
|
53
|
-
- **rollback**: Executado automaticamente em caso de falha
|
|
54
|
-
|
|
55
|
-
## Fluxo de Desenvolvimento Integrado
|
|
56
|
-
|
|
57
|
-
### Feature Development
|
|
58
|
-
|
|
59
|
-
1. Desenvolver na branch `feature/*`
|
|
60
|
-
2. Merge para `develop` → Deploy automático no Development
|
|
61
|
-
3. Teste no ambiente de desenvolvimento
|
|
62
|
-
|
|
63
|
-
### Release Process
|
|
64
|
-
|
|
65
|
-
1. Criar branch `release/*` a partir de `develop`
|
|
66
|
-
2. Merge para `staging` → Deploy no Staging
|
|
67
|
-
3. Testes de aceitação no staging
|
|
68
|
-
4. Merge para `master` → Deploy manual na Production
|
|
69
|
-
|
|
70
|
-
### Hotfix Process
|
|
71
|
-
|
|
72
|
-
1. Criar branch `hotfix/*` a partir de `master`
|
|
73
|
-
2. Deploy direto na production após aprovação
|
|
74
|
-
3. Backport para `develop` e `staging`
|
|
75
|
-
|
|
76
|
-
## Jobs Principais
|
|
77
|
-
|
|
78
|
-
| Job | Objetivo | Quando Executa |
|
|
79
|
-
| ----------------- | ------------------------ | --------------------- |
|
|
80
|
-
| `build-wordpress` | Compila código WordPress | Todos os pushes |
|
|
81
|
-
| `image-build` | Cria imagem Docker | Após compilação |
|
|
82
|
-
| `deploy` | Deploy no K8s | Manual (staging/prod) |
|
|
83
|
-
| `clear-cache` | Limpa cache CDN | Após deploy |
|
|
84
|
-
| `smoke-tests` | Valida deploy | Após deploy |
|
|
85
|
-
|
|
86
|
-
## Configurações Importantes
|
|
87
|
-
|
|
88
|
-
- **Registry**: `$CI_REGISTRY_IMAGE:latest`
|
|
89
|
-
- **Kubernetes**: Oracle Cloud Infrastructure (OCI)
|
|
90
|
-
- **CDN**: Cloudflare
|
|
91
|
-
- **Storage**: PVC com `ReadWriteMany`
|
|
92
|
-
|
|
93
|
-
## Monitoramento
|
|
94
|
-
|
|
95
|
-
- Logs disponíveis no GitLab CI/CD
|
|
96
|
-
- Métricas de performance via smoke tests
|
|
97
|
-
- Notificações de falha automáticas
|
|
98
|
-
|
|
99
|
-
## ⚠️ Restauração de Banco de Dados (Staging)
|
|
100
|
-
|
|
101
|
-
> **🚨 AÇÃO DESTRUTIVA - ACESSO RESTRITO**
|
|
102
|
-
> Este processo substitui completamente o banco de dados do staging pelos dados de produção.
|
|
103
|
-
> **Permitido apenas para:** Desenvolvedores Seniores e Owners
|
|
104
|
-
> **Consequência:** Todos os dados atuais do staging serão **perdidos permanentemente**
|
|
105
|
-
|
|
106
|
-
### 📋 Processo de Restauração
|
|
107
|
-
|
|
108
|
-
1. **🎯 Acesse o GitLab:**
|
|
109
|
-
- Navegue até [CI/CD → Schedules](https://gitlab.com/pipefy/wordpress/pipefy-website/-/pipeline_schedules)
|
|
110
|
-
|
|
111
|
-
2. **📥 Backup do Banco de Produção:**
|
|
112
|
-
- Clique no botão ▶️ **Play** no pipeline agendado `Download Prod Database`
|
|
113
|
-
- ⏱️ Aguarde a conclusão (cria backup e armazena no bucket S3)
|
|
114
|
-
|
|
115
|
-
3. **🔄 Replicação para Staging:**
|
|
116
|
-
- Após finalizar o step anterior, clique no botão ▶️ **Play** no pipeline `Replicate Production DB into Staging DB`
|
|
117
|
-
- 📦 Este job utiliza o backup armazenado no bucket S3
|
|
118
|
-
|
|
119
|
-
4. **✅ Finalização:**
|
|
120
|
-
- Staging atualizado com dados de produção
|
|
121
|
-
- 🧪 Execute testes para validar a integridade dos dados
|
|
122
|
-
|
|
123
|
-
### ⚡ Importante
|
|
124
|
-
|
|
125
|
-
- ⏰ O processo pode levar alguns minutos dependendo do tamanho do banco
|
|
126
|
-
- 🔍 Monitore os logs dos jobs para identificar possíveis erros
|
|
127
|
-
- 📞 Em caso de problemas, contate imediatamente a equipe de infraestrutura
|