Day 80 Task: Project-1

Day 80 Task: Project-1

Streamlining Software Delivery for Faster, Reliable Deployment

Project Description

The project aims to automate the building, testing, and deployment process of a web application using Jenkins and GitHub. The Jenkins pipeline will be triggered automatically by GitHub webhook integration when changes are made to the code repository. The pipeline will include stages such as building, testing, and deploying the application, with notifications and alerts for failed builds or deployments.

🔶 Task: Automated CI/CD Pipeline with Jenkins and GitHub

Jenkins Setup:

  • Install and configure Jenkins on your server or a cloud-based instance.

#Step - 1 Install Java
#Update your system
sudo apt update
#Install java
sudo apt install openjdk-11-jre
#Validate Installation
java -version
#It should look something like this
#openjdk version "11.0.12" 2021-07-20 OpenJDK Runtime Environment (build 11.0.12+7-post-Debian-2) OpenJDK 64-Bit Server VM (build 11.0.12+7-post-Debian-2, mixed mode, sharing)

#Step - 2 Install Jenkins
#Just copy these commands and paste them onto your terminal.
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \
  /usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
  https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
  /etc/apt/sources.list.d/jenkins.list > /dev/null

sudo apt-get update
sudo apt-get install jenkins


#Step - 3 Start jenkins
sudo systemctl enable jenkins
sudo systemctl start jenkins
sudo systemctl status jenkins

#Step - 4 Unlock jenkins

sudo cat /var/lib/jenkins/secrets/initialAdminPassword

GitHub Repository Setup:

  • Clone a GitHub repository for your web application.

https://github.com/Chandreshpatle28/node-todo-cicd-jenkins.git

Create a connection to your Jenkins job and your GitHub Repository via GitHub Integration.
To generate the SHH key for integration use the shh-keygen command for public and private keys.

To create a Public key we have to use cat /home/ubuntu/.ssh/id_rsa.pub

To configure the GitHub Goto account setting < SHH and GPG keys and paste the ssh-rsa key here.

GitHub Webhook Integration:

  • Set up a webhook in your GitHub repository to trigger Jenkins when code changes are pushed.

  • Configure the webhook to respond to push events

Read About GitHub WebHooks and make sure you have a CICD setup.

For webhook go to github repo's setting < Webhooks and add webhook

To install GitHub integration plugins go to the Jenkins dashboard > Manage Jenkins > Plugins

Jenkins Pipeline Configuration:

  • Create a Jenkins pipeline to define your CI/CD workflow.

Add git repo to clone https://github.com/Chandreshpatle28/node-todo-cicd-jenkins.git

In the Execute shell run the application using Docker Compose.

Install docker and docker on your instance.

Do some changes and see the auto trigger on the Jenkins build.

Conclusion:

In conclusion, the implementation of an automated CI/CD pipeline using Jenkins and GitHub has transformed our web application development and deployment process. This project has brought about several key advantages and represents a significant milestone in our quest for efficient and reliable software delivery. Here's a summary of the project's outcomes:

Streamlined Workflow: The automated pipeline seamlessly integrates code changes, builds, tests, and deployments, eliminating the need for manual intervention at various stages. This has significantly reduced human errors and accelerated our development cycle.

Enhanced Code Quality: By incorporating automated testing into our pipeline, we've raised the bar for code quality. Our tests catch issues early in the development process, ensuring that only reliable and robust code is deployed.

Swift Deployment: The project's deployment stage, coupled with Docker containerization, allows us to deploy our web application swiftly. We can confidently roll out updates and new features to our users with minimal downtime.

Visibility and Monitoring: Jenkins' monitoring capabilities have provided us with real-time visibility into the status of each build and deployment. This monitoring has proven invaluable in swiftly identifying and addressing issues.

Cost-Efficiency: While it might seem counterintuitive, the project has led to cost savings. Automated pipelines reduce the need for extensive manual labor, which can be expensive and error-prone.

Greater Collaboration: GitHub webhook integration ensures that every member of our development team is informed about code changes and deployment status. This increased transparency has fostered better collaboration among team members.

Future Expansion: As our web application continues to grow, this automated CI/CD pipeline offers scalability. We can easily add new stages and features to accommodate future development needs.

Overall, the project has been a resounding success, empowering our team to deliver better-quality software more rapidly. The automated CI/CD pipeline has not only brought operational efficiency but has also elevated the standard of our web application. As we move forward, we're committed to maintaining and enhancing this pipeline to meet the evolving demands of our application and its users.


Happy Learning :)

Stay in the loop with my latest insights and articles on cloud ☁️ and DevOps ♾️ by following me on Hashnode, LinkedIn (https://www.linkedin.com/in/chandreshpatle28/), and GitHub (https://github.com/Chandreshpatle28).

Thank you for reading! Your support means the world to me. Let's keep learning, growing, and making a positive impact in the tech world together.

#Git #Linux Devops #Devopscommunity #90daysofdevopschallenge #python #docker #Jenkins #Kubernetes #Terraform #AWS #Grafana

Did you find this article valuable?

Support Chandresh Patle's Blog by becoming a sponsor. Any amount is appreciated!