Automatiser la création des ressources en fonction du tag
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:
19
Jenkinsfile
vendored
19
Jenkinsfile
vendored
@ -103,12 +103,15 @@ pipeline {
|
||||
)
|
||||
|
||||
// On publie chacun des paquets construits
|
||||
def repositoriesMapping = ['unstable': 'Cadoles4MSE unstable',
|
||||
'dev': 'Cadoles4MSE dev',
|
||||
'staging': 'Cadoles4MSE staging',
|
||||
'stable': 'Cadoles4MSE stable']
|
||||
def splittedTag = env.ref.split('/')
|
||||
def repositoryName = "${splittedTag[2]} ${splittedTag[1]}"
|
||||
def distributionName = repositoryName
|
||||
def basePath = repositoryName.replace(' ', '-')
|
||||
def product = splittedTag[2].split('-')[0]
|
||||
def contentGuardMapping = ['mse': 'mse_contentguard']
|
||||
def signingServiceMapping = ['mse': 'sign_deb_release']
|
||||
def credentials = '212d6dc7-f9a2-4d27-94d8-de7fc6cae0a1'
|
||||
def repositoryHREF = pulp.getRepositoryHREF(credentials, repositoriesMapping[result.env])
|
||||
def repositoryHREF = pulp.getRepositoryHREF(credentials, repositoryName)
|
||||
def exportTasks = pulp.exportPackages(credentials, result.packages)
|
||||
def pulpPackages = []
|
||||
exportTasks.each {
|
||||
@ -118,10 +121,8 @@ pipeline {
|
||||
}
|
||||
}
|
||||
pulp.addToRepository(credentials, pulpPackages, repositoryHREF)
|
||||
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 publicationHREF = pulp.publishRepository(credentials, repositoryHREF, signingServiceMapping.get(product))
|
||||
def distributionHREF = pulp.distributePublication(credentials, publicationHREF[0], distributionName, base_path, contentGuardMapping.get(product))
|
||||
def distributionURL = pulp.getDistributionURL(credentials, distributionHREF[0])
|
||||
|
||||
// On liste l'ensemble des paquets construits
|
||||
|
Reference in New Issue
Block a user