jenkinsci / generic-webhook-trigger-plugin

Can receive any HTTP request, extract any values from JSON or XML and trigger a job with those values available as variables. Works with GitHub, GitLab, Bitbucket, Jira and many more.
https://plugins.jenkins.io/generic-webhook-trigger
404 stars 159 forks source link

In git hub organisation level triggering one single jenkins pipeline for all changes under that organisation #174

Closed 478859-anurag closed 3 years ago

478859-anurag commented 3 years ago

I have enabled this plugin at organisation level initially with normal github-webhook, which was already triggering Jenkin’s pipeline for multiple repos under an organisation .

With both webhooks in place, I have only added generic trigger in Jenkinsfile for a single branch in a repo with token variable defined in webhook and Jenkinsfile trigger lets say the pipeline name is generictriggerdemo. Now for some reason when I created Jenkins file and pushed the code in a separate repo altogether with no generic trigger lets say the name is githubwebhookdemo. That is also triggering a jenkins build on the jenkins pipeline where I am using generic trigger i.e generictriggerdemo.

You may also have a look at the test cases as they should answer the most common questions:

https://github.com/jenkinsci/generic-webhook-trigger-plugin/tree/master/src/test/resources/org/jenkinsci/plugins/gwt/bdd

If you are fiddling with expressions, you may want to checkout:

A Curl command can look something like this:

curl -v -H "Content-Type: application/json" -X POST -d '{ "app":{ "name":"GitHub API", "url":"http://developer.github.com/v3/oauth/" }}' http://localhost:8080/jenkins/generic-webhook-trigger/invoke?token=sometoken
478859-anurag commented 3 years ago

Any code checkin under that github organisation is triggering a job in generictriggerdemo jenkins pipeline

tomasbjerre commented 3 years ago

See: https://github.com/jenkinsci/generic-webhook-trigger-plugin#trigger-only-specific-job

Or open new issue where you follow issue template