Repository navigation
Deployment
Your Name edited this page Jul 11, 2026
·
2 revisions
# Build da imagem
docker build -t projeto-oms .
# Executar CI dentro do container
docker run --rm projeto-oms make ciImagem leve baseada em python:3.12-slim-bookworm com:
- dbt-core + dbt-duckdb
- Streamlit + Plotly
- Scripts de init e health check
flowchart LR
A[Dockerfile] -->|FROM python:3.12-slim| B[deps stage]
B -->|pip install| C[requirements.txt]
C -->|COPY| D[runtime stage]
D -->|CMD| E[make build]
flowchart LR
A[push / PR] --> B[Checkout]
B --> C[Setup Python 3.12]
C --> D[pip install]
D --> E[init_test_db]
E --> F[dbt deps]
F --> G[dbt build<br/>49 steps]
G --> H[health_check]
H --> I[reconciliation<br/>--ci 0.1%]
I --> J[data_contracts<br/>--ci]
J --> K[lineage_report<br/>--format json]
K --> L{Status}
L -->|pass| M[✅ CI verde]
L -->|fail| N[❌ GitHub email]
M --> O[⬆ Upload artifacts]
N --> O
-
pushparamain/master -
pull_requestparamain/master - Ignora:
**.md,.gitignore
Após o dbt build, o CI executa 3 gates de qualidade em sequência:
- health_check — existência dos bancos, integridade referencial, freshness
- reconciliation --ci — raw vs staging vs marts (volume, uniqueness, soma, tolerância 0.1%)
- data_contracts --ci — schema, tipos, nulabilidade, PK uniqueness
- lineage_report --format json — extração da linhagem do manifest.json
Se qualquer gate falhar:
- CI fica vermelho
- GitHub notifica por email com link para os logs
- Artefatos (compiled SQL, run_results) são preservados para diagnóstico
# Execução manual
bash scripts/scheduler.sh
# Crontab (diário às 8h)
0 8 * * * /path/to/scripts/scheduler.sh >> /path/to/logs/scheduler.log 2>&1pip install apache-airflow
export AIRFLOW_HOME=$(pwd)/airflow
mkdir -p $AIRFLOW_HOME/dags
ln -s $(pwd)/dags/oms_data_pipeline.py $AIRFLOW_HOME/dags/
airflow standaloneA DAG oms_data_pipeline executa em 3 tasks:
flowchart LR
A[check_raw_db] --> B[dbt_build]
B --> C[health_check]
| Comando | Descrição |
|---|---|
make setup |
Virtualenv + dependências + pacotes dbt |
make build |
dbt build (modelos + testes) |
make test |
dbt test (apenas testes) |
make run |
dbt run (apenas modelos) |
make ci |
CI completo (banco de teste + clean + build) |
make clean |
Limpa artefatos dbt e DuckDB |
make health |
Health check completo |
make contracts |
Validação de contratos de dados |
make reconcile |
Reconciliação cross-camada |
make lineage |
Relatório de linhagem |
make dashboard |
Streamlit Dashboard |
make schedule |
Pipeline agendado |
make shell |
DuckDB shell |