Implementing a new Step for 'Pipeline Artifact Promotion' Plugin

26 views
Skip to first unread message

prastik Gyawali

unread,
Jun 11, 2019, 6:09:23 PM6/11/19
to Jenkins Developers
Hello All!
I was trying to create a new Declarative pipeline script Step for 'SelfPromotion' and am confused as to what goes inside the start() method while creating the step. 
public StepExecution start() throws Exception{
    return new Execution();
}

Here I later implement "Execution extends SynchronousStepExecution". Questions:
1) What should be the implementation/use of the Execution class here?(Its return type- a badge?)
2) When connecting with the new pipeline compatible SelfPromotionCondition how are the parameters sent and how would this step communicate with the required promotion Condition class?

Thank You!!

 

Jesse Glick

unread,
Jun 12, 2019, 10:53:24 AM6/12/19
to Jenkins Dev
On Tue, Jun 11, 2019 at 6:09 PM prastik Gyawali
<kitsarp...@gmail.com> wrote:
> 1) What should be the implementation/use of the Execution class here?(Its return type- a badge?)

If it is to be used from Declarative, normally the return type will be
`Void`, since only a Scripted Pipeline could assign a return value to
a variable.

https://github.com/jenkinsci/workflow-step-api-plugin/blob/master/README.md
has some general background, if you have not yet seen it.

prastik Gyawali

unread,
Jun 12, 2019, 11:29:21 PM6/12/19
to Jenkins Developers
yes 'Void' should be returned. Thank You!
Reply all
Reply to author
Forward
0 new messages