Nettoyage
Some checks failed
Cadoles/Jenkins/pipeline/head There was a failure building this commit

This commit is contained in:
Benjamin Bohard 2022-02-09 21:21:10 +01:00
parent b7c0f4e2ab
commit 331ba5fd6b
2 changed files with 2 additions and 7 deletions

4
Jenkinsfile vendored
View File

@ -123,7 +123,7 @@ pipeline {
// On liste l'ensemble des paquets construits
def publishedPackages = result.packages.collect { p ->
def file = new File(p)
return "- Paquet `${file.getName()}`, Dépôt `${r.env}`, Distribution `${r.distrib}`"
return "- Paquet `${file.getName()}`, Dépôt `${result.env}`, Distribution `${result.distrib}`"
}
// On notifie le canal Rocket.Chat de la publication des paquets
@ -158,7 +158,7 @@ pipeline {
// Pour chaque paquets construits...
result.packages.each { p ->
def packageFullName = new File(p).getName()
def packageRepository = result.distrib.split('-')[1] + '-' + r.env
def packageRepository = result.distrib.split('-')[1] + '-' + result.env
def packageNameParts = packageFullName.split('_')
def packageName = packageNameParts[0]
def packageVersion = packageNameParts[1]

View File

@ -7,11 +7,8 @@ def exportPackages(
) {
def exportTasks = []
packages.each {
println(it)
def response = httpRequest authentication: credentials, url: "https://${pulpHost}/pulp/api/v3/content/deb/packages/", httpMode: 'POST', ignoreSslErrors: true, multipartName: "file", timeout: 900, uploadFile: "${it}"
println(response)
def jsonResponse = readJSON text: response.content
println(jsonResponse)
exportTasks << jsonResponse['task']
}
return exportTasks
@ -40,7 +37,6 @@ def getRepositoryHREF(
'stable': 'Cadoles4MSE stable']
def response = httpRequest authentication: credentials, url: "https://${pulpHost}/pulp/api/v3/repositories/deb/apt/", httpMode: 'GET', ignoreSslErrors: true
def jsonResponse = readJSON text: response.content
println(jsonResponse)
def repositories = jsonResponse.results
def repositoryHREF = repositories.find { it -> it['name'] == repositoriesMapping[repositoryLevel] }
if (repositoryHREF) {
@ -71,7 +67,6 @@ def publishRepository(
def postBody = JsonOutput.toJson(["repository": repositoryHREF, "simple": true])
def response = httpRequest authentication: credentials, url: "https://${pulpHost}/pulp/api/v3/publications/deb/apt/", httpMode: 'POST', requestBody: postBody, contentType: 'APPLICATION_JSON', ignoreSslErrors: true
def jsonResponse = readJSON text: response.content
println(jsonResponse)
return waitForTaskCompletion(credentials, jsonResponse.task)
}