I am new to Jenkins but have successfully created a Pipeline that will build our project hosted on Github. The user can even specify the branch (master, develop, test, etc.) that they want to build.
Now, I would like to implement automatic builds whenever there is a push to a certain branch (develop for example). Pushes to other branches should not result in an automatic build. I am having trouble getting this going and even finding information on it. I have found:
My first question is: Are there any other sources of information for setting up automatic builds in Jenkins when the backing source repository is Github (as opposed to BitBucket for example)?. The above mention article is from 2021. Some of the steps and screenshots do not correspond to recent versions of Jenkins.
Specifically with the article mentioned, I have completed all the steps. Probably not successfully or things would be working! Of note in Step 2 I have added Github Server. I filled in API URL as https://api.github.com. Hitting ‘Test Connection’ results in:
Credentials verified for user davidrunner, rate limit: 4998
which seems like a good sign?. I did not click ‘Manage hooks’ checkbox as document did not seem to check it.
I believe I followed step 3 and configured step 4 on the Github repository.
However, when I commit and push a test change to either the branch ‘master’ or ‘develop’ I see under ‘Recent Deliveries’ for Webhooks a Red triangle with exclamation mark. The response is empty with ‘502’. I believe this means the connection was rejected by the Jenkins machine?
My second question is: How do I even troubleshoot this? What should I check? I stress again that I can certainly pull the code from Jenkins and build. So, clearly communications between Github and Jenkins machine is possible.
Many thanks!