Hello All,
For a particular scenario my requirement is, lets suppose we have 2 folders:
Folder 1
Folder 2
If there is a change in a file of "Folder 1", then the Jenkins build should trigger, otherwise it should not. I am using Git repository to maintain my code.
I would request any help if someone has been through this scenario.
Thanks and Regards,
Rahul
What I have tried:
Gone through many solutions online for ex:
https://stackoverflow.com/questions/28332780/how-to-trigger-a-jenkins-build-in-gerrit-trigger-on-change-to-project-subdirecto[
^]
In Jenkin's under "dynamic source triggering" option, specified "file path", "forbidden file path" option. However, i see that my Jenkins Job is getting triggered for changes within both Folder-1 and Folder-2.
The configuration which i have set is:
GERRIT TRIGGER:
Trigger On:
- Draft Published
- Patchset Created
DYNAMIC TRIGGER CONFIGURATION:
Gerrit Project: name of repo: repo_name
Branches: path of the branch : for ex: /path
Add File path: Folder-1/**
Reading the documentation part, i saw that in Forbidden file paths, if there is a change in only the forbidden file, the Job wont trigger. But, somehow it doesnot seem to work.
Also, please note, that i use a sparse checkout, to checkout specific folders from the repository. I dont know, if that can affect...