My repo has multiple projects in subfolders with same structure duplicated across multiple branches.
I'm trying to set up a job that monitors all branches and triggers a job only when a change in a subdirectory 'Project1' is made. This way I can check if changes to 'Project1' work on release branches and any dev branches people might set up.
In theory it seems the Git plugin does let me set this up, by specifying '**' in 'Branches to build' and 'Project1.*' in 'Included Regions'. I also use 'Poll SCM' since that seems to be a prerequisite.
This works fine as long as you make changes only to one branch. Once you make a change outside of the 'Project1' folder on another branch, Jenkins picks up a changes from any directory.
Is this a bug or am I trying to do something that is not supported?
With the help of the Git plugin Jenkins can easily pull source code from any Git repository that the Jenkins build node can access. The GitHub plugin extends upon that integration further by providing improved bi-directional integration with GitHub.
Step 1: go to your GitHub repository and click on 'Settings'. Step 2: Click on Webhooks and then click on 'Add webhook'. Step 3: In the 'Payload URL' field, paste your Jenkins environment URL. At the end of this URL add /github-webhook/.
How does Jenkins integrate with Git? Go to Jenkins dashboard, click on “Manage Jenkins.” Now follow these steps- Manage Plugins -> 'Available' tab -> Enter Git in search bar and filter -> Install required plugin. After the installation, all you need to do is click on “Configure System” and go to the 'GitHub' section.
It`s possible, but not recommended. You can set additional checkout behavior and then choose which folders should trigger the build and which are not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With