Trigger Specific Jenkins Job on Github Push to specific Directory

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Trigger Specific Jenkins Job on Github Push to specific Directory

Rahul Kumar-2
I have several Jenkins Job running which Deploy's code to application server. These jobs run automatically whenever there is Commit in Github repository configured through Jenkins Plugin in Github and webhook. Jenkins is running on a Windows system.

We have several applications in the repository, represented by a directory containing the code, each of these applications have a corresponding Jenkins Job which deploy's the code to server when the Job is run.
Since all the applications are in the same repository, so change in any one of the application creates a Push event and thus trigers all the Jobs.

Suppose there are three Applications App1, App2 and App3 and their corresponding Jobs are J1, J2, J3
and  there is a change in App1 and a commit is made in Github repository it causes all the Jobs J1, J2, J3 to trigger and Deploys App1, App2, App3 in server. 

It causes unnecessary confusion since App2, App3 do not have any changes in repository but still gets deployed to server.
Is there any way that i can trigger specific Jenkins job build based on Directory level Changes/Commits in the Github repository. Can we use any git hooks somehow to achieve this?


--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d147c205-d8dc-4b7d-84e0-ba806a11a566%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Trigger Specific Jenkins Job on Github Push to specific Directory

Victor Martinez
What about using the Git - Additional behaviours - Polling ignores with commtits in certains paths?


 






















I used something like that in the past but IIRC was for the github-pull-request plugin, so hopefully it works as you expect.

Cheers

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/90e3b22d-88a4-4f37-8cda-bb5d9f3700fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.