The JSON blob sent by GitHub is already parsed (if you have the GitHub plugin 
installed and point the webhook to it properly), but it doesn't contain very 
much useful information. Essentially the URL of the repository that was changed 
is extracted from it, then all jobs that use the Git SCM are checked to see if 
that repository matches the one they are configured to pull from. If it does, 
that job is 'poked', so it will go check the repository to see what actually 
changed and make its own decision about what should be done (if anything).


As an example, I have about 20 jobs that all pull from the same repository, but 
each of them only pays attention to one or two files in the master branch of 
that repository; when I push a change, they all get poked, they all check the 
repo for changes, but only the ones who are watching the files I changed 
actually trigger builds.

----- Original Message -----
From: jenkinsci-users@googlegroups.com
To: jenkinsci-users@googlegroups.com
Cc: Kevin Fleming (BLOOMBERG/ 731 LEXIN)
At: May  4 2013 21:27:23


On Saturday, May 4, 2013 9:23:35 PM UTC-4, spacegoose wrote:

On Thursday, May 2, 2013 1:35:44 PM UTC-4, Kevin Fleming wrote:You've missed 
one important point: Yes, the Git plugin will check the repository for changes, 
and will probably update its local clone to then check to see if 'dev' has 
changed. If 'dev' has not changed, no build will be performed, because the Git 
plugin remembers what the last-built-commit on the specified branch was.


So when you specify a branch in the Git plugin configuration, that not only 
tells it what to build, but also what must change for polling to trigger 
another build.







Cool, I hope this turns out to work for me. I will post back when we open the 
firewall from GitHub to our Jenkins.


Bill


What about the post info (json?) GitHub sends with the request? 


Will that just be ignored in my case? 


Wondering how (or why) Jenkins might parse it, maybe another plugin?


Bill 




 

----- Original Message -----
From: jenkins...@googlegroups.com
To: jenkins...@googlegroups.com
Cc: Kevin Fleming (BLOOMBERG/ 731 LEXIN)
At: May  2 2013 13:15:13


On Thursday, May 2, 2013 12:14:16 PM UTC-4, Kevin Fleming wrote:If you use the 
GitHub Webhook method of triggering jobs, the job will be told to 'poll' the 
repository if it uses the repository that received commits. The job itself can 
restrict what parts of the repository will actually cause a build to occur, and 
if the changes in the repository don't affect those parts, no build will happen.

The Jenkins master will still check the repository after each commit to see if 
the changes are relevant, but builds will only happen if the specified 
branch(es) were modified.






Thanks for the reply Kevin. I am not sure I follow it entirely.

Our GitHub repo has a web hook with the trigger URL + token for this job as its 
value.

Our Jenkins job (via git plugin) pulls the code from our repo. We specify dev 
for "Branches to build." 

If commits are made to other branches in the repo, with the web hook in place, 
I imagine the job will build dev again (even though the commit may have been to 
master)?

On commits to any branch other than dev I'd like to tell this Jenkins job to do 
nothing. 

But if the commit was to dev, I'd like Jenkins to start running the job.

Thanks again,
Bill




----- Original Message -----
From: jenkins...@googlegroups.com
To: jenkins...@googlegroups.com
At: May  2 2013 12:11:05
We use GitHub and want to be able to trigger builds on Jenkins when a commit is 
made to a particular branch.

Our Jenkins currently only has the git plugin which I believe allows for the 
pulling from our GitHub repo via ssh public key authorization.

I think the GitHub built-in web hook which has our secret token URL as its 
value and executes for every commit regardless of branch, sends post data with 
the branch that was committed to via the trigger URL?secret_token.

Is there some way to filter this post data before executing the build, and only 
trigger when the data is for the desired branch, e.g. dev?

I am wondering if using polling might be better? Is it possible to poll and 
only build for changes to a particular branch?

Would parameterized builds be useful.

Thanks for any help.

Bill




-- 

You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-use...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 









-- 

You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-use...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 









-- 

You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to