debian packaging: wait for package availability before sending

Rocket.Chat notification
This commit is contained in:
wpetit 2020-05-06 10:22:06 +02:00
parent c76ca6cd5c
commit ea7f44f0f1
1 changed files with 28 additions and 0 deletions

View File

@ -110,6 +110,10 @@ pipeline {
env.packageBranch
)
}
// On attend que les paquets soient disponibles
// sur Vulcain pour envoyer la notification de diffusion
waitForPackages(env.ref, result)
// On liste l'ensemble des paquets construits
def publishedPackages = result.collect { r ->
@ -194,4 +198,28 @@ def findMatchingVMTemplate(String distrib) {
'eole-2.6.2': 'eolebase-2.6.2-cadoles'
]
return vmTemplatesMap.get(distrib, null)
}
def waitForPackages(String tagRef, buildResults) {
def packageVersion = tagRef.split('/')[3];
buildResults.each { r ->
def distrib = "${r.distrib.split('-')[1]}-${r.env}"
r.packages.each { p ->
def file = new File(p)
def fileNameParts = file.getName().take(file.getName().lastIndexOf('.')).split('_')
def packageName = fileNameParts[0]
def packageArch = fileNameParts[2]
debian.waitForRepoPackage(packageName, [
baseURL: 'https://vulcain.cadoles.com',
distrib: distrib,
component: 'main',
type: 'binary',
arch: packageArch,
expectedVersion: packageVersion
])
}
}
}