|
|
@@ -0,0 +1,115 @@ |
|
|
## Deploy-a-Java-Web-Application-to-Tomcat-Server-Using-Jenkins-with-Slack-Notification. |
|
|
### **DevOps Pipeline Diagram:-** |
|
|
 |
|
|
|
|
|
### Prerequisites:- |
|
|
* **Tomcat Server up and running.** |
|
|
* **Jenkins Server up and running.** |
|
|
* **Jenkins Integration with Slack Notification.** |
|
|
* **A Java Project.** |
|
|
|
|
|
### Reference:- |
|
|
|
|
|
* **Tomcat Setup** https://github.com/sampathshivakumar/Installations/blob/main/Tomcat%20Installation%20on%20Amazon-Linux-2.md |
|
|
* **Jenkins Setup** https://github.com/sampathshivakumar/Installations/blob/main/Jenkins%20Installation%20on%20Amazon-Linux-2.md |
|
|
* **Jenkins Integration with Slack Notification** https://github.com/sampathshivakumar/Integrating-Jenkins-with-Slack-Notifications |
|
|
* **Java Project** https://github.com/sampathshivakumar/Java-Web-Apps.git |
|
|
|
|
|
### Install Git in Jenkins Server. |
|
|
``` |
|
|
# Become a root |
|
|
sudo su - |
|
|
|
|
|
# Install git. |
|
|
yum install git -y |
|
|
|
|
|
# Check Version of git. |
|
|
git version |
|
|
``` |
|
|
### Open Jenkins in web-browser, click on manage jenkins then select Global Tool Configuration. |
|
|
 |
|
|
|
|
|
 |
|
|
|
|
|
### In Git installations click Add git then select git. |
|
|
 |
|
|
|
|
|
 |
|
|
|
|
|
### Enter Name and Path to Git executable as below then click apply and save. |
|
|
 |
|
|
|
|
|
**We have Successfully integrated Git with Jenkins.** |
|
|
|
|
|
### Now go to Jenkins Dashboard select Manage Jenkins then click on Global Tool Configuration. |
|
|
 |
|
|
|
|
|
### In Maven installations click Add Maven and give name and select Install automatically then Appy and Save. |
|
|
 |
|
|
|
|
|
**Maven is also Successfully integrated with Jenkins.** |
|
|
|
|
|
### Install Deploy to container Plugin. |
|
|
 |
|
|
|
|
|
 |
|
|
|
|
|
### Add Tomcat user credentials in Jenkins Secrets. |
|
|
|
|
|
**You can check it in tomcat-user.xml** |
|
|
 |
|
|
|
|
|
### Go to Manage Jenkins and Click on Credentials. |
|
|
 |
|
|
|
|
|
### Select System. |
|
|
 |
|
|
|
|
|
### Select Global credentials (unrestricted). |
|
|
 |
|
|
|
|
|
### Select Add Credentials. |
|
|
 |
|
|
|
|
|
### Enter username and password. |
|
|
 |
|
|
|
|
|
### Once done you should see like this. |
|
|
 |
|
|
|
|
|
### Now lets create a Jenkins job. |
|
|
 |
|
|
|
|
|
 |
|
|
|
|
|
 |
|
|
|
|
|
 |
|
|
|
|
|
### Provide Build details. |
|
|
 |
|
|
|
|
|
### In Post-build Actions click Add Post-build Actions and Select Slack Notification and select following and click apply and save. |
|
|
 |
|
|
|
|
|
### In Post-build Actions click Add Post-build Actions and Select Deploy war/ear to container. |
|
|
 |
|
|
|
|
|
### Enter the details as following then click on apply and save. |
|
|
 |
|
|
|
|
|
### Now Click Build Now. |
|
|
 |
|
|
|
|
|
### Build Successfull. |
|
|
 |
|
|
|
|
|
### Slack Notifications. |
|
|
 |
|
|
|
|
|
### Output. |
|
|
 |
|
|
|
|
|
## Project is Successfully Completed. |
|
|
|
|
|
**Thank you for reading this post! I hope you found it helpful. If you have any feedback or questions,Please connect with me on LinkedIn at https://www.linkedin.com/in/sampathsivakumar-boddeti-1666b810b/. Your feedback is valuable to me. Thank you!** |