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:
@ -28,21 +28,17 @@ def createRepository(
|
||||
}
|
||||
def getRepositoryHREF(
|
||||
String credentials,
|
||||
String repositoryLevel = 'dev',
|
||||
String repository = 'Cadoles4MSE unstable',
|
||||
String pulpHost = '192.168.30.3'
|
||||
) {
|
||||
def repositoriesMapping = ['unstable': 'Cadoles4MSE unstable',
|
||||
'dev': 'Cadoles4MSE dev',
|
||||
'staging': 'Cadoles4MSE staging',
|
||||
'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
|
||||
def repositories = jsonResponse.results
|
||||
def repositoryHREF = repositories.find { it -> it['name'] == repositoriesMapping[repositoryLevel] }
|
||||
def repositoryHREF = repositories.find { it -> it['name'] == repository }
|
||||
if (repositoryHREF) {
|
||||
return repositoryHREF.pulp_href
|
||||
} else {
|
||||
return createRepository(credentials, repositoriesMapping[repositoryLevel])
|
||||
return createRepository(credentials, repository])
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user