Updated jenkinsfile
ogrepository/pipeline/tag There was a failure building this commit Details

pull/37/head
Nicolas Arenas 2025-03-27 08:47:39 +01:00
parent 48d10b7cd9
commit 8af857c9ef
2 changed files with 8 additions and 17 deletions

View File

@ -51,13 +51,8 @@ pipeline {
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/ogrepository && mkdir -p /var/tmp/opengnsys/debian-repo/ogrepository"
scp -r ../artifacts/* aptly@172.17.8.68:/var/tmp/opengnsys/debian-repo/ogrepository
'''
script {
construirPaquete(env.BUILD_DIR, "../artifacts", "172.17.8.68", "/var/tmp/opengnsys/debian-repo/ogrepository")
}
}
}
@ -68,8 +63,10 @@ pipeline {
}
}
agent { label 'debian-repo' }
steps {
sh "aptly repo add opengnsys-devel /var/tmp/opengnsys/debian-repo/ogrepository/*.deb"
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/ogrepository', 'opengnsys-devel', versionPattern)
}
}
}

View File

@ -2,19 +2,13 @@
set -e
NGINX_FILE="/etc/nginx/sites-enabled/oggui.conf"
UNIT_FILE="/etc/systemd/system/oggui.service"
UNIT_FILE="/etc/systemd/system/ogrepo-api.service"
case "$1" in
remove)
echo "El paquete se está desinstalando..."
# Aquí puedes hacer limpieza de archivos o servicios
if [ -L "$NGINX_FILE" ]; then
rm -f "$NGINX_FILE"
systemctl restart nginx
fi
if [ -L "$UNIT_FILE" ]; then
rm -f "$UNIT_FILE"
systemctl daemon-reload