Continuos Integration with GitHub and Jenkins
Everytime your developer makes changes to the code in Github Repository will you login to Jenkins and click "Build Now" all the time??
Last updated
Everytime your developer makes changes to the code in Github Repository will you login to Jenkins and click "Build Now" all the time??
Last updated
In previous section we have successfully created Ansible playbook and automatically deployed our application on Tomcat server but we have to click everytime we wanted a build file.
What if I say we can automate that too! Let us do something so that if there is any change in the code Jenkins should detect it and Build new file, pass it to ANSIBLE, which will create our container and move the file in it & BOOM!!! our application is live.
Sign into your GitHub account and select your repository
Go to settings option >> Choose >> click on Add Webhook (provide password, if asked)
You will be asked to enter Payload URL, you will get this from Jenkins.
Login to Jenkins
Manage Jenkins >> Configure system
Search for "GitHub" >> Click on Advanced and tick the "specify another hook URL for GitHub Configuration" >> Copy the link and paste it in Github Payload URL section.
After putting the url scroll down and select on
Add webhook
You have successfully created your webhooks Now go to your Depoyment Job and do these settings
Select your Job>> Configure.
In build section tick the GitHub hook trigger option and APPLY & Save
THAT'S ALL!! We have successfully implemented Continuos Integration Let's Try it out my making some changes in the code.
I wil change the background color from green to blue and let's see if JENKINS can detect and build it or not!!
Hooray!! We have Completed our project "Learn DevOps on AWS - using GIT, Maven, Jenkins, Docker and Ansible. "