On Wed, Nov 11, 2015 at 6:22 PM, Owen B. Mehegan <[email protected]> wrote:
> I can't figure out how to access the branch parameters that the
> plugin is setting. If you look at the 'Using it with a job' section of the
> readme, it has you configure Git to expect variables like gitlabSourceBranch
> and gitlabTargetBranch to be set when a build is triggered by Gitlab.

Two things.

First of all, the code in `onPost` is wrong. See

https://github.com/jenkinsci/workflow-plugin/blob/master/COMPATIBILITY.md

for background but basically you need to be using
`ParameterizedJobMixIn`, which allows `actions` to be passed to any
build you schedule. There is no need to check for `instanceof
AbstractProject`.

Second, the whole system the plugin is using to specify a branch per
build can be considered obsolete. Instead, depend on `scm-api`,
implement `SCMSource`, and use multibranch workflows (or other
multibranch projects). See `github-branch-source` for an example.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr2y9oMS6T7Maje_VahF7qp5LqoFv0JaTZ7zFYdO-_1hyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to