add jenkins pipeline

This commit is contained in:
2026-04-07 08:22:32 +01:00
parent 214a189a5f
commit 56c59634b2
12 changed files with 408 additions and 326 deletions
@@ -0,0 +1,35 @@
---
id: LSN-0020
discussion: DSC-0019
title: Lesson - Jenkins CI Standardization and Relocation
status: done
created: 2026-04-07
resolved:
tags: ["ci", "jenkins", "devops"]
---
# Lesson - Jenkins CI Standardization and Relocation
## Context
The project had a `Jenkinsfile` stored in a non-standard location (`files/config/Jenkinsfile`) with outdated configurations and divergent build commands compared to the project's `Makefile` and GitHub Actions.
## Problem
- **Discoverability**: Configuration files in unexpected directories increase the mental load for new contributors.
- **Divergence**: Maintenance becomes harder when the same logic (how to build/test the project) is duplicated in multiple places with different flags.
## Solution
The `Jenkinsfile` was moved to the project root, following standard Jenkins conventions. Its content was updated to delegate the actual work to the `Makefile` (command `make ci`).
## Key Takeaways
1. **Standardize over Innovate**: Unless there's a strong technical reason, keep infrastructure files in their canonical locations (e.g., `Jenkinsfile` at root).
2. **Centralize Build Logic**: Use a `Makefile` or similar tool to define the canonical way to build and test the project. CI pipelines should merely invoke these commands. This ensures that CI behavior can be reproduced locally by any developer.
3. **Environment Parity**: By using the same Docker image and commands across different CI providers (Jenkins and GitHub Actions), we reduce "it works on my CI" issues.
## References
- [DEC-0002: Jenkinsfile Location and Strategy](../../workflow/decisions/DEC-0002-jenkinsfile-strategy.md)
- [Makefile](../../Makefile)
@@ -0,0 +1,31 @@
---
id: LSN-0021
discussion: DSC-0020
title: Lesson - Jenkins Gitea Integration and Non-Standard Path
status: done
created: 2026-04-07
---
# Lesson - Jenkins Gitea Integration and Non-Standard Path
## Contexto
A integração de CI foi alterada para suportar o Gitea como servidor de repositórios e o Jenkins como executor, mantendo uma localização específica para o `Jenkinsfile` solicitada pelo usuário.
## O Que Foi Feito
1. **Localização**: O `Jenkinsfile` foi consolidado em `files/config/Jenkinsfile`.
2. **Notificação Gitea**: Adicionado suporte ao comando `giteaStatus` no pipeline do Jenkins para fornecer feedback visual diretamente nos commits e PRs do Gitea.
3. **Limpeza**: Removidas configurações de GitHub Actions.
## Como Pensar Sobre o Modelo
- **Localização**: Embora o padrão seja manter o `Jenkinsfile` na raiz, o Jenkins permite configurar o caminho do script. Nesses casos, a flexibilidade do Jenkins deve ser usada para atender requisitos de organização de arquivos do projeto.
- **Integração de Status**: A sincronização de status entre Jenkins e Git (Gitea neste caso) é fundamental para a experiência de desenvolvimento (DX), permitindo que desenvolvedores vejam o resultado do CI sem sair da interface do Gitea.
- **Centralização em Makefile**: Manter a lógica de CI no `Makefile` (`make ci`) permite que o `Jenkinsfile` seja apenas um orquestrador de chamadas de status e execução de containers, facilitando a migração ou depuração local.
## Referencias
- DEC-0003
- AGD-0018
- PLN-0003