Day 24: Complete Jenkins CI/CD Project
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
Open your GitHub repository in your browser.
Go to the repository's "Settings" tab.
Select "Webhooks" from the left-hand menu.
Click on the "Add webhook" button.
In the "Payload URL" field, enter the Jenkins job URL you noted down earlier.
For "Content type," choose "application/json."
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.
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.