Jenkins Tomcat

broken image


  1. Jenkins Tomcat War
  2. Jenkins Tomcat Deploy Plugin
  3. War Tomcat

Java Setup

Since Jenkins is written in Java. Therefore, Java must be installed on your system. To download and install the Java, go to our previous chapter of this tutorial.

  • To install Jenkins on Tomcat, simply copy jenkins.war to $TOMCATHOME/webapps, then access If you are running Tomcat just to host Jenkins, then remove everything from $TOMCATHOME/webapps, and place jenkins.war as ROOT.war (Same case is important).
  • So, ideally, Jenkins needs to provide a mechanism to automate all these individual tasks, and that mechanism is known to build jobs in Jenkins. Subsequently, in this article, we will understand the various deep concepts of the Jenkins build jobs, by covering the details under the following topics.

Now, to set up the Java_Home environment variable on Windows click here.

Post-installation, you need to configure SSH server details so that Jenkins can connect the Tomcat container. In Jenkins, go to Dashboard Manage Jenkins Configure System and find SSH Servers. Enter details as shown below: Test your connection before saving the details.

Once the java has been installed properly on your system and Java environment variable has been set, then you can verify it by using the following commands:

Jenkins tomcat integration
C: echo %JAVA_HOME% C: javac -version C: java -version

The following output should come:

Tomcat Setup

Download Tomcat:

The official website to download the tomcat is http://tomcat.apache.org/.

When you click the given link, you will get the home page of the official tomcat website as given below:


Go to the link https://tomcat.apache.org/download-90.cgi to download the latest version of tomcat.


Go to the 'Binary Distributions' section and download the file according to your platform. Here I am using 64-bit Windows zip for my 64-bit Windows operating system.

Unzip the contents of the downloaded zip file.

Jenkins and Tomcat Setup

Integration
Jenkins tomcat 9

Copy the downloaded Jenkins.war file (downloaded from the previous section) and copy it to the webapps folder of the tomcat directory.


Now open the command prompt. From the command prompt, browse to the directory where the tomcat is located. Then, go to the bin directory of this tomcat folder and run the startup.bat file.

When you run the above command then following output will come:


Jenkins Tomcat War

And two more windows will open. i.e., 'Tomcat' window and 'Windows Security Alert' window. Click on Allow access button in Windows Security Alert Window.


Jenkins Tomcat Deploy Plugin

Once the processing is completed, the following line will come in the output of the Tomcat Window:

INFO [hudson initialization thread] hudson.TcpSlaveAgentListener.<init> JNLP slave agent listener started on TCP port 61779

War Tomcat

Jenkins Tomcat
C: echo %JAVA_HOME% C: javac -version C: java -version

The following output should come:

Tomcat Setup

Download Tomcat:

The official website to download the tomcat is http://tomcat.apache.org/.

When you click the given link, you will get the home page of the official tomcat website as given below:


Go to the link https://tomcat.apache.org/download-90.cgi to download the latest version of tomcat.


Go to the 'Binary Distributions' section and download the file according to your platform. Here I am using 64-bit Windows zip for my 64-bit Windows operating system.

Unzip the contents of the downloaded zip file.

Jenkins and Tomcat Setup

Copy the downloaded Jenkins.war file (downloaded from the previous section) and copy it to the webapps folder of the tomcat directory.


Now open the command prompt. From the command prompt, browse to the directory where the tomcat is located. Then, go to the bin directory of this tomcat folder and run the startup.bat file.

When you run the above command then following output will come:


Jenkins Tomcat War

And two more windows will open. i.e., 'Tomcat' window and 'Windows Security Alert' window. Click on Allow access button in Windows Security Alert Window.


Jenkins Tomcat Deploy Plugin

Once the processing is completed, the following line will come in the output of the Tomcat Window:

INFO [hudson initialization thread] hudson.TcpSlaveAgentListener.<init> JNLP slave agent listener started on TCP port 61779

War Tomcat

Now, open the browser and go the link: http://localhost:8080/jenkins. The following page will open:


The setup of Jenkins with Tomcat is successfully done.






broken image