REST calls from pipeline

2018-02-14 Thread Carles Capdevila Tejada
Hi there, I want to make rest calls from a Jenkinsfile pipeline as a means of cleaning up artifacts uploaded to Nexus. (pipeline - REST -> Nexus) This SO answer by amuniz states that the

Shared Groovy Library class comparation problem

2018-03-01 Thread Carles Capdevila Tejada
Hi there, I defined a MilestoneAction class in our shared groovy library, and attached it to jobs through another method in the library via addAction(). When peeking at that specific build from another build through another library method via 'build.getActions(MilestoneAction.class)' that

Re: Shared Groovy Library class comparation problem

2018-03-01 Thread Carles Capdevila Tejada
EDIT: wrong code for (action in build.getAllActions()) { context.echo "Comparing actions: ${action.getClass().getName()} with ${MilestoneAction.class.getName()}" //if (action.getClass().getName().equals(MilestoneAction.class.getName()))//Ugly, but works if (action instanceof

Adding UI Action to a Job with pipeline

2018-04-12 Thread Carles Capdevila Tejada
Hi there, I'd like the "Build Now" button back in the parameterized pipeline job (the original "Build Now" button changes into "Build with parameters"). So the question is: *Is it possible to add a "Build Now" button by attaching an Action to the Job from within the pipeline itself? * I mean

Pipeline - Docker Credentials "WARNING! Your password will be stored unencrypted"

2018-11-08 Thread Carles Capdevila Tejada
I'm surprised that nobody else mentioned this. I've googled it several times and searched through this forum but most of the results were just related to failed login attempts, and none concerning this specific issue. I'm getting this warning when executing the *docker.withRegistry(*, *)

Re: Pipeline Multibranch jobs - Build User Vars Plugin

2019-01-21 Thread Carles Capdevila Tejada
Hello Eldad, We have something like this working on our multibranch pipelines: hudson.model.Cause.UserIdCause userIdCause = (hudson.model.Cause.UserIdCause ) pipeline.currentBuild.getCause(hudson.model.Cause.UserIdCause.class) if(userIdCause) { String userName = userIdCause.getUserName()