docs: update MFE pipeline status and OCI documentation

This commit is contained in:
Tiago Ribeiro 2026-02-18 19:09:51 -03:00
parent ff4de5d455
commit 8ef729692d
3 changed files with 133 additions and 50 deletions

View file

@ -4,6 +4,79 @@ Este documento contém os tokens e APIs necessárias para gerenciar a infraestru
## Tokens ## Tokens
### Azure DevOps
- **Arquivo**: `~/.ssh/azure_devops_auth.json`
- **Organization**: CN-Squad
- **Project**: Invista FIDC - Nexus
- **PAT**: Token de acesso pessoal para API Azure DevOps
#### Azure DevOps API
```bash
# Configurar PAT
export AZDO_PAT=$(cat ~/.ssh/azure_devops_auth.json | jq -r '.pat')
export AZDO_ORG="CN-Squad"
export AZDO_PROJECT="Invista FIDC - Nexus"
# Listar builds
curl -s -u ":$AZDO_PAT" "https://dev.azure.com/$AZDO_ORG/$AZDO_PROJECT/_apis/build/builds?api-version=7.0" | jq '.value[] | {id, buildNumber, result, status}'
# Ver logs de um build (substituir BUILD_ID e LOG_ID)
curl -s -u ":$AZDO_PAT" "https://dev.azure.com/$AZDO_ORG/_apis/build/builds/BUILD_ID/logs/LOG_ID"
# Obter timeline do build
curl -s -u ":$AZDO_PAT" "https://dev.azure.com/$AZDO_ORG/_apis/build/builds/BUILD_ID/timeline"
# Listar variable groups
curl -s -u ":$AZDO_PAT" "https://dev.azure.com/$AZDO_ORG/$AZDO_PROJECT/_apis/distributedtask/variablegroups?api-version=7.0"
# Triggerar build
curl -s -X POST -u ":$AZDO_PAT" \
-H "Content-Type: application/json" \
"https://dev.azure.com/$AZDO_ORG/$AZDO_PROJECT/_apis/build/builds?api-version=7.0" \
-d '{"definition": {"id": 37}, "sourceBranch": "refs/heads/devops"}'
```
### OCI (Oracle Cloud Infrastructure)
- **Arquivo**: `~/.ssh/azure_devops_auth.json` (mesmo arquivo, contém PAT)
- **Region**: `sa-saopaulo-1`
- **Namespace**: `grbb7qzeuoag`
- **Variable Group**: `oci-terraform`
#### Compartimentos OCI
| Ambiente | Compartment OCID |
|----------|------------------|
| Dev | `ocid1.compartment.oc1..aaaaaaaa76x3nykkjwvctpr6px34dysu3pbg7p62h2r65fegt7fvbrioll3a` |
| HML | `ocid1.compartment.oc1..aaaaaaaawc3hj6isbiibbiuokijw7le72ga3qa3qyblsdhrkj5gdygskzmwq` |
| PROD | `ocid1.compartment.oc1..aaaaaaaazjxk5dkwleol3hjq7huojevotvnjhvy5ngro4jtwcqx2fn2ujara` |
#### OCI CLI (local)
```bash
# Verificar namespace
oci os ns get
# Listar buckets (dev)
oci os bucket list --compartment-id "ocid1.compartment.oc1..aaaaaaaa76x3nykkjwvctpr6px34dysu3pbg7p62h2r65fegt7fvbrioll3a"
# Listar objetos no bucket
oci os object list --namespace-name "grbb7qzeuoag" --bucket-name "mfe-user-dev"
# Criar bucket
oci os bucket create \
--namespace-name "grbb7qzeuoag" \
--name "mfe-nome-dev" \
--compartment-id "ocid1.compartment.oc1..aaaaaaaa76x3nykkjwvctpr6px34dysu3pbg7p62h2r65fegt7fvbrioll3a"
# Upload arquivo
oci os object put \
--namespace-name "grbb7qzeuoag" \
--bucket-name "mfe-user-dev" \
--file ./dist/browser/index.html \
--name "index.html"
```
### Cloudflare ### Cloudflare
- **Arquivo**: `~/.ssh/cloudflare-token` - **Arquivo**: `~/.ssh/cloudflare-token`
- **Email**: yamamoto@rede5.com.br - **Email**: yamamoto@rede5.com.br

View file

@ -9,15 +9,21 @@ Este guia mostra como fazer o deploy do **mfe-user** (Micro Frontend) para a OCI
--- ---
## Estado Atual da Infraestrutura ## Estado Atual da Infraestrutura (18/02/2026)
| Recurso | Status | Ação Necessária | | Recurso | Status | Ação Necessária |
|---------|--------|-----------------| |---------|--------|-----------------|
| VCN (Dev) | ✅ Existe | Nenhuma | | VCN (Dev) | ✅ Existe | Nenhuma |
| Subnet (sbn-lb-1) | ✅ Existe | Nenhuma | | Subnet (sbn-lb-1) | ✅ Existe | Nenhuma |
| API Gateway | ❌ Não existe | Pipeline cria | | API Gateway | ⏸️ Pausado | Não será usado por enquanto |
| Bucket | ❌ Não existe | Pipeline cria | | Bucket mfe-user-dev | ✅ Criado | Pipeline cria automaticamente |
| PAR | ❌ Não existe | Pipeline cria | | PAR mfe-user-dev | ✅ Criado | Pipeline cria automaticamente |
### Buckets OCI Criados
| Bucket | Ambiente | MFE | Status |
|--------|----------|-----|--------|
| mfe-user-dev | Dev | mfe-user | ✅ Criado e funcionando |
--- ---
@ -64,21 +70,17 @@ A pipeline cria automaticamente:
┌─────────────┐ ┌─────────────┐
│ UPLOAD │ → Upload para OCI Object Storage │ UPLOAD │ → Upload para OCI Object Storage
│ (OCI) │ Bucket: mfe-user-dev │ (OCI) │ Bucket: mfe-<nome>-dev
└─────────────┘ └─────────────┘
┌─────────────┐ ┌─────────────┐
│ CREATEPAR │ → Cria Pre-Authenticated Request │ CREATEPAR │ → Cria Pre-Authenticated Request
└─────────────┘
┌─────────────┐
│ DEPLOY API │ → Cria/Atualiza API Gateway
│ GATEWAY │ Gateway: mfe-user-gateway
└─────────────┘ └─────────────┘
``` ```
**Nota**: O estágio DeployToAPIGateway foi removido. Não haverá atividade do API Gateway por enquanto.
--- ---
## Passo 3: Obter URL do API Gateway ## Passo 3: Obter URL do API Gateway

86
OCI.md
View file

@ -112,54 +112,62 @@ oci os bucket list --compartment-id "ocid1.compartment.oc1..aaaaaaaazjxk5dkwleol
## MFEs - Micro Frontends ## MFEs - Micro Frontends
### Repositórios MFE ### Status dos MFEs (18/02/2026)
| Repositório | Branch Principal | Pipeline OCI | | Repositório | Branch Pipeline | Pipeline OCI | Bucket | Status |
|-------------|------------------|--------------| |-------------|-----------------|--------------|--------|--------|
| mfe-auth | dev/devops | ❌ Não | | mfe-user | devops | ✅ `azure-pipelines.yml` | mfe-user-dev | ✅ Funcionando |
| mfe-shell | dev/devops | ❌ Não | | mfe-auth | devops | ✅ `azure-pipelines-oci.yml` | mfe-auth-dev | 🔄 Pipeline criada |
| mfe-person | dev/devops | ❌ Não | | mfe-person | devops | ✅ `azure-pipelines-oci.yml` | mfe-person-dev | 🔄 Pipeline criada |
| mfe-poc | dev/devops | ❌ Não | | mfe-shell | devops | ✅ `azure-pipelines-oci.yml` | mfe-shell-dev | 🔄 Pipeline criada |
| mfe-user | devops | ✅ Sim (unificado AWS+OCI) | | mfe-poc | devops | ✅ `azure-pipelines-oci.yml` | mfe-poc-dev | 🔄 Pipeline criada |
| mfe-formalization | dev | ❌ Sem pipeline | | mfe-formalization | devops | ✅ `azure-pipelines-oci.yml` | mfe-formalization-dev | 🔄 Pipeline criada |
### Pipeline OCI - mfe-user ### Pipeline OCI - Estrutura
**Arquivo**: `C:\dev\mfe-user\azure-pipelines.yml` (unificado com AWS) Todos os MFEs seguem o mesmo padrão de pipeline:
**Trigger**: Branch `devops` ```
┌─────────────┐
│ BUILD │ → npm ci + npm run build:dev
└─────────────┘
┌─────────────┐
│ UPLOADTO │ → Upload para OCI Object Storage
│ OCI │ Bucket: mfe-<nome>-dev
└─────────────┘
┌─────────────┐
│ CREATEPAR │ → Cria Pre-Authenticated Request
└─────────────┘
```
**Parametro**: `cloudProvider` (default: `oci`) ### Arquivos de Pipeline
**Estágios**: | MFE | Arquivo | Branch |
1. **Build** - Compila o projeto Angular |-----|---------|--------|
2. **UploadToOCI** - Faz upload para OCI Object Storage (bucket: `mfe-user-dev`) | mfe-user | `azure-pipelines.yml` (unificado AWS+OCI) | devops |
3. **CreatePAR** - Cria Pre-Authenticated Request (PAR) | mfe-auth | `azure-pipelines-oci.yml` | devops |
4. **DeployToAPIGateway** - Faz deploy no OCI API Gateway | mfe-person | `azure-pipelines-oci.yml` | devops |
| mfe-shell | `azure-pipelines-oci.yml` | devops |
| mfe-poc | `azure-pipelines-oci.yml` | devops |
| mfe-formalization | `azure-pipelines-oci.yml` | devops |
**Variable Groups Required**: ### Variable Groups Necessários
- `oci-terraform`
- `mfe-credentials`
**Bucket**: `mfe-user-dev` | Variable Group | Variáveis |
|----------------|-----------|
| `oci-terraform` | `OCI_TENANCY_OCID`, `OCI_USER_OCID`, `OCI_FINGERPRINT`, `OCI_PRIVATE_KEY_B64`, `OCI_REGION`, `TF_VAR_compartment_parent_ocid` |
| `mfe-credentials` | `CLOUDFLARE_ZONE_ID`, `CLOUDFLARE_API_TOKEN` |
| `aws-credentials-dev` | Credenciais AWS (para pipeline unificada) |
**API Gateway**: ### Commits Recentes (mfe-user)
- Nome: `mfe-user-gateway` - `19dced5` (18/02/2026) - chore: remove DeployToAPIGateway stage from pipeline
- Deployment: `mfe-user-deployment` - `9948430` (18/02/2026) - fix: use correct variable name TF_VAR_compartment_parent_ocid
- `6836035` (18/02/2026) - fix: improve bucket creation error handling
**Commits Recentes**: - `fd780bd` (18/02/2026) - fix: correct OCI CLI commands for namespace
- `50ad18c` (18/02/2026) - feat: set OCI as default cloudProvider
- `b99aa07` (18/02/2026) - feat: unify OCI pipeline into azure-pipelines.yml
### Pipeline AWS (Padrão) - mfe-user
**Arquivo**: `C:\dev\C:devrepos_mfe\mfe-user\azure-pipelines.yml`
**Trigger**: Branch `dev`
**Template**: `mfe/deploy-mfe.yaml@templates`
**Deploy**: S3/AWS (não OCI)
## MS-POC - Microservice POC ## MS-POC - Microservice POC