Add new functions to library, publish in repo and build pacages

main
Nicolas Arenas 2025-03-27 08:34:46 +01:00
parent c8b22a2298
commit 8b75e1371f
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,10 @@
def call(String buildDir, String artifactsDir, String remoteHost, String remotePath) {
dir(buildDir) {
sh '''
dpkg-buildpackage -us -uc
mkdir -p ${artifactsDir} && mv ../*.deb ../*.changes ../*.buildinfo ${artifactsDir}/
ssh aptly@${remoteHost} "rm -rf ${remotePath}/* && mkdir -p ${remotePath}"
scp -r ${artifactsDir}/* aptly@${remoteHost}:${remotePath}/
'''
}
}

View File

@ -0,0 +1,15 @@
def call(String repoPath, String repoName, String versionPattern) {
// Construir el patrón de versión esperado en el nombre del paquete
def packagePattern = "*${versionPattern}*.deb"
// Buscar y añadir al repositorio los paquetes que coincidan con el patrón
sh """
for deb in ${repoPath}/${packagePattern}; do
if [ -f "\$deb" ]; then
aptly repo add ${repoName} "\$deb"
else
echo "No se encontraron paquetes .deb para la versión ${versionPattern}."
fi
done
"""
}