Jenkins, Git, Post Commit Hooks and Apigee Edge

Jenkins, Git, Post Commit Hooks and Apigee Edge

In my previous post I described how to configure Jenkins to deploy a proxy bundle to Apigee Edge using the apigeetool CLI.  In this post I will describe how to configure a Git repository to send Jenkins a post commit hook that instructs Jenkins to pull the current repository to build and deploy a proxy to Apigee Edge.  

In order for this to work, you need have a publicly accessible Jenkins server and the way I accomplished this was by running Jenkins (1.609.1) in Openshift.

Configure Github

First go to your Github repository and select the Settings menu item.

 Select Webhooks and Services from the left side of the screen.  From the Webhooks page click the Add service button and then type Jenkins in the search box.  Make sure to select the Jenkins (Github plugin).

When you add the service make sure to enter the URI of your Jenkins (i.e. https://jenkins-yourdomain.com/github-webhook/).  Then click the Add service button. 

That is all to configure your Github repository.  Now you have to configure Jenkins.  

Configure Jenkins

Login to your Jenkins server and click the Manage Jenkins button.

Click the Manage Plugins button.

Install the Github plugin

Click Manage Jenkins on the left menu box and then click Configure System. Scroll down until you see the Github section.  You need to configure a server so that it looks like the one shown below. Make sure to add your Github credentials and test the connection.  When you are finished click the Save button at the bottom of the screen. 

Next you have to configure the Jenkins Job.  From the Jenkins home page, click on the Job that you want to configure and then click the Configure button on the left.  Refer to my previous post if you need to create a new Jenkins Job.  

Scroll down until you see the Build Triggers section.  Make sure you select the "Build when a change is pushed to Github" option.  Then click the save button.

Go to your Github source code and update a file, commit it and push the code to Github.  You should see your Jenkins job start executing as shown below. 

This job clones the repository specified, builds the proxy bundle and then deploys the proxy to my public Apigee cloud server.  You can view the Console output to see the status/results of the build and deployment.  Login to your Apigee Edge account to see the deployed proxy.  

To view or add a comment, sign in

More articles by Sean Williams

Others also viewed

Explore content categories