In this example, we are going to let GitHub trigger Jenkins pipeline build only when we merge code to a develop branch in GitHub repository. This action often occurs when a “feature/hotfix/release” branch is merged into “develop”. That’s all!

Prerequisites

Apply steps defined under “Jenkins server GitHub SSH integration” and “Allow Jenkins user to execute docker commands” sections in Integrating Jenkins with GitHub to run dockerised application pipeline page.

Ngrok setup

Download ngrok to your host OS’s desktop and run $ ./ngrok http -host-header=rewrite 192.168.99.40:8080 in terminal. The http://192.168.99.40:8080 is your Jenkins GUI address. This will give you an URL that can be accessible from the Internet. We will use this to integrate with GitHub later on. Assume that it gave us http://fdb1ce55.ngrok.io as URL.

#docker #git #jenkins

Triggering Jenkins Pipeline for Docker From Git Develop Branch Merge
1.15 GEEK