Triggering a branch in a MultiBranchProject with custom environment

24 views
Skip to first unread message

rsomas...@netflix.com

unread,
Jan 14, 2021, 5:53:10 PM1/14/21
to Jenkins Developers
Hi!

My coworker and I are writing a custom BranchSource plugin and there is some extra context I want to pass on to the build. 
We started by looking at the Bitbucket Branch Source plugin and started implementing my own.
When an SCM event occurs, we're able to trigger the build, but I want to attach an EnvironmentContributingAction to it.

What would be the easiest way for a plugin to do that?

Thanks! 
Rahul

Jesse Glick

unread,
Jan 14, 2021, 9:56:58 PM1/14/21
to Jenkins Dev
Look at `jenkins.branch.BranchNameContributor` as an example. That adds variables for stock metadata `Action`s defined in `scm-api`, but you could do something similar for more specialized metadata.

Rahul Somasunderam

unread,
Jan 19, 2021, 8:05:41 PM1/19/21
to jenkin...@googlegroups.com
Is there a way to access SCMHeadEvent.getPayload() from EnvironmentContributor ? 
Most of my metadata comes from the payload of the SCMHeadEvent.

On Thu, Jan 14, 2021 at 6:57 PM Jesse Glick <jgl...@cloudbees.com> wrote:
Look at `jenkins.branch.BranchNameContributor` as an example. That adds variables for stock metadata `Action`s defined in `scm-api`, but you could do something similar for more specialized metadata.

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/j1pb5tY9KDs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr0dfdzNN4itWpRnf%2Brxt-H2iBrn58ZJA4jm52_CnK%3DreA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages