Optimizing Development Workflows: Enhancing Efficiency with GitHub-Jenkins Integration and Webhooks

Optimizing Development Workflows: Enhancing Efficiency with GitHub-Jenkins Integration and Webhooks

Introduction:

In the fast-paced world of software development, efficiency and automation are key factors that can make or break a project. One powerful tool that facilitates seamless integration and automation in the development process is webhooks.

In this blog we will be discussing about the webhooks importance and how to use it easily step by step process show below.

Steps to enable webhook:

The very first step involves going on to the repository on which you would like to have continous integration and delivery. You will see the settings options listed there.

Note that I am not talking about github settings , it's repo setting.

As you can see the last option displayed is "settings".

There would be another interface where different functionality were listed there, under "code and automation" we are looking for webhooks which is shown below.

Click on Webhooks, You will see the option to set payload url, secret which is not mandatory for beginners purpose. Select option to send me everything what does options does is it makes change for each and every little change in code to your end application. Set it active and save it.

Your webhook when setup is complete it will look something like this. Again note that the correct tick mark shown beside the url is not always displayed here , kindly wait for 5 -10 sec or reload the website .This step tells us that jenkins and github webhook are lively connected.

Let's take an example

I would demonstrate how webhook works, suppose we are in our github repository and I would like to change the text on our todo application from

"Made by:Aryan Verma" to "Developed by: Aryan"

After commit the changes by writing your changes in description. At the time you commit there will be an auto build up in jenkins.

When you head to jenkins webpage you will see an automatic build up query has been fired up as you can see in the image below where build 11 is now processing.

Head towards the localhost:8001 or wherever your application is running. This is my web app before changes.

The time you refresh, you will see a magic 🌟

The changes has been made on your live running web application on your local host.

Now heading back to jenkins, we can see the build no 11 has been got correct tick mark which means our build up has been successfull.

Conclusion

Webhooks play a crucial role in streamlining development workflows, especially when integrated with powerful tools like Jenkins. The real-time synchronization between GitHub and Jenkins ensures that your local web application reflects changes made on GitHub seamlessly, ultimately leading to a more efficient and collaborative development process.

Thanks for reading my blog.

Shape your reality with a positive mindset—where challenges become opportunities and setbacks are stepping stones to success

Did you find this article valuable?

Support CodeAryan by becoming a sponsor. Any amount is appreciated!