Day 80 Project-1
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-01
Jenkins CI/CD pipeline with GitHub Webhook integration for Deploying Docker applications on EC2 instances using the declarative pipeline
Step — 1 Install Java
sudo apt update
sudo apt install openjdk-11-jre
Step — 2 Install Jenkins
sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \
https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
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
Unlock Password Jenkins
cat /var/lib/jenkins/secrets/initialAdminPassword
Step — 4 Ipaddress:8080
Make sure port 8080 is been added to a security group
Go to ec2 instance
cat /var/lib/Jenkins/secrets/initialAdminPassword
Now Click on, “Install Suggested Plugins”
Install the suggested plugins.
Step — 5 Setting Up Free style Project in Jenkins and generating ssh-keygen so that github communicate with jenkin server.
Jenkins Dashboard, Click on “New Item”.
Step — 7 Creating Webhook using jenkins payload URL and selecting build triggers.
http://YOUR_HOSTNAME:8080/github-webhook/
Step — 8 Test build
Happy Learning!