DevOps (Day-80): Project-1Deploy a Project Webapp Application with help of Jenkins Pipeline, GitHub and Docker
Day 80:#90DaysOfDevOpsChallenge
Dear DevOps Engineers, In today's topic we will Deploy a Project Webapp Application with help of Jenkins Pipeline, GitHub and Docker.
Table of Contents
Project Description
Creating AWS Instance
Configure Docker and Jenkins on the Server
Project Steps: Automating pipeline of a Webapp
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.
Pre-requisties
Creating AWS instance
1 Navigate to the AWS Management console and provide the server name and choose the OS.
AWS Management console and provide the server name and choose the OS Diagram
AWS Management console and provide the server name and choose the OS Diagram
2 Select the instance type to configure the CPU and memory of the instance.
Select the instance type to configure the CPU and memory of the instance Diagram
3 Choose the existing or create a VPC for the server.
4 Select the disk size for the server to be attached.
Select the disk size for the server to be attached. Diagram.
Configure Docker and Jenkins on the Server
1 Write all the commands to pre-install Docker and Jenkins on the server after its spin-up.
Write all the commands to pre-install Docker and Jenkins on the server after its spin-up Diagram.
2 Now create the instance.
Now create the instance Diagram.
3 Log to the server and use systemctl command to check if docker is running.
Log to the server and use systemctl command to check if docker is running Diagram.
4 Now,use systemctl command to check if Jenkins is running.
Now,use systemctl command to check if Jenkins is running Diagram.
5 Open the port 8080 which is the default port to run Jenkins on the server.
Open the port 8080 which is the default port to run Jenkins on the server Diagram.
6 Navigate to the URL http://<publicIP>:8080
Navigate to the path and paste the admin password for first-time login to the Jenkins server.
Navigate to the path and paste the admin password for first-time login to the Jenkins server Diagram.
7 Install the Suggested plugin on the server.
Install the Suggested plugin on the server Diagram.
You can change the UserID and Password Diagram.
8 You can change the UserID and Password.
You can change the UserID and Password Diagram.
9 Now,Jenkins is ready to use. We are finally landed on the dashboard of Jenkins.
Now,Jenkins is ready to use. We are finally landed on the dashboard of Jenkins Diagram.
Now,Jenkins is ready to use. We are finally landed on the dashboard of Jenkins Diagram.
Project steps: Automating pipeline of a Webapp
1 On the Jenkins home page select the New Item.
On the Jenkins home page select the New Item Diagram.
2 Write the Project name and select the free-style Project.
Write the Project name and select the free-style Project Diagram.
3 Navigate to GitHub and take the Project URL and provides in the Jenkins Configuration.
Navigate to GitHub and take the Project URL and provides in the Jenkins Configuration Diagram.
Navigate to GitHub and take the Project URL and provides in the Jenkins Configuration Diagram.
4 To configure automation of deployment we need to install the plugin on Jenkins.
5 Navigate to Manage Jenkins and go to plugin and the available plugins. Install the plugin now.
Navigate to Manage Jenkins and go to plugin and the available plugins. Install the plugin now. Diagram.
Navigate to Manage Jenkins and go to plugin and the available plugins. Install the plugin now Diagram.
Navigate to Manage Jenkins and go to plugin and the available plugins. Install the plugin now Diagram
6 Navigate to GitHub and select Webhook. Use the below payload URL
http://<public-IP>:8080/github-webhook/
Navigate to GitHub and select Webhook. Use the below payload URL Diagram.
7 Generate the public key of the server.
Generate the public key of the server Diagram
8 Create the SSH Key in the GitHub and provide the public key of the server.
Create the SSH Key in the GitHub and provide the public key of the server Diagram.
9 Now Generate the Personal access token of GitHub to connect GitHub to Jenkins.
10 Navigate to GitHub settings and create the token.
Now Generate the Personal access token of GitHub to connect GitHub to Jenkins Diagram.
Now Generate the Personal access token of GitHub to connect GitHub to Jenkins Diagram.
11 Add the Credentials to Jenkins to create the Key.
Add the Credentials to Jenkins to create the Key Diagram
Add the Credentials to Jenkins to create the Key Diagram
12 In the Branches to build provide the main branch. Make sure to check the branch where the project currently needs to be deployed.
In the Branches to build provide the main branch. Make sure to check the branch where the project currently needs to be deployed Diagram.
13 As we have setup webhook previously,now select the webhook settings in the project configuration section in the Jenkins dashboard.
As we have setup webhook previously,now select the webhook settings in the project configuration section in the Jenkins dashboard Diagram.
14 Select the execute shell in the build steps.
15 Build the image and create the container through docker on the Jenkins pipeline.
Build the image and create the container through docker on the Jenkins pipeline Diagram.
16 Now,build the project. Check the console output to view the status.
Now,build the project. Check the console output to view the status Diagram
Now,build the project. Check the console output to view the status Diagram
17 Navigate to the URL and check for the web-application.
Navigate to the URL and check for the web-application Diagram.
Thank you for reading!! Hope you find this helpful.
#day80challenge#90daysofdevops
Always open to suggestions..!!
~ Manoj Bhamidipati ๐