Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sampathshivakumar/8776eab425db7e80e745602bdf0a6c9c to your computer and use it in GitHub Desktop.
Save sampathshivakumar/8776eab425db7e80e745602bdf0a6c9c to your computer and use it in GitHub Desktop.

Deploy-a-Java-Web-Application-to-Tomcat-Server-Using-Jenkins-with-Slack-Notification.

DevOps Pipeline Diagram:-

java web-app

Prerequisites:-

  • Tomcat Server up and running.
  • Jenkins Server up and running.
  • Jenkins Integration with Slack Notification.
  • A Java Project.

Reference:-

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.

1

2

In Git installations click Add git then select git.

3

4

Enter Name and Path to Git executable as below then click apply and save.

5

We have Successfully integrated Git with Jenkins.

Now go to Jenkins Dashboard select Manage Jenkins then click on Global Tool Configuration.

2

In Maven installations click Add Maven and give name and select Install automatically then Appy and Save.

6

Maven is also Successfully integrated with Jenkins.

Install Deploy to container Plugin.

10

11

Add Tomcat user credentials in Jenkins Secrets.

You can check it in tomcat-user.xml 12

Go to Manage Jenkins and Click on Credentials.

13

Select System.

14

Select Global credentials (unrestricted).

15

Select Add Credentials.

16

Enter username and password.

17

Once done you should see like this.

18

Now lets create a Jenkins job.

7

9

19

20

Provide Build details.

21

In Post-build Actions click Add Post-build Actions and Select Slack Notification and select following and click apply and save.

22

In Post-build Actions click Add Post-build Actions and Select Deploy war/ear to container.

26

Enter the details as following then click on apply and save.

27

Now Click Build Now.

23

Build Successfull.

24

Slack Notifications.

25

Output.

28

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment