Day 24 : Complete Jenkins CI/CD Project

Hello DevOps Enthusiasts! ๐
Welcome to Day 24 of our #90DaysOfDevOps challenge. Today, we're diving into a crucial task: setting up a complete CI/CD pipeline for your Node.js application using Jenkins. This project will not only enhance your DevOps skills but also be a great addition to your resume. Let's get started! ๐
Task 1: Setting Up the Project
Step 1: Fork the Repository
First, you need to fork the repository. This will create a copy of the project under your GitHub account, allowing you to make changes without affecting the original project.
Go to the repository URL.
Click on the "Fork" button in the upper right corner.
Select your GitHub account to fork the repository.
Step 2: GitHub Integration with Jenkins
Next, set up a connection between your Jenkins job and your GitHub repository.
Open Jenkins Dashboard.
Create a New Item: Enter a name for your job and select "Freestyle project
Configure GitHub Project:
- In the "General" tab, check "GitHub project" and enter your repository URL.


Source Code Management:
Select "Git" and enter your repository URL.
Add credentials if required.


Go to your GitHub profile settings.
Go to SSH & GPG keys, Click-on New SSH Key.


Add your private key here.

Click-on Build now


Task 2: Running the Application with Docker Compose
Step 1: Create a Docker Compose File
Docker Compose simplifies running multi-container Docker applications. Create a docker-compose.yml file in your project root:
version: '3'
services:
app:
image: node:14
working_dir: /app
volumes:
- .:/app
command: sh -c "npm install && npm start"
ports:
- "3000:3000"
Step 2: Configure Jenkins Job
Open Jenkins Job Configuration.
Build Triggers: Ensure "GitHub hook trigger for GITScm polling" is checked.
Build Environment: Check "Provide Node & npm bin/ folder to PATH".
Build Steps:
Execute Shell:
docker-compose up -d
Step 3: Run the Project
Save your Jenkins job configuration.
Click "Build Now" to trigger the build manually or push a change to your GitHub repository to trigger automatically via WebHooks.
Conclusion
Congratulations! You've successfully set up a complete CI/CD pipeline for your Node.js application using Jenkins and Docker Compose. This project showcases your ability to automate and streamline the development workflow, a valuable skill in any DevOps toolkit. Be sure to add this to your resume and share your success with the community.
Stay tuned for more exciting tasks as we continue our #90DaysOfDevOps journey. Keep pushing your limits and happy coding! ๐




