Skip to main content

Posts

Showing posts with the label Jenkins: deploying war file to tomcat

JENKINS: DEPLOYING WAR FILE TO TOMCAT

Assume we have tomcat installed and running on our server. Also assume that jenkins is installed and we have a job ready or preparing artifact. We assume that copy artifact and deploy to container plugin is already installed.Otherwise install it from Manage jenkins > Manage plugins. First of all we will create a user role in tomcat for jenkins to access.For that open tomcat-users.xml file and make following changes. #vi /opt/tomcat/conf/tomcat-users.xml Now restart tomcat service. #service tomcat restart Now open jenkins. We will create a new job to copy the war file that we already prepared and deploy it in tomcat server. Here our first job is packaging job where we had build and created a war file from source code. Now we will create another job named deploy job to deploy it to tomcat container. Under build section select Copy artifacts from another project . Now give our previous project name which is packaging job.Under Artifact to copy give **/*.war which means ...