Exclude Paths from Triggering Builds

79 views
Skip to first unread message

Ven H

unread,
Feb 12, 2021, 7:08:58 AM2/12/21
to jenkins...@googlegroups.com
I have a repository in GitHub. This repository has a Jenkinsfile at the root which is the app project. There are 2 more folders / directories, one for Config project and one for Database project. Each has a jenkins file inside it. 

We have 3 Multibranch Jenkins Pipelines, since there are 3 different modules / projects. But all of them belong to the same GitHub repository. The challenge is that, if the DB developer modifies any file inside the DB directory, other jobs are also triggered (App and Config). If a file is changed in the Config directory, it triggers App and DB jobs, probably because all are inside the same repository.

Is there a way to ensure that any change in DB directory will only trigger the DB Multibranch job and not the App and Config and vice versa? Basically, I am looking for an option to exclude DB and Config directory from triggering App Build and so on. Please help.

Regards,
Venkatesh

Jeremy Mordkoff

unread,
Feb 12, 2021, 11:06:22 AM2/12/21
to Jenkins Users
Also interested in the answer. 

At the moment we scan the change log from the scm object and abort the pipeline (cleanly) if there is nothing of interest to that pipeline to build. I do not like this solution for multiple reasons. 

Our plan is to split our code into 3 repos .. one for each app and one for the product, with each of the app builds triggering a product build. The product build is really fast since all it does is update the tags in a helm chart to reference the latest builds. 

FYI...we use git submodules, which is why the scm object is not a good solution for us as it only has a list of changes made in the super-module. 

Reply all
Reply to author
Forward
0 new messages