withCredentials([usernamePassword(credentialsId: 'ecr:eu-west-1:aws-jenkins-prod', passwordVariable: 'PASSWORD', usernameVariable: 'USER')]) {
def responseRaw = httpRequest(
consoleLogResponseBody: false,
customHeaders: [
[maskValue: true, name: 'Authorization', value: "Basic " + PASSWORD],
[maskValue: false, name: 'Accept', value: 'application/vnd.docker.distribution.manifest.v2+json']
],
contentType: 'APPLICATION_JSON',
responseHandle: 'LEAVE_OPEN',
httpMode: 'GET',
url: 'https://' + Constants.ECR_REPO + '/v2/myrepo/tags/list?n=1000',
validResponseCodes: '200'
);
def response = responseRaw.content
def response_status = responseRaw.status
responseRaw.close();
def responseParsed = new groovy.json.JsonSlurperClassic().parseText(response);
return responseParsed['tags'].sort().reverse();
}
To unsubscribe from this group and stop receiving emails from it, send an email to biouno-users+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "BioUno Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biouno-users+unsubscribe@googlegroups.com.
Hi,I haven't used much of Active Choices + Pipelines. Normally the problem when a user is trying to use both together is related to the DOM not being present.But in your case it looks like when you run that groovy with pipeline plugin, the classpath is different, and contains the reference for the other plug-ins.Could you create a JIRA ticket for that, please? With the component for this plug-in. It should automatically be assigned to me, and then I will take a look once I start a new cycle for the plugin developmentThanks!Bruno
From: "den...@gmail.com" <den...@gmail.com>
To: BioUno Users <biouno...@googlegroups.com >
Sent: Monday, 30 July 2018 11:54 AM
Subject: Use withCredentials and httpRequest in Active choice parameter
Hello there!I'm trying to get something like this working w/o any luck:
withCredentials([usernamePassw ord(credentialsId: 'ecr:eu-west-1:aws-jenkins- prod', passwordVariable: 'PASSWORD', usernameVariable: 'USER')]) {
Hello there!I'm trying to get something like this working w/o any luck:
withCredentials([usernamePassw ord(credentialsId: 'ecr:eu-west-1:aws-jenkins- prod', passwordVariable: 'PASSWORD', usernameVariable: 'USER')]) {
def responseRaw = httpRequest(
consoleLogResponseBody: false,
customHeaders: [
[maskValue: true, name: 'Authorization', value: "Basic " + PASSWORD],
[maskValue: false, name: 'Accept', value: 'application/vnd.docker. distribution.manifest.v2+json' ]
],
contentType: 'APPLICATION_JSON',
responseHandle: 'LEAVE_OPEN',
httpMode: 'GET',
url: 'https://' + Constants.ECR_REPO + '/v2/myrepo/tags/list?n=1000',
validResponseCodes: '200'
);
def response = responseRaw.content
def response_status = responseRaw.status
responseRaw.close();
def responseParsed = new groovy.json.JsonSlurperClassic ().parseText(response);
return responseParsed['tags'].sort(). reverse();
}
This code works just fine in my pipeline both inline and as function from default shared library configured in my Jenkins.But for Active Choice Parameter I always getting fall back value.In plain English I'm trying to get list of tags from private docker reposity so that operator would be able to pick image of his interestAny advice on how to make it working?Many thanks in advance!