@codigodoleo/wp-kit 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.
Files changed (112) hide show
  1. package/.cspell.json +104 -0
  2. package/.editorconfig +13 -0
  3. package/.eslintignore +3 -0
  4. package/.eslintrc.json +24 -0
  5. package/.github/workflows/publish-npm.yml +32 -0
  6. package/.github/workflows/release-please.yml +25 -0
  7. package/.gitkeep +0 -0
  8. package/.husky/_/post-merge +0 -0
  9. package/.prettierignore +4 -0
  10. package/.prettierrc +8 -0
  11. package/.vscode/settings.json +19 -0
  12. package/CHANGELOG.md +47 -0
  13. package/README.md +115 -0
  14. package/VSCODE_EXTENSIONS.md +11 -0
  15. package/bin/index.js +4 -0
  16. package/docs/HOOKS-SYSTEM.md +172 -0
  17. package/git-deploy.sh +74 -0
  18. package/index.php +17 -0
  19. package/lib/cli.js +15 -0
  20. package/lib/commands/init.js +132 -0
  21. package/lib/core/generator.js +261 -0
  22. package/lib/core/hook-manager.js +172 -0
  23. package/lib/core/infer-ci-capabilities.js +119 -0
  24. package/lib/prompts/index.js +105 -0
  25. package/lib/prompts/loadModulePrompts.js +27 -0
  26. package/lib/utils/generate-from-template.js +17 -0
  27. package/lib/utils/git.js +17 -0
  28. package/lib/utils/logger.js +28 -0
  29. package/modules/deploy/index.js +39 -0
  30. package/modules/deploy/prompts.js +27 -0
  31. package/modules/deploy/templates/.github/workflows/ci.yml.hbs +103 -0
  32. package/modules/deploy/templates/.gitlab/gitlab-ci.yml.hbs +154 -0
  33. package/modules/deploy/templates/bitbucket-pipelines.yml.hbs +97 -0
  34. package/modules/docs/index.js +3 -0
  35. package/modules/docs/prompts.js +8 -0
  36. package/modules/docs/templates/README.md.hbs +160 -0
  37. package/modules/docs/templates/docs/Arquitetura.md +399 -0
  38. package/modules/docs/templates/docs/Deploy-Pipeline.md +113 -0
  39. package/modules/docs/templates/docs/Desenvolvimento.md +1116 -0
  40. package/modules/docs/templates/docs/Getting-Started.md +493 -0
  41. package/modules/docs/templates/docs/Infraestrutura.md +211 -0
  42. package/modules/docs/templates/docs/Monitoramento.md +302 -0
  43. package/modules/docs/templates/docs/Sync-the-Production-DB-with-the-Staging-DB.md +8 -0
  44. package/modules/docs/templates/docs/Troubleshooting.md +3 -0
  45. package/modules/git/.commitlintrc.json +136 -0
  46. package/modules/git/.github/PULL_REQUEST_TEMPLATE.md +42 -0
  47. package/modules/git/.gitlab/merge_request_templates/default.md +42 -0
  48. package/modules/git/.gitmessage +29 -0
  49. package/modules/git/.husky/commit-msg +4 -0
  50. package/modules/git/.husky/pre-commit +27 -0
  51. package/modules/git/.lintstagedrc.json +7 -0
  52. package/modules/git/.vscode/commit-instructions.md +59 -0
  53. package/modules/git/.vscode/conventional-commits.code-snippets +62 -0
  54. package/modules/git/.vscode/copilot.json +39 -0
  55. package/modules/git/docs/CONVENTIONAL-COMMITS.md +131 -0
  56. package/modules/git/index.js +137 -0
  57. package/modules/git/prompts.js +23 -0
  58. package/modules/git/templates/.lando.yml.hbs +13 -0
  59. package/modules/git/templates/package.json.hbs +15 -0
  60. package/modules/git/templates/workspace.json.hbs +114 -0
  61. package/modules/lint/.eslintignore +36 -0
  62. package/modules/lint/.eslintrc.json +8 -0
  63. package/modules/lint/.prettierignore +36 -0
  64. package/modules/lint/.prettierrc.json +29 -0
  65. package/modules/lint/.stylelintignore +19 -0
  66. package/modules/lint/.stylelintrc.json +9 -0
  67. package/modules/lint/index.js +15 -0
  68. package/modules/lint/pint.json +26 -0
  69. package/modules/lint/prompts.js +16 -0
  70. package/modules/lint/templates/.lando.yml.hbs +10 -0
  71. package/modules/lint/templates/package.json.hbs +16 -0
  72. package/modules/lint/templates/workspace.json.hbs +56 -0
  73. package/modules/php/index.js +3 -0
  74. package/modules/php/prompts.js +8 -0
  75. package/modules/php/scripts/php-wrapper.sh +38 -0
  76. package/modules/php/scripts/pint-wrapper.sh +44 -0
  77. package/modules/php/templates/.lando.yml.hbs +11 -0
  78. package/modules/php/templates/composer.json.hbs +6 -0
  79. package/modules/php/templates/workspace.json.hbs +74 -0
  80. package/modules/redis/prompts.js +8 -0
  81. package/modules/redis/templates/.lando.yml.hbs +8 -0
  82. package/modules/sage/index.js +20 -0
  83. package/modules/sage/prompts.js +16 -0
  84. package/modules/sage/templates/.lando.yml.hbs +64 -0
  85. package/modules/sage/templates/theme/composer.json.hbs +18 -0
  86. package/modules/sage/templates/theme/package.json.hbs +11 -0
  87. package/modules/sage/templates/theme/style.css.hbs +13 -0
  88. package/modules/sage/templates/theme/vite.config.js.hbs +53 -0
  89. package/modules/sage/templates/workspace.json.hbs +67 -0
  90. package/modules/test-directory/assets/module-file.txt +1 -0
  91. package/modules/test-directory/index.js +19 -0
  92. package/modules/test-directory/prompts.js +8 -0
  93. package/modules/test-directory/test-assets/file1.txt +1 -0
  94. package/modules/test-directory/test-assets/file2.txt +1 -0
  95. package/modules/test-directory/test-assets/subfolder/config.json +4 -0
  96. package/package.json +54 -0
  97. package/release-please-config.json +17 -0
  98. package/server/php/php.ini +48 -0
  99. package/server/www/rocket.conf +283 -0
  100. package/templates/.editorconfig.hbs +39 -0
  101. package/templates/.env.hbs +48 -0
  102. package/templates/.gitignore.hbs +86 -0
  103. package/templates/.lando.yml.hbs +44 -0
  104. package/templates/README.md.hbs +12 -0
  105. package/templates/composer.json.hbs +60 -0
  106. package/templates/package.json.hbs +47 -0
  107. package/templates/server/cmd/install-wp.sh.hbs +58 -0
  108. package/templates/server/www/vhosts.conf.hbs +71 -0
  109. package/templates/workspace.json.hbs +177 -0
  110. package/test-copy-directory.js +43 -0
  111. package/test-overwrite.js +45 -0
  112. package/wp-config.php +190 -0
@@ -0,0 +1,97 @@
1
+ # 🚀 WordPress CI (Bitbucket Pipelines)
2
+
3
+ image: node:{{ci.nodeVersion}}-alpine
4
+
5
+ pipelines:
6
+ default:
7
+ - step: &build-basic
8
+ name: Build basic
9
+ caches:
10
+ - node
11
+ script:
12
+ - echo "🚀 Build básico"
13
+ - |
14
+ if [ -f package.json ]; then npm ci --cache .npm --prefer-offline; fi
15
+
16
+ {{#if ci.build.composer}}
17
+ - step: &build-composer
18
+ name: Build Composer
19
+ image: composer:latest
20
+ caches:
21
+ - composer
22
+ script:
23
+ - echo "📦 Composer install"
24
+ - |
25
+ if [ -f composer.json ]; then composer install --no-dev --optimize-autoloader; fi
26
+ {{/if}}
27
+
28
+ {{#if ci.build.sage}}
29
+ - step: &build-sage
30
+ name: Build Sage
31
+ caches:
32
+ - node
33
+ script:
34
+ - echo "🎨 Build do tema Sage"
35
+ - |
36
+ THEME="{{ci.theme.paths.themeRoot}}"
37
+ if [ -d "$THEME" ]; then
38
+ cd "$THEME"
39
+ if [ -f package.json ]; then npm ci; fi
40
+ if [ -f yarn.lock ]; then yarn install --frozen-lockfile; fi
41
+ if [ -f package.json ]; then npm run build || yarn build; fi
42
+ else
43
+ echo "Tema não encontrado em $THEME — pulando build do tema"
44
+ fi
45
+ {{/if}}
46
+
47
+ - step: &test-basic
48
+ name: Tests
49
+ script:
50
+ - echo "🧪 Testes básicos"
51
+
52
+ branches:
53
+ main:
54
+ - step: *build-basic
55
+ {{#if ci.build.composer}}
56
+ - step: *build-composer
57
+ {{/if}}
58
+ {{#if ci.build.sage}}
59
+ - step: *build-sage
60
+ {{/if}}
61
+ - step: *test-basic
62
+ {{#if ci.deploy.docker}}
63
+ - step:
64
+ name: Deploy Docker
65
+ services:
66
+ - docker
67
+ script:
68
+ - echo "🐳 Deploy Docker (placeholder)"
69
+ {{/if}}
70
+
71
+ develop:
72
+ - step: *build-basic
73
+ {{#if ci.build.composer}}
74
+ - step: *build-composer
75
+ {{/if}}
76
+ {{#if ci.build.sage}}
77
+ - step: *build-sage
78
+ {{/if}}
79
+ - step: *test-basic
80
+
81
+ staging:
82
+ - step: *build-basic
83
+ {{#if ci.build.composer}}
84
+ - step: *build-composer
85
+ {{/if}}
86
+ {{#if ci.build.sage}}
87
+ - step: *build-sage
88
+ {{/if}}
89
+ - step: *test-basic
90
+
91
+ options:
92
+ size: 2x
93
+
94
+ definitions:
95
+ caches:
96
+ node: ~/.npm
97
+ composer: ~/.composer/cache
@@ -0,0 +1,3 @@
1
+ export async function setupModule(context, generator) {
2
+ await generator.generateFile('README.md', context, 'docs');
3
+ }
@@ -0,0 +1,8 @@
1
+ export default [
2
+ {
3
+ type: 'confirm',
4
+ name: 'enable_docs',
5
+ message: 'Enable Docs?',
6
+ default: true
7
+ }
8
+ ];
@@ -0,0 +1,160 @@
1
+ # 🏠 Pipefy WordPress Website
2
+
3
+ Bem-vindo à documentação oficial do site **pipefy.com** - um projeto WordPress robusto e moderno da Pipefy.
4
+
5
+ ## 🎯 **Visão Geral**
6
+
7
+ Este é o repositório principal do site institucional da Pipefy, construído com **WordPress** e uma infraestrutura cloud-native moderna. O projeto utiliza tecnologias de ponta para garantir performance, escalabilidade e facilidade de manutenção.
8
+
9
+ ### 📊 **Status do Projeto**
10
+ - **Versão Atual**: `1.1.7` (2025-05-23)
11
+ - **WordPress**: Customizado com tema Pipefy 2020
12
+ - **Ambiente**: Multi-ambiente (Local, Development, Staging, Production)
13
+ - **Deploy**: Automatizado via GitLab CI/CD + Kubernetes
14
+
15
+ ## 🚀 **Quick Start**
16
+
17
+ ### Pré-requisitos
18
+ - [Lando](https://lando.dev/) (para desenvolvimento local)
19
+ - [Docker](https://docker.com/)
20
+ - [Git](https://git-scm.com/)
21
+ - [Node.js](https://nodejs.org/) (versão especificada em `.nvmrc`)
22
+
23
+ ### Setup Rápido
24
+ ```bash
25
+ # 1. Clone o repositório
26
+ git clone git@gitlab.com:pipefy/wordpress/pipefy-website.git
27
+ cd pipefy-website
28
+
29
+ # 2. Inicie o ambiente local
30
+ lando start
31
+
32
+ # 3. Configure WordPress
33
+ lando ssh -c "development/scripts/init-wp.sh --user=seu-email@pipefy.com"
34
+
35
+ # 4. Acesse o site
36
+ # Frontend: https://pipefy.lndo.site
37
+ # Admin: https://pipefy.lndo.site/wp-admin
38
+ ```
39
+
40
+ ## 🏗️ **Arquitetura**
41
+
42
+ ```
43
+ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
44
+ │ Local │────│ Development │────│ Staging │────│ Production │
45
+ │ pipefy.lndo.site│ │development-www │ │ staging-www │ │ www.pipefy.com │
46
+ │ │ │ .pipefy.com │ │ .pipefy.com │ │ │
47
+ └─────────────────┘ └─────────────────┘ └─────────────────┘ └─────────────────┘
48
+ │ │ │ │
49
+ └───────────────────────┼───────────────────────┼───────────────────────┘
50
+ │ │
51
+ ┌─────────────────┐ ┌─────────────────┐
52
+ │ GitLab CI/CD │ │ Kubernetes │
53
+ │ Pipelines │ │ + CloudFlare │
54
+ └─────────────────┘ └─────────────────┘
55
+ ```
56
+
57
+ ### 🛠️ **Stack Tecnológico**
58
+
59
+ | Categoria | Tecnologia |
60
+ |-----------|------------|
61
+ | **CMS** | WordPress (customizado) |
62
+ | **Tema** | Pipefy 2020 (custom theme) |
63
+ | **Frontend** | PHP, JavaScript, Sass, Gutenberg Blocks |
64
+ | **Containerização** | Docker, Lando |
65
+ | **Orquestração** | Kubernetes, Helm |
66
+ | **CI/CD** | GitLab CI/CD |
67
+ | **Infraestrutura** | Terraform, OCI (Oracle Cloud) |
68
+ | **CDN/DNS** | CloudFlare |
69
+ | **Monitoramento** | Custom health checks |
70
+
71
+ ## 📁 **Estrutura do Projeto**
72
+
73
+ ```
74
+ pipefy-website/
75
+ ├── 📂 dist/ # WordPress core + customizações
76
+ │ └── 📂 wp-content/
77
+ │ ├── 📂 themes/pipefy-2020/ # Tema principal
78
+ │ ├── 📂 plugins/ # Plugins WordPress
79
+ │ └── 📂 mu-plugins/ # Must-use plugins
80
+ ├── 📂 development/ # Scripts e config. desenvolvimento
81
+ ├── 📂 helm/ # Charts Kubernetes
82
+ ├── 📂 k8s/ # Manifests Kubernetes
83
+ ├── 📂 terraform/ # Infraestrutura como código
84
+ ├── 📂 .gitlab/ # Templates GitLab CI/CD
85
+ ├── 📄 .lando.yml # Configuração ambiente local
86
+ ├── 📄 .gitlab-ci.yml # Pipeline CI/CD
87
+ └── 📄 CHANGELOG.md # Histórico de mudanças
88
+ ```
89
+
90
+ ## 🌍 **Ambientes**
91
+
92
+ | Ambiente | URL | Branch | Namespace K8s | Finalidade |
93
+ |----------|-----|--------|---------------|------------|
94
+ | **Local** | `pipefy.lndo.site` | `feature/*` | - | Desenvolvimento local |
95
+ | **Development** | `development-www.pipefy.com` | `development` | `website-dev` | Testes contínuos |
96
+ | **Staging** | `staging-www.pipefy.com` | `staging` | `website-stg` | Homologação |
97
+ | **Production** | `www.pipefy.com` | `master` | `website-prod` | Site oficial |
98
+
99
+ ## 🔄 **Workflow de Desenvolvimento**
100
+
101
+ ```mermaid
102
+ graph LR
103
+ A[Feature Branch] --> B[Pull Request]
104
+ B --> C[Code Review]
105
+ C --> D[Merge to Development]
106
+ D --> E["🚀 development-www.pipefy.com"]
107
+ E --> F[Merge to Staging]
108
+ F --> G["🔍 staging-www.pipefy.com"]
109
+ G --> H[Tests + QA]
110
+ H --> I[Merge to Master]
111
+ I --> J["✅ www.pipefy.com"]
112
+ ```
113
+
114
+ ## 📚 **Documentação Principal**
115
+
116
+ ### 🚀 **Para Desenvolvedores**
117
+ - [Getting Started](Getting-Started) - Setup completo do ambiente
118
+ - [Arquitetura](Arquitetura) - Estrutura técnica detalhada
119
+ - [Desenvolvimento](Desenvolvimento) - Guias de desenvolvimento
120
+ - [Deploy Pipeline](Deploy-Pipeline) - Processo de deploy
121
+
122
+ ### 🔧 **Para DevOps**
123
+ - [Infraestrutura](Infraestrutura) - Kubernetes, Terraform, AWS
124
+ - [Monitoramento](Monitoramento) - Health checks e observabilidade
125
+ - [Troubleshooting](Troubleshooting) - Resolução de problemas
126
+
127
+ ### 📦 **Para Gestão**
128
+ - [Plugins & Integrações](Plugins-Integracoes) - Componentes externos
129
+ - [Changelog](https://gitlab.com/pipefy/wordpress/pipefy-website/-/blob/master/CHANGELOG.md) - Histórico de versões
130
+ - [CODEOWNERS](https://gitlab.com/pipefy/wordpress/pipefy-website/-/blob/master/CODEOWNERS) - Responsabilidades
131
+
132
+ ## 🆘 **Precisa de Ajuda?**
133
+
134
+ ### 🐛 **Problemas Comuns**
135
+ - [Troubleshooting](Troubleshooting) - Guia de resolução
136
+ - [FAQ](FAQ) - Perguntas frequentes
137
+
138
+ ### 📞 **Contatos**
139
+ - **Equipe**: @Approvers (conforme [CODEOWNERS](https://gitlab.com/pipefy/wordpress/pipefy-website/-/blob/master/CODEOWNERS))
140
+ - **Issues**: [GitLab Issues](https://gitlab.com/pipefy/wordpress/pipefy-website/-/issues)
141
+ - **Pipefy Cards**: Vinculados no [CHANGELOG.md](https://gitlab.com/pipefy/wordpress/pipefy-website/-/blob/master/CHANGELOG.md)
142
+
143
+ ## 🎯 **Links Importantes**
144
+
145
+ | Recurso | Link | Ambiente |
146
+ |---------|------|----------|
147
+ | **Site Produção** | [www.pipefy.com](https://www.pipefy.com) | 🔴 Production |
148
+ | **Site Staging** | [staging-www.pipefy.com](https://staging-www.pipefy.com) | 🟡 Staging |
149
+ | **Site Development** | [development-www.pipefy.com](https://development-www.pipefy.com) | 🟠 Development |
150
+ | **Site Local** | [pipefy.lndo.site](https://pipefy.lndo.site) | 🔵 Local |
151
+ | **GitLab Project** | [pipefy/wordpress/pipefy-website](https://gitlab.com/pipefy/wordpress/pipefy-website) | - |
152
+ | **CI/CD Pipelines** | [Pipelines](https://gitlab.com/pipefy/wordpress/pipefy-website/-/pipelines) | - |
153
+ | **Kubernetes Dashboards** | *[Links internos conforme ambiente]* | - |
154
+
155
+ ---
156
+
157
+ 📝 **Última atualização**: Junho 2025
158
+ 🔄 **Versão da documentação**: 1.1
159
+ ✨ **Criado com**: Análise automatizada do projeto + GitHub Copilot
160
+ 🌐 **Ambientes atualizados**: Local, Development, Staging, Production
@@ -0,0 +1,399 @@
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
+ | Componente | Tecnologia | Versão | Finalidade |
63
+ |------------|------------|---------|------------|
64
+ | **CMS** | WordPress | Latest | Sistema de gerenciamento de conteúdo |
65
+ | **Tema** | Pipefy 2020 (Custom) | 1.1.7 | Interface e funcionalidades específicas |
66
+ | **Blocks** | Gutenberg Custom Blocks | - | Blocos personalizados para editores |
67
+ | **Languages** | PHP, JavaScript, CSS/Sass | - | Desenvolvimento frontend/backend |
68
+
69
+ ### **Containerização & Orquestração**
70
+ | Componente | Tecnologia | Versão | Finalidade |
71
+ |------------|------------|---------|------------|
72
+ | **Containers** | Docker | 20.0+ | Containerização da aplicação |
73
+ | **Orquestração** | Kubernetes | 1.25+ | Gerenciamento de containers em produção |
74
+ | **Dev Local** | Lando | 3.0+ | Ambiente de desenvolvimento local |
75
+ | **🎯 Futuro** | **Helm** | **3.x** | **Gerenciamento de deployments K8s** |
76
+
77
+ ### **CI/CD & DevOps**
78
+ | Componente | Tecnologia | Versão | Finalidade |
79
+ |------------|------------|---------|------------|
80
+ | **CI/CD** | GitLab CI/CD | - | Pipeline automatizado |
81
+ | **Registry** | GitLab Container Registry | - | Armazenamento de imagens Docker |
82
+ | **IaC** | Terraform | 1.5+ | Infraestrutura como código |
83
+ | **Secrets** | Kubernetes Secrets | - | Gerenciamento de credenciais |
84
+
85
+ ### **Infraestrutura Cloud**
86
+ | Componente | Tecnologia | Versão | Finalidade |
87
+ |------------|------------|---------|------------|
88
+ | **Cloud Provider** | OCI (Oracle Cloud) | - | Infraestrutura principal |
89
+ | **CDN/DNS** | CloudFlare | - | CDN, DNS e proteção DDoS |
90
+ | **Load Balancer** | OCI Load Balancer | - | Distribuição de tráfego |
91
+ | **Database** | MySQL | 8.0+ | Banco de dados WordPress |
92
+ | **Storage** | OCI Object Storage | - | Arquivos estáticos e uploads |
93
+
94
+ ## 🌍 **Ambientes e Namespaces**
95
+
96
+ ### **Estrutura de Ambientes**
97
+ ```yaml
98
+ # Kubernetes Namespaces Structure
99
+ environments:
100
+ local:
101
+ url: "pipefy.lndo.site"
102
+ type: "Lando Container"
103
+ purpose: "Desenvolvimento local"
104
+
105
+ development:
106
+ url: "development-www.pipefy.com"
107
+ namespace: "website-dev"
108
+ branch: "development"
109
+ auto_deploy: true
110
+ purpose: "Testes contínuos e integração"
111
+
112
+ staging:
113
+ url: "staging-www.pipefy.com"
114
+ namespace: "website-stg"
115
+ branch: "staging"
116
+ auto_deploy: false
117
+ purpose: "Homologação e testes finais"
118
+
119
+ production:
120
+ url: "www.pipefy.com"
121
+ namespace: "website-prod"
122
+ branch: "master"
123
+ auto_deploy: false
124
+ purpose: "Site oficial em produção"
125
+ ```
126
+
127
+ ### **Recursos por Ambiente**
128
+
129
+ | Recurso | Development | Staging | Production |
130
+ |---------|-------------|---------|------------|
131
+ | **CPU Requests** | 100m | 200m | 500m |
132
+ | **Memory Requests** | 256Mi | 512Mi | 1Gi |
133
+ | **CPU Limits** | 500m | 1 | 2 |
134
+ | **Memory Limits** | 512Mi | 1Gi | 2Gi |
135
+ | **Replicas** | 1 | 1 | 3 |
136
+ | **Storage** | 5Gi | 10Gi | 50Gi |
137
+ | **Backup** | Daily | Daily | Hourly |
138
+
139
+ ## 📁 **Estrutura de Arquivos Kubernetes**
140
+
141
+ ### **Organização Atual (Kubernetes Nativo)**
142
+ ```
143
+ k8s/
144
+ ├── 📂 base/ # Configurações base
145
+ │ ├── 📄 deployment.yaml # Deployment principal
146
+ │ ├── 📄 service.yaml # Service interno
147
+ │ ├── 📄 ingress.yaml # Ingress controller
148
+ │ ├── 📄 configmap.yaml # Configurações
149
+ │ └── 📄 secret.yaml # Secrets (template)
150
+ ├── 📂 environments/
151
+ │ ├── 📂 development/ # Namespace website-dev
152
+ │ │ ├── 📄 kustomization.yaml
153
+ │ │ └── 📄 values-dev.yaml
154
+ │ ├── 📂 staging/ # Namespace website-stg
155
+ │ │ ├── 📄 kustomization.yaml
156
+ │ │ └── 📄 values-stg.yaml
157
+ │ └── 📂 production/ # Namespace website-prod
158
+ │ ├── 📄 kustomization.yaml
159
+ │ └── 📄 values-prod.yaml
160
+ └── 📄 README.md
161
+ ```
162
+
163
+ ### **🎯 Estrutura Futura (Helm)**
164
+ ```
165
+ helm/
166
+ ├── 📂 pipefy-website/ # Chart principal
167
+ │ ├── 📄 Chart.yaml # Metadados do chart
168
+ │ ├── 📄 values.yaml # Valores padrão
169
+ │ ├── 📂 templates/ # Templates Kubernetes
170
+ │ │ ├── 📄 deployment.yaml
171
+ │ │ ├── 📄 service.yaml
172
+ │ │ ├── 📄 ingress.yaml
173
+ │ │ ├── 📄 configmap.yaml
174
+ │ │ └── 📄 secret.yaml
175
+ │ └── 📂 charts/ # Sub-charts (se necessário)
176
+ ├── 📂 environments/
177
+ │ ├── 📄 values-dev.yaml # Valores para development
178
+ │ ├── 📄 values-stg.yaml # Valores para staging
179
+ │ └── 📄 values-prod.yaml # Valores para production
180
+ └── 📄 README.md
181
+ ```
182
+
183
+ ## 🔄 **Pipeline de Deploy**
184
+
185
+ ### **Workflow Atual (Kubernetes)**
186
+ ```mermaid
187
+ graph LR
188
+ A[Git Push] --> B[GitLab CI/CD]
189
+ B --> C[Build Image]
190
+ C --> D[Push Registry]
191
+ D --> E{Branch?}
192
+
193
+ E -->|development| F[kubectl apply dev]
194
+ E -->|staging| G[Manual Deploy STG]
195
+ E -->|master| H[Manual Deploy PROD]
196
+
197
+ F --> I[website-dev namespace]
198
+ G --> J[website-stg namespace]
199
+ H --> K[website-prod namespace]
200
+
201
+ I --> L[development-www.pipefy.com]
202
+ J --> M[staging-www.pipefy.com]
203
+ K --> N[www.pipefy.com]
204
+ ```
205
+
206
+ ### **🎯 Pipeline Futuro (Helm)**
207
+ ```mermaid
208
+ graph LR
209
+ A[Git Push] --> B[GitLab CI/CD]
210
+ B --> C[Build Image]
211
+ C --> D[Push Registry]
212
+ D --> E{Branch?}
213
+
214
+ E -->|development| F[helm upgrade dev]
215
+ E -->|staging| G[helm upgrade stg]
216
+ E -->|master| H[helm upgrade prod]
217
+
218
+ F --> I[website-dev namespace]
219
+ G --> J[website-stg namespace]
220
+ H --> K[website-prod namespace]
221
+
222
+ I --> L[development-www.pipefy.com]
223
+ J --> M[staging-www.pipefy.com]
224
+ K --> N[www.pipefy.com]
225
+ ```
226
+
227
+ ## 🛡️ **Segurança e Monitoramento**
228
+
229
+ ### **Segurança**
230
+ - **HTTPS Forçado**: Todos os ambientes com SSL/TLS
231
+ - **CloudFlare Protection**: DDoS protection e WAF
232
+ - **Kubernetes Secrets**: Credenciais criptografadas
233
+ - **Network Policies**: Isolamento de namespaces
234
+ - **RBAC**: Controle de acesso baseado em roles
235
+
236
+ ### **Monitoramento**
237
+ ```yaml
238
+ # Health Checks Configurados
239
+ health_checks:
240
+ liveness_probe:
241
+ path: "/wp-admin/admin-ajax.php"
242
+ interval: 30s
243
+ timeout: 5s
244
+
245
+ readiness_probe:
246
+ path: "/wp-json/wp/v2/"
247
+ interval: 10s
248
+ timeout: 3s
249
+
250
+ startup_probe:
251
+ path: "/"
252
+ interval: 10s
253
+ timeout: 30s
254
+ ```
255
+
256
+ ## 🗄️ **Persistência de Dados**
257
+
258
+ ### **Banco de Dados**
259
+ ```yaml
260
+ # MySQL Configuration
261
+ database:
262
+ engine: "MySQL 8.0+"
263
+ storage: "OCI Block Storage"
264
+ backup_frequency: "Hourly (Prod) / Daily (Others)"
265
+ retention: "30 days"
266
+ high_availability: true # Produção apenas
267
+
268
+ connection_pooling:
269
+ max_connections: 100
270
+ pool_size: 20
271
+ ```
272
+
273
+ ### **Armazenamento de Arquivos**
274
+ ```yaml
275
+ # WordPress Uploads & Assets
276
+ file_storage:
277
+ type: "OCI Object Storage"
278
+ mount_path: "/app/dist/wp-content/uploads"
279
+ access_mode: "ReadWriteMany"
280
+
281
+ backup:
282
+ frequency: "Daily"
283
+ retention: "90 days"
284
+
285
+ cdn_integration:
286
+ provider: "CloudFlare"
287
+ cache_ttl: "1 hour"
288
+ ```
289
+
290
+ ## 🚀 **Plano de Migração para Helm**
291
+
292
+ ### **🎯 Objetivos da Migração**
293
+ - **Simplificação**: Deploy mais simples com `helm upgrade`
294
+ - **Versionamento**: Controle de versões de releases
295
+ - **Rollback**: Rollback automatizado em caso de problemas
296
+ - **Reutilização**: Templates reutilizáveis entre ambientes
297
+ - **Ecosystem**: Integração com ecosystem Helm
298
+
299
+ ### **📅 Cronograma Planejado**
300
+ ```mermaid
301
+ gantt
302
+ title Migração Kubernetes → Helm
303
+ dateFormat YYYY-MM-DD
304
+ section Preparação
305
+ Criação Charts Base :prep1, 2025-07-01, 2025-07-15
306
+ Templates Conversion :prep2, after prep1, 10d
307
+ section Ambientes
308
+ Development Migration :dev, after prep2, 5d
309
+ Staging Migration :stg, after dev, 5d
310
+ Production Migration :prod, after stg, 10d
311
+ section Finalização
312
+ Documentation Update :docs, after prod, 5d
313
+ Team Training :train, after docs, 5d
314
+ ```
315
+
316
+ ### **🔄 Estratégia de Migração**
317
+ 1. **Fase 1**: Criação dos Helm Charts baseados nos YAMLs atuais
318
+ 2. **Fase 2**: Teste em ambiente de Development
319
+ 3. **Fase 3**: Migração Staging com validação completa
320
+ 4. **Fase 4**: Migração Production com strategy Blue/Green
321
+ 5. **Fase 5**: Cleanup dos manifestos K8s antigos
322
+
323
+ ### **✅ Benefícios Esperados**
324
+ - **Deploy**: Redução de 50% no tempo de deploy
325
+ - **Manutenção**: Código mais limpo e organizados
326
+ - **Debugging**: Melhor rastreabilidade de mudanças
327
+ - **Collaboration**: Facilita contribuições da equipe
328
+ - **Standards**: Alinhamento com padrões da indústria
329
+
330
+ ## 🔧 **Comandos de Infraestrutura**
331
+
332
+ ### **Kubernetes Atual**
333
+ ```bash
334
+ # Deploy para diferentes ambientes
335
+ kubectl apply -f k8s/environments/development/ -n website-dev
336
+ kubectl apply -f k8s/environments/staging/ -n website-stg
337
+ kubectl apply -f k8s/environments/production/ -n website-prod
338
+
339
+ # Verificar status
340
+ kubectl get pods -n website-prod
341
+ kubectl get services -n website-prod
342
+ kubectl get ingress -n website-prod
343
+
344
+ # Logs e debugging
345
+ kubectl logs -f deployment/pipefy-website -n website-prod
346
+ kubectl describe pod <pod-name> -n website-prod
347
+ ```
348
+
349
+ ### **🎯 Helm Futuro**
350
+ ```bash
351
+ # Deploy usando Helm
352
+ helm upgrade --install pipefy-dev ./helm/pipefy-website -f helm/environments/values-dev.yaml -n website-dev
353
+ helm upgrade --install pipefy-stg ./helm/pipefy-website -f helm/environments/values-stg.yaml -n website-stg
354
+ helm upgrade --install pipefy-prod ./helm/pipefy-website -f helm/environments/values-prod.yaml -n website-prod
355
+
356
+ # Verificar releases
357
+ helm list -n website-prod
358
+ helm status pipefy-prod -n website-prod
359
+
360
+ # Rollback se necessário
361
+ helm rollback pipefy-prod 1 -n website-prod
362
+ ```
363
+
364
+ ## 📊 **Métricas e Performance**
365
+
366
+ ### **SLAs Definidos**
367
+ | Métrica | Development | Staging | Production |
368
+ |---------|-------------|---------|------------|
369
+ | **Uptime** | 95% | 99% | 99.9% |
370
+ | **Response Time** | < 2s | < 1.5s | < 1s |
371
+ | **Error Rate** | < 5% | < 2% | < 0.5% |
372
+ | **Deploy Time** | < 5min | < 10min | < 15min |
373
+
374
+ ### **Recursos de Observabilidade**
375
+ - **Health Checks**: Configurados em todos os pods
376
+ - **Logs Centralizados**: Via GitLab CI/CD logs
377
+ - **Alertas**: Configuração via Kubernetes events
378
+ - **Dashboards**: Métricas de infraestrutura OCI
379
+
380
+ ## 🎯 **Próximos Passos da Arquitetura**
381
+
382
+ 1. **[Deploy Pipeline](Deploy-Pipeline)** - Processo detalhado de CI/CD
383
+ 2. **[Infraestrutura](Infraestrutura)** - Configurações Terraform e OCI
384
+ 3. **[Monitoramento](Monitoramento)** - Health checks e observabilidade
385
+ 4. **[Helm Migration Guide](Helm-Migration)** - Guia da migração futura
386
+
387
+ ## 📞 **Suporte Técnico**
388
+
389
+ - **Infraestrutura**: Equipe DevOps (ver [CODEOWNERS](https://gitlab.com/pipefy/wordpress/pipefy-website/-/blob/master/CODEOWNERS))
390
+ - **Kubernetes Issues**: [GitLab Issues - Label: infrastructure](https://gitlab.com/pipefy/wordpress/pipefy-website/-/issues?label_name=infrastructure)
391
+ - **Helm Planning**: [GitLab Issues - Label: helm-migration](https://gitlab.com/pipefy/wordpress/pipefy-website/-/issues?label_name=helm-migration)
392
+
393
+ ---
394
+
395
+ 📝 **Última atualização**: Junho 2025
396
+ 🏗️ **Arquitetura atual**: Kubernetes nativo
397
+ 🎯 **Próxima evolução**: Migração para Helm (Q3 2025)
398
+ ☁️ **Cloud Provider**: OCI (Oracle Cloud Infrastructure)
399
+ 🔄 **Pipeline**: GitLab CI/CD totalmente automatizado