Hi @a-hacker ,
Is some one working on adding this feature ParameterizedBuilds/parameterized-builds#134 ?
If not, I would like to contribute towards it
My idea is to add two fields in PUSH EVENT trigger (may be in others as well)
1) Ignore Committers : List of usernames separated by comma (,) if event author is someone one from this list trigger will be ignored
2) Ignore Commit Message : A string (example skipCI) configurable by user , if it found in the commit message trigger will be ignored
What you think ?
@NeoDobby with regards to the correct branch - what I had hoped to do is to send both the source and target branches as parameters, and when those parameters are present, my pipeline would merge them locally before running the build. In your case you could send an extra parameter to your pipeline called something like "Merged=true" which your pipeline could respond to by checking out the target branch rather than the source.
Having said that, I think just having a plain webhook to trigger scans on commits would probably be simpler? i.e. not use this plugin for the merge event?
%252Fin URL with a
/then I get a 404. So if the plugin is not URL encoding the branch name on the URL that could explain why it's not working; but the problem with that theory is that it works OK for the manual trigger.
After spending some more time looking into it, I've discovered the following:
In order for builds to be triggered from PR events, Jenkins needs to already be aware of the branch for the PR.
You can make Jenkins aware of the branch before the PR is created in two different ways:
1) By enabling the ref_created triggers in the Bitbucket plugin - this will cause a scan when branches are created.
2) Set Jenkins to poll every X minute to look for branches/changes
Both of these will trigger a build for the feature branch, without any pull request params.
When you run a build manually from a PR, despite Jenkins seemingly not yet knowing about the branch from a scan, it will run the build with any PR parameters fine.
Jenkins builds will only be triggered on a multibranch pipeline from a PR event IF the branch name does not contain a slash in it; i.e.
feature/myfeature. I presume there is an issue in code with URL encoding, as jenkins expects
%252F in the URL instead of a
/in my branch name