There's a bunch of ways you could do this, depending on your set up. You can set the Jenkins job to only build on changes to branches that match a certain string, then have all work done in the specific subfolders match that string. Like "/ui-*"
You could set up a second job that only checks for changes in those subfolders, then only kicks off the build job you already have if it finds changes. If you are in a pipeline, you can access the changelog and grep for what you need. https://support.cloudbees.com/hc/en-us/articles/217630098-How-to-access-Changelogs-in-a-Pipeline-Job- If it were me in one of my typical projects, I'd check for changed files in the pipeline, and trigger the build based on the result of the search for the subfolder. Stack Overflow posts that'll help: https://stackoverflow.com/questions/5243593/how-to-trigger-a-build-only-if-changes-happen-on-particular-set-of-files https://stackoverflow.com/questions/16054177/jenkins-plugin-for-triggering-build-whenever-any-file-changed-in-a-given-directo?noredirect=1&lq=1 https://stackoverflow.com/questions/6260383/how-to-get-list-of-changed-files-since-last-build-in-jenkins-hudson/39862273#39862273 Good luck! On Friday, February 1, 2019 at 2:51:50 PM UTC-5, Panchangam Kalyan wrote: > > Quick help, > > Is there a way to trigger Jenkins job on changes only to a specific > subfolder in the Git repository.? > Traditionally, we were using VSTS for CICD and it has inbuilt GIT hooks to > handle request but in Jenkins i couldn't find any concrete solution. > > Can some body please help. > > > On Fri, Feb 1, 2019 at 7:29 AM Mark Waite <[email protected] > <javascript:>> wrote: > >> >> >> On Fri, Feb 1, 2019 at 5:10 AM Archana Srichandan <[email protected] >> <javascript:>> wrote: >> >>> Hi, >>> Thanks for your reply. I gave the url as serverip:path to repository, >>> The username is given as the user of the remote server to which to do SSH. >>> I have created a private key for the user which I am logged in into the >>> jenkins server. I am copying the private key directly and also the >>> passphrase. Still I am not able to clone from the repository. Please let me >>> know if I am doing something wrong. >>> Note. Jenkins is running behind tomcat. (I deploy jenkins through >>> tomcat). >>> >> >> Does the passphrase include characters which are special to the shell >> (like '#', '*', '(', or ')')? If so, use a private key with a passphrase >> that does not include characters that are special to the shall. The >> current git client plugin implementation has a problem with shell special >> characters in passphrases. >> >> Mark Waite >> >> >>> Regards, >>> Archana Srichandan >>> >>> >>> On Thu, Jan 31, 2019 at 8:58 PM Mark Waite <[email protected] >>> <javascript:>> wrote: >>> >>>> Did you assign a private key credential to that job? A >>>> username.password credential won't work with an SSH URL. A private key >>>> credential won't work with an http or https URL. >>>> >>>> If the private key has a passphrase, did you provide the passphrase >>>> when defining the credential in Jenkins? >>>> >>>> Did you confirm that the private key will authenticate from the command >>>> line? >>>> >>>> Mark Waite >>>> >>>> On Tue, Jan 29, 2019 at 3:17 PM <[email protected] <javascript:>> >>>> wrote: >>>> >>>>> Hi All, >>>>> >>>>> I am not able to run my git repo on Jenkins ,attach is the screen shot >>>>> for your reference. >>>>> >>>>> Regards, >>>>> Archana Srichandan >>>>> >>>>> -- >>>>> 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 [email protected] <javascript:>. >>>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/jenkinsci-users/50dd7ccf-9ad6-45e3-a5fc-9cee050a7737%40googlegroups.com >>>>> >>>>> <https://groups.google.com/d/msgid/jenkinsci-users/50dd7ccf-9ad6-45e3-a5fc-9cee050a7737%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>> . >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> >>>> >>>> -- >>>> Thanks! >>>> Mark Waite >>>> >>>> -- >>>> 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 [email protected] <javascript:>. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtGvL%3DxHGju7a%2BbGvVd7Bhs7gvhr09Qd%3Dr3zkY1OOs2DhA%40mail.gmail.com >>>> >>>> <https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtGvL%3DxHGju7a%2BbGvVd7Bhs7gvhr09Qd%3Dr3zkY1OOs2DhA%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>> . >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> -- >>> 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 [email protected] <javascript:>. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/jenkinsci-users/CA%2BU8sbXkPabE0ZqNTq_iur%3DRGjmm6MeaYdzXgRPCNMsqfheS_A%40mail.gmail.com >>> >>> <https://groups.google.com/d/msgid/jenkinsci-users/CA%2BU8sbXkPabE0ZqNTq_iur%3DRGjmm6MeaYdzXgRPCNMsqfheS_A%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> -- >> Thanks! >> Mark Waite >> >> -- >> 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 [email protected] <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtEhKNgrTKk7HXVtXJ4KdDWurvF_Z6z6U0w0zwfzO%3DOBTA%40mail.gmail.com >> >> <https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtEhKNgrTKk7HXVtXJ4KdDWurvF_Z6z6U0w0zwfzO%3DOBTA%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/140a1fac-fbd9-4c79-8900-56829b180f83%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
