Day 24 & 25 Task: Complete Jenkins CI/CD Project with Documentation

Day 24 & 25 Task: Complete Jenkins CI/CD Project with Documentation

Let’s make a beautiful CI/CD Pipeline for your Node JS Application 😍

💼Task: 1

Fork repository

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

Webhooks provide a way for notifications to be delivered to an external web server whenever certain actions occur on a repository or organization.

For GitHub-Webhook:

  1. Open the GitHub repository.

  2. Go to “settings” and then to “hooks”.

  3. Click the “Add webhook” button. Enter “<Jenkins url>//github-webhook/” Payload URL. Click on Add webhook.

💼Task: 2

  • In the Execute shell run the application using Docker compose

  • You will have to make a Docker Compose file for this Project

  • Run the project

Steps:

For the GitHub integration plugin

Click on Manage Jenkins >Manage plugin > Available plugin> GitHub integration > Install it

Create ssh public and private keys

Go to GitHub account > Account Settings >SSH and GPG keys>Enter public ip and add it

  1. Click on New Item on left panel >Enter item name and select freestyle project options >click on Ok

  2. Enter description > select checkbox Github project > enter github url of project

  1. In Source Code Management > select Git > enter github url> In credentials click on Add

  1. Select Github hook trigger for GITScm polling in Build trigger

  1. In build steps >select Execute shell > Enter commands of docker compose and save the configuration
echo "……Devops CI/CD Started………………"

docker-compose up -d

  1. Check the web-hook connection of the Github project, it should have a green checkmark.

  1. Access the URL

  2. Now make changes in code push to GitHub Master branch & jenkins will automatically build the code

📍 Conclusion :

In this blog, we cover how we can make a CI/CD pipeline Jenkins with the help of webhooks In the next blog, we will cover some advanced topics.

Thank you for reading!

Contact me on Linkedin 🤝

Check out my GitHub for more resources 📚