Issue
I am relatively new to jenkins and I am working on a big project that pulls from multiple repo to build. I wrote a declarative pipeline with shell commands that I use that pulls from the required repos and build the project and everything are working but I want to connect this pipeline to all these repos so every time that there is a new commit or merge request, that triggers jenkins and starts this pipeline and then based on the build result I tag the git. I know how to do this for one repo but I don't know how to do it for multiple repo.
Solution
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]'
Answered By - AVarf Answer Checked By - Katrina (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.