Introduction
Welcome back to the 90DaysOfDevOps Challenge! On Day 24, I delved into the world of Continuous Integration and Continuous Deployment (CI/CD), crafting a seamless pipeline for my Node.js application. Let's dive into the tasks accomplished today.
Task-1: Setting Up the Node.js CI Job
Prerequisite: Java Installation
Before diving into the CI/CD pipeline, I ensured that Java was installed on the agent server to meet the necessary prerequisites.
Agent Creation for Offloading
To optimize resource utilization, I created a dedicated Ubuntu agent, offloading the workload from the default server. The agent was configured with SSH credentials for secure communication.
Name of the node
Remote root dir-->working dir on agent server
Launch Through SSH --> Host is Agent IP
Node.js Job Configuration
The heart of the CI/CD process was setting up a job for my Node.js application on the newly created Ubuntu agent. This job was seamlessly integrated with GitHub using a webhook, ensuring that any changes to the repository triggered the CI pipeline.
JOB-->Node-Todo-CICD
Integrated with GitHub
Using Build Triggers
SSH Agent-->ubuntu
Build Steps-->Execute Shell
Web-Hooks
Task-2: Dockerizing the Node.js Application
Prerequisites: Docker and Docker-Compose
For Task-2, I focused on containerizing my Node.js application. Docker and Docker-Compose were prerequisites, and I ensured their presence on the agent server.
Executing the Node.js Application with Docker Compose
In the execute shell, I ran the Node.js application using Docker Compose. This step aimed to encapsulate the application and its dependencies within containers for consistency across various environments.
Addressing Challenges
However, no journey is without challenges. Two hurdles emerged during this process:
Docker-Compose Absence:
Issue: The absence of Docker-Compose on the agent server.
Resolution: Installed Docker-Compose to ensure seamless execution of the Dockerized application.
Docker Permission Denied:
Issue: Encountered permission issues when running Docker commands.
Resolution: Rectified permissions to resolve the "Permission Denied" error, ensuring smooth integration with Docker.
Running Application:
-
Conclusion
Day 24 of the 90DaysOfDevOps Challenge marked a significant stride in my CI/CD journey. The optimized CI job for Node.js, coupled with Dockerization, sets the foundation for a robust and scalable deployment process. Stay tuned for more updates as the 90DaysOfDevOps Challenge continues to unfold!