mohamicorp / stash-jenkins-postreceive-webhook

Webhook used to notify Jenkins when commits are made to Stash
Other
138 stars 98 forks source link

Trigger projects even if they have a ${parameter} in the job for the branch name #127

Open neilknowscomputers opened 9 years ago

neilknowscomputers commented 9 years ago

So if I want my build job to be automatically triggered by the git hook and manually triggered as a parameterized build (by accepting a parameter for the branch using a string or chooser like git-parameter plugin) then I need to put the ${parameter} in the "Branches to build > Branch Specifier" section of the Jenkins Git Plugin.

This works for manual builds, but the Stash plugin/git hook does not trigger the job correctly. Presumably it is match the literal string against the branch, and that evaluation is failing. Perhaps there could a special case were a string starting with $ could become ** for the purposes of this evaluation?

It would be nice if the post receive hook still worked even if there was a variable in the Branch Specifier field.

Thanks

neilknowscomputers commented 9 years ago

I'm not totally clear on all the plumbing and mechanisms here. But these are some seemingly related bugs with the git plugin https://issues.jenkins-ci.org/browse/JENKINS-27349 https://issues.jenkins-ci.org/browse/JENKINS-14276