Add Jenkinsfile (#5)
testing/og-dhcp-API/pipeline/head There was a failure building this commit Details
ogdhcp/pipeline/head This commit looks good Details

Reviewed-on: #5
refs #1713
jenkins_upload_packages
Nicolas Arenas 2025-03-18 11:08:17 +01:00
parent 39a91ca9ab
commit 5389eba18c
2 changed files with 101 additions and 0 deletions

24
CHANGELOG.md 100644
View File

@ -0,0 +1,24 @@
# Changelog
## [0.6.0] - 2025-03-03
### Added
- Nuevos parámetros a la subred: `dns` y `subnetname`, añadiéndolos a la configuración de Kea.
### Fixed
- Error de permisos en el instalador.
- Bugs en la creación del home `/opt/opengnsys` del usuario `opengnsys`.
## [0.5.5] - 2025-02-06
### Fixed
- Bugs en la creación del home `/opt/opengnsys` del usuario `opengnsys`.
## [0.5.4] - 2025-02-06
### Changed
- Se cambia el home del usuario `opengnsys` a `/opt/opengnsys`.
## [0.5.3] - 2025-01-13
### Added
- Logs para todos los endpoints siguiendo un formato JSON preestablecido.
### Changed
- Se actualiza `monolog.yaml` para devolver logs al journal de la máquina.

View File

@ -0,0 +1,77 @@
@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}/ogdhcp"
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('Build') {
steps {
dir("${env.BUILD_DIR}") {
sh '''
dpkg-buildpackage -us -uc
mkdir -p ../artifacts && mv ../*.deb ../*.changes ../*.buildinfo ../artifacts/
ssh aptly@172.17.8.68 "rm -rf /var/tmp/opengnsys/debian-repo && mkdir -p /var/tmp/opengnsys/debian-repo"
scp -r ../artifacts/* aptly@172.17.8.68:/var/tmp/opengnsys/debian-repo/
'''
}
}
}
}
post {
always {
notifyBuildStatus('narenas@qindel.com')
}
}
}
// stage ('Publish to Debian Repository') {
// agent { label 'debian-repo' }
// steps {
// sh "aptly repo add opengnsys-devel /var/tmp/opengnsys/debian-repo/*.deb"
// }
// }