Add new functions to library, publish in repo and build pacages
parent
c8b22a2298
commit
8b75e1371f
|
@ -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}/
|
||||
'''
|
||||
}
|
||||
}
|
|
@ -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
|
||||
"""
|
||||
}
|
Loading…
Reference in New Issue