Nettoyage
Cadoles/Jenkins/pipeline/head There was a failure building this commit
Details
Cadoles/Jenkins/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
b7c0f4e2ab
commit
331ba5fd6b
|
@ -123,7 +123,7 @@ pipeline {
|
||||||
// On liste l'ensemble des paquets construits
|
// On liste l'ensemble des paquets construits
|
||||||
def publishedPackages = result.packages.collect { p ->
|
def publishedPackages = result.packages.collect { p ->
|
||||||
def file = new File(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
|
// On notifie le canal Rocket.Chat de la publication des paquets
|
||||||
|
@ -158,7 +158,7 @@ pipeline {
|
||||||
// Pour chaque paquets construits...
|
// Pour chaque paquets construits...
|
||||||
result.packages.each { p ->
|
result.packages.each { p ->
|
||||||
def packageFullName = new File(p).getName()
|
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 packageNameParts = packageFullName.split('_')
|
||||||
def packageName = packageNameParts[0]
|
def packageName = packageNameParts[0]
|
||||||
def packageVersion = packageNameParts[1]
|
def packageVersion = packageNameParts[1]
|
||||||
|
|
|
@ -7,11 +7,8 @@ def exportPackages(
|
||||||
) {
|
) {
|
||||||
def exportTasks = []
|
def exportTasks = []
|
||||||
packages.each {
|
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}"
|
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
|
def jsonResponse = readJSON text: response.content
|
||||||
println(jsonResponse)
|
|
||||||
exportTasks << jsonResponse['task']
|
exportTasks << jsonResponse['task']
|
||||||
}
|
}
|
||||||
return exportTasks
|
return exportTasks
|
||||||
|
@ -40,7 +37,6 @@ def getRepositoryHREF(
|
||||||
'stable': 'Cadoles4MSE stable']
|
'stable': 'Cadoles4MSE stable']
|
||||||
def response = httpRequest authentication: credentials, url: "https://${pulpHost}/pulp/api/v3/repositories/deb/apt/", httpMode: 'GET', ignoreSslErrors: true
|
def response = httpRequest authentication: credentials, url: "https://${pulpHost}/pulp/api/v3/repositories/deb/apt/", httpMode: 'GET', ignoreSslErrors: true
|
||||||
def jsonResponse = readJSON text: response.content
|
def jsonResponse = readJSON text: response.content
|
||||||
println(jsonResponse)
|
|
||||||
def repositories = jsonResponse.results
|
def repositories = jsonResponse.results
|
||||||
def repositoryHREF = repositories.find { it -> it['name'] == repositoriesMapping[repositoryLevel] }
|
def repositoryHREF = repositories.find { it -> it['name'] == repositoriesMapping[repositoryLevel] }
|
||||||
if (repositoryHREF) {
|
if (repositoryHREF) {
|
||||||
|
@ -71,7 +67,6 @@ def publishRepository(
|
||||||
def postBody = JsonOutput.toJson(["repository": repositoryHREF, "simple": true])
|
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 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
|
def jsonResponse = readJSON text: response.content
|
||||||
println(jsonResponse)
|
|
||||||
return waitForTaskCompletion(credentials, jsonResponse.task)
|
return waitForTaskCompletion(credentials, jsonResponse.task)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue