In this post I’ll show you how to integrate GitHub with Jenkins and UrbanCode Deploy.
For my purpose, I cloned the DataPower Configuration Manager (DCM) repository.
DCM is a package for dealing with IBM DataPower configuration management.
From the GitHub repository click on “Settings”:
and click on “Webhooks”
then select “Add webhook”
In the “Payload URL” field, paste the Jenkins URL and at the end of the URL add /github-webhook/.
In the “Content type”, select “application/json”.
In the “Which events would you like to trigger this webhook?” check “just push the event”.
Finally check “Active” and click “Add Webhook”.
On Jenkins, I created a Freestyle project: datapower-configuration-manager
Click on “Configure”:
From “Source Code Management” tab, select “Git” and paste the GitHub repository URL in the “Repository URL” field.
Click on the “Build Triggers” tab and then on the “GitHub hook trigger for GITScm polling”.
Click on “Build” tab and add the build step “Invoke Ant”:
Now GitHub repository is integrated with the Jenkins project.
Finally, for Jenkins and UrbanCode Deploy integration, install the plugin Jenkins 2.0 plug-in for IBM UrbanCode Deploy.
This plug-in includes functions to interact with IBM UrbanCode Deploy components and deployments.
It enables the import of Jenkins build artifacts and can initiate IBM UrbanCode Deploy server’s deployments.
The plug-in is installed on the Jenkins server and can be configured through Pipeline script syntax or form fields.
After installing the plugin, go to “Manage Jenkins” and put url and credentials of UrbanCode Deploy server in the plugin form:
On uDeploy, I created:
– Application: IBM DataPower
– Application Process: Deploy App
– Environment: DEV
– Component: IBM DataPower configuration manager
– Component Process: Install plugin
All these info will be used later on Jenkins uDeploy form fields.
The Component has no “Source Configuration Type” defined because the artifact will be pushed by Jenkins.
The Component Process will just download the artifact to the working dir of uDeploy Agent.
Going back to Jenkins, I added the build step: “Publish Artifacts to IBM UrbanCode Deploy” and provided all the uDeploy info as in fig. below:
GitHub, Jenkins and UrbanCode Deploy
Finally, going back to GitHub repository, we can edit the source script and commit the changes. This will trigger the Ant Build, then it will push the artifact to uDeploy and execute the Deployment as you can see in the video below.
Have a nice day!