Changement de serveur pulp
Cadoles/Jenkins/pipeline/head There was a failure building this commit Details

This commit is contained in:
Benjamin Bohard 2022-02-08 09:28:59 +01:00
parent f16e377911
commit 63c7b0b3a5
1 changed files with 7 additions and 7 deletions

View File

@ -3,7 +3,7 @@ import groovy.json.JsonOutput
def exportPackages( def exportPackages(
String credentials, String credentials,
List packages = [], List packages = [],
String pulpHost = 'pulp.bbohard.lan' String pulpHost = '192.168.30.3'
) { ) {
def exportTasks = [] def exportTasks = []
packages.each { packages.each {
@ -18,7 +18,7 @@ def exportPackages(
def getRepositoryHREF( def getRepositoryHREF(
String credentials, String credentials,
String repositoryLevel = 'dev', String repositoryLevel = 'dev',
String pulpHost = 'pulp.bbohard.lan' String pulpHost = '192.168.30.3'
) { ) {
def repositoriesMapping = ['dev': 'Cadoles4MSE'] def repositoriesMapping = ['dev': 'Cadoles4MSE']
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
@ -33,7 +33,7 @@ def addToRepository(
String credentials, String credentials,
List packagesHREF, List packagesHREF,
String repositoryHREF, String repositoryHREF,
String pulpHost = 'pulp.bbohard.lan' String pulpHost = '192.168.30.3'
) { ) {
def packagesHREFURL = ["add_content_units": packagesHREF.collect { "https://$pulpHost$it" }] def packagesHREFURL = ["add_content_units": packagesHREF.collect { "https://$pulpHost$it" }]
def postBody = JsonOutput.toJson(packagesHREFURL) def postBody = JsonOutput.toJson(packagesHREFURL)
@ -45,7 +45,7 @@ def addToRepository(
def publishRepository( def publishRepository(
String credentials, String credentials,
String repositoryHREF, String repositoryHREF,
String pulpHost = 'pulp.bbohard.lan' String pulpHost = '192.168.30.3'
) { ) {
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
@ -59,7 +59,7 @@ def distributePublication(
String publicationHREF, String publicationHREF,
String distributionName, String distributionName,
String basePath, String basePath,
String pulpHost = 'pulp.bbohard.lan', String pulpHost = '192.168.30.3',
String contentGuard = null String contentGuard = null
) { ) {
def response = httpRequest authentication: credentials, url: "https://${pulpHost}/pulp/api/v3/distributions/deb/apt/", httpMode: 'GET', ignoreSslErrors: true def response = httpRequest authentication: credentials, url: "https://${pulpHost}/pulp/api/v3/distributions/deb/apt/", httpMode: 'GET', ignoreSslErrors: true
@ -89,7 +89,7 @@ def distributePublication(
def waitForTaskCompletion( def waitForTaskCompletion(
String credentials, String credentials,
String taskHREF, String taskHREF,
String pulpHost = 'pulp.bbohard.lan' String pulpHost = '192.168.30.3'
) { ) {
def status = '' def status = ''
def created_resources = [] def created_resources = []
@ -108,7 +108,7 @@ def waitForTaskCompletion(
def getDistributionURL( def getDistributionURL(
String credentials, String credentials,
String resourceHREF, String resourceHREF,
String pulpHost = 'pulp.bbohard.lan' String pulpHost = '192.168.30.3'
) { ) {
def response = httpRequest authentication: credentials, url: "https://${pulpHost}${resourceHREF}", httpMode: 'GET', ignoreSslErrors: true def response = httpRequest authentication: credentials, url: "https://${pulpHost}${resourceHREF}", httpMode: 'GET', ignoreSslErrors: true
def jsonResponse = readJSON text: response.content def jsonResponse = readJSON text: response.content