Set up for build with Jenkins

pull/3/head
Nicolas Arenas 2025-08-25 12:58:00 +02:00
parent bf7dfcd9ce
commit c4d452be42
3 changed files with 165 additions and 0 deletions

52
.gitignore vendored Normal file
View File

@ -0,0 +1,52 @@
# Archivos generados por el empaquetado Debian
*.deb
*.build
*.buildinfo
*.changes
*.dsc
*.tar.gz
*.orig.tar.*
*.substvars
.debhelper/
debian/files
debian/*.debhelper.log
debian/tmp/
debian/*/
debian/oglog/*
# Archivos de quilt (parches en source format 3.0)
patches/
.series
# Directorios comunes de compilación
build/
dist/
# Archivos de Python que no deben subirse
__pycache__/
*.pyc
*.pyo
*.pyd
*.egg-info/
# Archivos de backup / edición
*~
*.swp
*.bak
*.log
# Archivos y carpetas de IDEs / entornos
.vscode/
.idea/
*.code-workspace
# Archivos de control de versiones
*.orig
*.rej
# Carpetas de control de Git (si copias desde otro repositorio)
.git/
# Archivos de MacOS y Windows
.DS_Store
Thumbs.db

9
CHANGELOG.md Normal file
View File

@ -0,0 +1,9 @@
# Changelog
## [0.1.0] - 2025-08-25
### Added
- Initial components: Opensearch, Grafana, Prometheus, journal-remote, filebeat, journalbeat.
- Initial Dashboards Created: Estado_actual_de_los_clientes.json filebeat-clients.json Node_Exporter.json ogboot-logs.json ogcore-logs.json ogdhcp-logs.json ogrepo-logs.json Peticiones_nginx.json Traceo_y_comandos.json Uso_de_IPs_de_subred.json
- Datasources Configured in Grafana: Opensearch, Mysql, Prometheus.
- Pipelines configured in Opensearch: master_pipeline , filter_tftp_pipeline, filter_ogboot_pipeline, filter_ogdhcp_pipeline, kea_dhcp_pipeline, ogrepo_pipeline, docker_logs_pipeline, json_parse_pipeline, parse_nginx_logs, filebeat_opengnsys_pipeline
- Debian packaging.

104
Jenkins/Jenkinsfile-deb-pkg Normal file
View File

@ -0,0 +1,104 @@
@Library('jenkins-shared-library') _
pipeline {
agent {
label 'jenkins-slave'
}
environment {
DEBIAN_FRONTEND = 'noninteractive'
DEFAULT_DEV_NAME = 'Opengnsys Team'
DEFAULT_DEV_EMAIL = 'opengnsys@qindel.com'
}
options {
skipDefaultCheckout()
}
parameters {
string(name: 'DEV_NAME', defaultValue: '', description: 'Nombre del desarrollador')
string(name: 'DEV_EMAIL', defaultValue: '', description: 'Email del desarrollador')
}
stages {
stage('Prepare Workspace') {
steps {
script {
env.BUILD_DIR = "${WORKSPACE}/oglog"
sh "mkdir -p ${env.BUILD_DIR}"
}
}
}
stage('Checkout') {
steps {
dir("${env.BUILD_DIR}") {
checkout scm
}
}
}
stage('Generate Changelog') {
when {
expression {
return env.TAG_NAME != null
}
}
steps {
script {
def devName = params.DEV_NAME ? params.DEV_NAME : env.DEFAULT_DEV_NAME
def devEmail = params.DEV_EMAIL ? params.DEV_EMAIL : env.DEFAULT_DEV_EMAIL
generateDebianChangelog(env.BUILD_DIR, devName, devEmail)
}
}
}
stage('Generate Changelog (Nightly)'){
when {
branch 'main'
}
steps {
script {
def devName = params.DEV_NAME ? params.DEV_NAME : env.DEFAULT_DEV_NAME
def devEmail = params.DEV_EMAIL ? params.DEV_EMAIL : env.DEFAULT_DEV_EMAIL
generateDebianChangelog(env.BUILD_DIR, devName, devEmail,'nightly')
}
}
}
stage('Build') {
steps {
script {
construirPaquete(env.BUILD_DIR, "../artifacts", "172.17.8.68", "/var/tmp/opengnsys/debian-repo/oglog")
}
}
}
stage ('Publish to Debian Repository') {
when {
expression {
return env.TAG_NAME != null
}
}
agent { label 'debian-repo' }
steps {
script {
// Construir el patrón de versión esperado en el nombre del paquete
def versionPattern = "${env.TAG_NAME}-${env.BUILD_NUMBER}"
publicarEnAptly('/var/tmp/opengnsys/debian-repo/oglog', 'opengnsys-devel', versionPattern)
}
}
}
stage ('Publish to Debian Repository (Nightly)') {
when {
branch 'main'
}
agent { label 'debian-repo' }
steps {
script {
// Construir el patrón de versión esperado en el nombre del paquete
def versionPattern = "-${env.BUILD_NUMBER}~nightly"
publicarEnAptly('/var/tmp/opengnsys/debian-repo/oglog', 'nightly', versionPattern)
}
}
}
}
post {
always {
notifyBuildStatus('opengnsys@qindel.com')
}
}
}