I have a repository that does not contain a Jenkinsfile - and I have no way of influencing the repository itself. This means I can neither add nor alter any files to or in the repository (In this case, its the Qt repo).
What I want to do is create multiple Jenkinsfiles, that are each configuring and building the Qt library for a different target, or run different additional scripts.
All these Jenkinsfiles will be collected in a different repository.
Now, my problem is how to create a pipeline job, that gets triggered, as soon as there are changes in the Qt repository, but uses a Jenkinsfile from the other repository.
Research left me - as far as I can see and according to these posts - with two options:
Adding both repositories to the Definition section - something along the lines of this:
Unfortunately, this does not work for me, as both repositories would still need a Jenkinsfile. Further, I cannot specify a different branch for each repository, so I cannot listen to a specific Qt Version branch.
The second (well, probably the only) option I see, would be to create a freestyle Jenkins job, that solely listens to the Qt repository and triggers a build of the pipeline job on a change as its only action.
I reckon, that the second approach would work for me, but what I want to know, is whether there is any plugin, configuration option or whatever that I missed that can solve this in a cleaner way, or whether the above is the way to do it.