Day 24: Complete Jenkins CI/CD Project

ยท

2 min read

Let's make a beautiful CI/CD Pipeline for your Node JS Application ๐Ÿ˜

Task-01: Setting Up Jenkins with GitHub for CI/CD using GiHub webhooks

Step-1: Fork this repository: github.com/LondheShubham153/node-todo-cicd...

Step-2: Create a connection to your Jenkins job and your GitHub Repository via GitHub Integration using git webhook. Add the git url of your project:

Now, Select "GitHub hook trigger for GITScm polling" in Jenkins:

Add the build steps

Configure GitHub Webhook

  1. Open your GitHub repository in your browser.

  2. Go to the repository's "Settings" tab.

  3. Select "Webhooks" from the left-hand menu.

  4. Click on the "Add webhook" button.

  5. In the "Payload URL" field, enter the Jenkins job URL you noted down earlier.

  6. For "Content type," choose "application/json."

  7. Select the events that you want to trigger the webhook. The most common event is "push," which triggers when code is pushed to the repository.

  8. Click "Add webhook" to save the webhook configuration.

To test the webhook, make a small code change in your GitHub repository and commit it:

Now, whenever you push code to your GitHub repository, the webhook will send a request to the Jenkins job's URL. This will trigger the Jenkins job automatically, running your specified build and deployment steps.

Checking on port 8000

Task-02: Seamless Application Deployment with Webhooks and Docker Compose

In the Execute shell run the application using Docker compose

Make a Docker Compose file for this Project

To test the webhook, make a small code change in your GitHub repository and commit it

It's working perfectly.

"Thank you for enjoying my DevOps blog! Your positive response fuels my passion to dive deeper into technology and innovation.

Stay tuned for more captivating DevOps articles, where we'll explore this dynamic field together. Follow me on Hashnode and connect on LinkedIn (https://www.linkedin.com/in/som-shanker-pandey/ for the latest updates and discussions.

Did you find this article valuable?

Support Som Pandey's blog by becoming a sponsor. Any amount is appreciated!

ย