Jenkins - 1
Jenkins - 1
Components:
Amazon Clone Website: A fully functional web application mimicking the functionality of
Amazon's e-commerce platform.
CI/CD Pipeline:
AWS EC2 Instance: Hosts the NGINX web server and runs the deployed Amazon clone
website.
NGINX: Web server responsible for serving the Amazon clone website.
GitHub Token: Credentials used to securely integrate GitHub with Jenkins for automated
builds.
Architecture:
KAVIT DEEPAK MEHTA
Problem Definiton:
Developing and deploying web applications can be time-consuming and error-prone
without automation. Manual deployment processes often lead to inconsistencies, delays,
and configuration issues. This project solves these challenges by automating the entire
process, from code push to deployment, using Jenkins and a CI/CD pipeline. This ensures
faster, more reliable, and repeatable deployments.
Steps:
# Install OpenJDK 17
java -version
# Install Jenkins
3. Access Jenkins
● Copy the Public IP Address of the EC2 instance and paste it into a browser followed
by :8080.
o Example: http://43.205.241.55:8080
● Use the initialAdminPassword located in
/var/lib/jenkins/secrets/initialAdminPassword.
● Follow the Jenkins setup steps:
o Click Install Suggested Plugins.
o Create a username, password, and provide email details.
KAVIT DEEPAK MEHTA
● In Jenkins:
o Navigate to Manage Jenkins → Configure System.
o Scroll down to GitHub Server:
▪ Name: GitHub
▪ API URL: https://api.github.com
▪ Credentials: Add the Personal Access Token.
▪ Kind: Secret Text
▪ Secret: (Paste the personal access token).
▪ ID: Jenkins-For-CICD.
KAVIT DEEPAK MEHTA
Scroll Down
KAVIT DEEPAK MEHTA
KAVIT DEEPAK MEHTA
Go Back To Jenkins:
KAVIT DEEPAK MEHTA
● In GitHub:
o Go to Repository Settings → Webhooks → Add Webhook.
o Payload URL: http://43.205.241.55:8080/github-webhook/
o Content Type: application/json.
o Add the webhook.
● In Jenkins:
o Go to the kdm-amazon-clone Job.
o Under Build Triggers, enable GitHub hook trigger for GITScm polling.
KAVIT DEEPAK MEHTA
KAVIT DEEPAK MEHTA
● Make a change in the GitHub Repository (e.g., modify index.html) and commit it.
KAVIT DEEPAK MEHTA
● Jenkins will automatically trigger the build process, and the web application should
reflect the changes in real-time.
KAVIT DEEPAK MEHTA
BEFORE:
AFTER:
Expected Outcome:
The expected outcome is an Amazon clone website hosted on an NGINX server running on
an AWS EC2 instance. The CI/CD pipeline will be configured to automatically build, test,
KAVIT DEEPAK MEHTA
and deploy new code to the EC2 instance upon any changes in the GitHub repository,
ensuring an efficient, automated deployment process.