Distribution inconditionnelle
Some checks failed
Cadoles/Jenkins/pipeline/head There was a failure building this commit
Some checks failed
Cadoles/Jenkins/pipeline/head There was a failure building this commit
This commit is contained in:
18
Jenkinsfile
vendored
18
Jenkinsfile
vendored
@ -103,8 +103,12 @@ pipeline {
|
||||
)
|
||||
|
||||
// On publie chacun des paquets construits
|
||||
def repositoriesMapping = ['unstable': 'Cadoles4MSE unstable',
|
||||
'dev': 'Cadoles4MSE dev',
|
||||
'staging': 'Cadoles4MSE staging',
|
||||
'stable': 'Cadoles4MSE stable']
|
||||
def credentials = '212d6dc7-f9a2-4d27-94d8-de7fc6cae0a1'
|
||||
def repositoryHREF = pulp.getRepositoryHREF(credentials, result.env)
|
||||
def repositoryHREF = pulp.getRepositoryHREF(credentials, repositoriesMapping[result.env])
|
||||
def exportTasks = pulp.exportPackages(credentials, result.packages)
|
||||
def pulpPackages = []
|
||||
exportTasks.each {
|
||||
@ -114,16 +118,16 @@ pipeline {
|
||||
}
|
||||
}
|
||||
pulp.addToRepository(credentials, pulpPackages, repositoryHREF)
|
||||
if (result.env == 'dev') {
|
||||
def publicationHREF = pulp.publishRepository(credentials, repositoryHREF)
|
||||
def distributionHREF = pulp.distributePublication(credentials, publicationHREF[0], 'Cadoles4MSE_dev', 'Cadoles4MSE_dev')
|
||||
println(pulp.getDistributionURL(credentials, distributionHREF[0]))
|
||||
}
|
||||
def publicationHREF = pulp.publishRepository(credentials, repositoryHREF)
|
||||
def distributionName = repositoriesMapping[result.env]
|
||||
def base_path = distributionName.replaceAll(' ', '_')
|
||||
def distributionHREF = pulp.distributePublication(credentials, publicationHREF[0], distributionName, base_path)
|
||||
def distributionURL = pulp.getDistributionURL(credentials, distributionHREF[0]))
|
||||
|
||||
// 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 `${result.env}`, Distribution `${result.distrib}`"
|
||||
return "- Paquet `${file.getName()}`, Dépôt `${result.env}`, Distribution `${result.distrib}`, URL `${distributionURL}`"
|
||||
}
|
||||
|
||||
// On notifie le canal Rocket.Chat de la publication des paquets
|
||||
|
Reference in New Issue
Block a user