# Day 24 Task: Complete Jenkins CI/CD Project

## 📌 Task-01 Jenkins with Github Webhooks

**GitHub Webhook**  
GitHub webhooks are a way for GitHub to notify external systems, like web services or applications, about events that happen in a GitHub repository. They allow you to receive real-time updates whenever certain actions occur, such as pushing code, creating issues, or opening pull requests.

Fork the [https://github.com/Nikhil418/node-todo-cicd.git](https://github.com/Nikhil418/node-todo-cicd.git) repository from GitHub

Create a connection to your Jenkins job and your GitHub Repository via GitHub Integration.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1693213607564/8d7d7229-0523-4b93-9be6-0f7884aaf1d4.png align="center")

Check the GitHub hook trigger option to enable

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1693213632810/af3c5a6c-9685-46e5-b383-e148677ba170.png align="center")

Then go to the repo setting in that webhook and add a new webhook

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1693214398829/2dca3330-49f6-4c74-8179-1cdca94894b3.png align="center")

In payload URL add the URL [http://&lt;jenkins'\_server\_ip&gt;:8080/github-webhook](http://20.163.142.241:8080/github-webhook)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1693214478173/8f5bcc3c-2b84-4dc0-ba03-399201efff7f.png align="center")

Successfully connected GitHub webhook to Jenkins server

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1693214743753/bc2edef8-b7ef-4de4-9698-767ca4a603b3.png align="center")

Added build steps to execute

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1693215924917/da57bbf0-e847-4816-a347-0ddcdc0b6847.png align="center")

verify in browser

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1693216280209/0814f243-384f-4823-98c2-92c1cdabbf41.png align="center")

Now make changes in the GitHub repo and commit

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1693216346510/4f33db76-f866-4bf4-8833-2322a808b7fd.png align="center")

After changes are detected it automatically triggers build

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1693216412321/0f250435-4503-4969-abe7-52bbecf1a46e.png align="center")

## 📌 Task -02 **docker-compose with GitHub Webhooks**

Add Github repo URL to take code from GitHub

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1693217605378/2c188f6f-2619-404e-8512-97f7f1dca13a.png align="center")

Successfully connected GitHub webhook to Jenkins

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1693229185512/7c22e2dd-6c6a-4bf0-ae70-65414a4ae84d.png align="center")

Added build steps

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1693227458182/80bfc26b-4927-4e43-b008-052115cf7bb3.png align="center")

Successfully run docker-compose

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1693229516722/bc93a7cf-2b41-4f98-9fd1-d7578f1f3f04.png align="center")

Verify in the browser app successfully running

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1693231828005/6631a0e7-b087-4c66-8ee1-5bb3516c1d3f.png align="center")
