I am relatively new to Jenkins and I am working on a large project that pulls from multiple repos to build. I wrote a declarative pipeline with shell commands that pull from the required repos and build the project and everything is working but I want to connect this pipeline to all these repos so every time there is a new commit or a pull request, a Jenkins job is triggered and then I return the build result to tag the git commit. I know how to do this for one repo, but I don't know how to do it for multiple repos.
Because of our network infrastructure I couldn't use webhook to trigger jenkins but the solution that I am using now is I created a runner for each repo and I wrote a curl command to trigger jenkins with so each time that there is a new commit to each of those repos the runner starts a new job, executes that curl command and triggers my jenkins job.
This is the curl command that I am using in case someone needed it:
curl -i -X POST --user [JENKINS_USERNAME]:[JENKINS_PASSWORD] 'http://[JENKINS_IP]:[JENKINS_PORT]/job/[JENKINS_JOB_NAME]/build?token=[TOKEN_GENERATED_INSIDE_JENKINS]&cause=[ADDITIONAL_INFORMATION_THAT_YOU_WANT_TO_PRINT]'