test déclaration des paramètres de manière globale
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
c0bc85f860
commit
5112fc5d88
|
@ -3,13 +3,20 @@ import groovy.json.JsonOutput
|
||||||
def call() {
|
def call() {
|
||||||
pipeline {
|
pipeline {
|
||||||
|
|
||||||
|
parameters {
|
||||||
|
string(
|
||||||
|
name: 'pulpHost',
|
||||||
|
description: 'Nom de domaine pour le serveur Pulp',
|
||||||
|
defaultValue: ''
|
||||||
|
}
|
||||||
|
|
||||||
def getResourceHREF(
|
def getResourceHREF(
|
||||||
String credentials,
|
String credentials,
|
||||||
String resourceEndpoint,
|
String resourceEndpoint,
|
||||||
String resourceName,
|
String resourceName,
|
||||||
String pulpHost
|
// String pulpHost
|
||||||
) {
|
) {
|
||||||
def response = httpRequest authentication: credentials, url: "https://${pulpHost}/pulp/api/v3/${resourceEndpoint}", httpMode: 'GET', ignoreSslErrors: true, validResponseCodes: "200"
|
def response = httpRequest authentication: credentials, url: "https://${params.pulpHost}/pulp/api/v3/${resourceEndpoint}", httpMode: 'GET', ignoreSslErrors: true, validResponseCodes: "200"
|
||||||
def jsonResponse = readJSON text: response.content
|
def jsonResponse = readJSON text: response.content
|
||||||
def resource = jsonResponse.results.find { it -> it.name == resourceName}
|
def resource = jsonResponse.results.find { it -> it.name == resourceName}
|
||||||
if (resource) {
|
if (resource) {
|
||||||
|
|
Loading…
Reference in New Issue