Skip to content

In this project all the DevOps are integrated to moniter the application and check alerts

Notifications You must be signed in to change notification settings

deepeshmlgupta/DevOps_Swiggy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 DevOps Real-time Project: Swiggy Clone

This project is a Swiggy clone 🍔 built with DevOps practices for scalability and security. It leverages AWS for cloud hosting and Terraform for managing infrastructure. Jenkins automates the CI/CD pipeline, while SonarQube ensures code quality. Security is prioritized using tools like OWASP and Trivy, and Docker is used to containerize the application for easier deployment and scaling.

Project Overview

Swiggy Project

🛠️ Tools & Services Used:

  1. Terraform Terraform
  2. GitHub GitHub
  3. Jenkins Jenkins
  4. SonarQube SonarQube
  5. OWASP OWASP
  6. Trivy Trivy
  7. Docker & DockerHub Docker DockerHub

Cloning Project

git clone https://github.com/deepeshmlgupta/DevOps_Swiggy.git

Installation

Terraform Installation

sudo apt-get update && sudo apt-get install -y gnupg software-properties-common
wget -O- https://apt.releases.hashicorp.com/gpg | \
gpg --dearmor | \
sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \
https://apt.releases.hashicorp.com $(lsb_release -cs) main" | \
sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update
sudo apt-get install terraform

AWS CLI

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
aws --version

Connect Your AWS to Virtual Machine Now, connect you VM to you AWS account

aws configure
AWS Access Key ID = <access key>
AWS Secret Access Key = <secret access key> 

image

Now your AWS is connected with the VM but terrafrom will also connect the the AWS to run these command

export AWS_ACCESS_KEY_ID = <access key>
export AWS_SECRET_ACCESS_KEY = <secret access key> 

Terraform Execution

cd Terraform

This command will initlize the terrafrom script in the Virtal Machine

terraform init

image

This command will show you what all action your terraform script will perform on to your AWS Account

terraform plan 

After Checking the plan of terraform if all thing gos well then apply it

terraform apply -auto-approve

image

Docker

  • Let's first execute this project through Docker:
    • Provide permission to docker socket so that docker build and push command do not fail
      chmod 777 /var/run/docker.sock
    • Now, build the Dockerfile
      docker build -t Swiggy:latest . --no-cache
    • After the image is build successfully now run the docker container
      docker run -d --name swiggy -p 3000:3000 deepeshmlgupta/swiggy:latest

Note

Before running the jenkins pipeline you should make sure that you stop the current Docker Container

  • After the image is build successfully now run the docker container bash docker stop <container_ID>

Jenkins Setup

  • Go to Jenkins Master and click on Manage Jenkins --> Plugins --> Available plugins install the below plugins:
    • OWASP
    • SonarQube Scanner
    • Docker
    • Pipeline: Stage View
    • BlueOcean

  • Configure OWASP, move to Manage Jenkins --> Plugins --> Available plugins (Jenkins Worker) image

  • After OWASP plugin is installed, Now move to Manage jenkins --> Tools (Jenkins Worker) image

Sonar Setup

  • Login to SonarQube server and create the credentials for jenkins to integrate with SonarQube
    • Navigate to Administration --> Security --> Users --> Token image image image

  • Now, go to Manage Jenkins --> credentials and add Sonarqube credentials: image

  • Go to Manage Jenkins --> Tools and search for SonarQube Scanner installations: image

  • Go to Manage Jenkins --> System and search for SonarQube installations: image

Weebhooks

-Sonar Webhook

  • Login to SonarQube server, go to Administration --> Webhook and click on create image image
  • Github Webhook
    • Go to your github Repo, Setting --> Webhook and click on create image image

Jenkins Pipeline

  • Create a pipeline Swiggy-CICD image image
  • Now Click, Apply --> Save and click on Build Now image

About Me

Deepesh Profile Image

Deepesh Gupta
LinkedIn
GitHub


About

In this project all the DevOps are integrated to moniter the application and check alerts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published