How can I setup a multibranch pipeline job in Jenkins so that the branches of a certain repo are scanned but the branches are tested as submodules of another repo?
I have a project in Bitbucket and I have been successfull in configuring a multibranch pipeline job so that all branches are ran. The issue is that the repo itself serves mostly as a container for another repo, checked out as a submodule, where most of the code is. What I really want to do is have jenkins run CI on that code checked-out as a subrepo.
EDIT: Please note I want to have a multibranch pipeline job. I also want the job to test all branches of the submoudule, not just one. There are other threads explaining how to get a submodule to trigger a build, I however believe this is different.
EDIT2: To clarify. As stated in the second paragrah, I have a repository which serves as a container for another repo (which is included as a sub-module). The code I want to run the CI is in the submodule, I want jenkins to scan that submodule's branches and then run the job on each of those branches. However, the job requires the submodule's repo to be checked as that, a submodule, not as a standalone repo. In Jenkins I have successfully created a job which scans the container repo's branches (let's call it super-repo) and runs the job on each of those branches. The issue is that the super-repo does not have many branches, me and my team mostly work on the other repo (the one included as a submodule) and make commits/pushes to branches on that repo. We rarely make commit/pushes to the super-repo (mostly only when creating releases). Why is that I want the submodule's branches to be scanned instead of the super-repo's ones...