checkout changelog: true, poll: true, scm: [$class: 'GitSCM', branches: [[name: "origin/${gitlabSourceBranch}"]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'PreBuildMerge', options: [fastForwardMode: 'FF', mergeRemote: 'origin', mergeTarget: "${gitlabTargetBranch}"]]], submoduleCfg: [], userRemoteConfigs: [[name: 'origin', url: 'g...@gitlab.mysite.com:test/testrepo.git']]]Hello Owen,
as far I know environment variables need to be prefixed with env when accessing them from Groovy, so maybe it should be "origin/${env.gitlabSourceBranch}" …?
Regards
Mirko
--
Sent from my mobile
--
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 jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/710c72a2-deee-414e-9fb1-0c86128aff91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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/CJEbh85zRx8/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/CAK8jvqxc4xMLTXnYH2xxekJ2c-gnCXEXw6pZX2cx4%3DFcyWvrbw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAHtcACEJ9aRenR0WNz-u--LMBGEqQbq6MqBQQJ6EZgRjLEjtow%40mail.gmail.com.
It seems like when the job is not an AbstractProject e.g. a WorkflowJob then the job isn't scheduled with parameters https://github.com/jenkinsci/gitlab-plugin/blob/master/src/main/java/com/dabsquared/gitlabjenkins/GitLabPushTrigger.java#L204
[1] and [2] are some examples on how to schedule a job with parameters where the job implements ParameterizedJobMixIn.ParameterizedJob which any job type that takes parameters should implement (FreeStyle, Workflow Maven etc)There are probably more examples out there.
[1] https://github.com/jenkinsci/gerrit-trigger-plugin/blob/master/src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/EventListener.java#L231
[2] https://github.com/jenkinsci/dockerhub-notification-plugin/blob/master/src/main/java/org/jenkinsci/plugins/dockerhub/notification/DockerHubWebHook.java#L167/B
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CALzHZS00VRov2sm-GYjkE0uy6nmo9c9O-CuX4s%3DeWouYUsXRdQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/7f4d1b28-febd-4dfd-ad99-7e0d70767e89%40googlegroups.com.
On Wed, Nov 11, 2015 at 6:22 PM, Owen B. Mehegan <ow...@nerdnetworks.org> 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 a topic in the Google Groups "Jenkins Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/CJEbh85zRx8/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/CANfRfr2y9oMS6T7Maje_VahF7qp5LqoFv0JaTZ7zFYdO-_1hyg%40mail.gmail.com.