Continuous integration of Jenkins hot-Deploy Java program via deploy plugin (ix)

Source: Internet
Author: User

I. BACKGROUND

The students who have seen my Jenkins series blog should know that the previous Java program was posted to the server via SSH, through the shell script, but sometimes we do not have the permissions of the server, only the management rights corresponding to Tomcat, directly through the Tomcat management console The release of the war package program, also known as hot release, does not require the restart of Tomcat during the release process.

How to do this, please look down.

Second, Tomcat configuration 1, open the administrative user
    • Tomcat does not have such a user by default and needs to TOMCAT_HOME/conf/tomcat-users.xml add manager-script groups and corresponding users, adding the following lines:

      <role rolename="manager-script"/><user username="wzlinux" password="wzlinux" roles="manager-script"/><role rolename="manager-gui"/><user username="wzadmin" password="wzlinux" roles="manager-gui"/>
    • Or, for the sake of simplicity, get an account with a large authority, such as the following:
      <role rolename="manager"/><role rolename="manager-gui"/><role rolename="manager-script"/><role rolename="admin"/><user username="wzlinux" password="wzlinux" roles="admin,manager,manager-script,manager-gui"/>

Note: You will need to restart Tomcat to take effect when configured.

2. Login Tomcat Backstage

Only manager-gui users with roles are able to manage background permissions, and Jenkins deploys only the role manager-script .

Visit our intranet server address Http://10.0.0.11:8081/manager, enter your account password to login to view.

We can see the projects that are running, we can delete them through undeploy, and then deploy them through our methods below.

Third, Jenkins configuration 1, download plug-ins

Download the plugin Deploy to container .

2. Add Deploy Build

Open our previous Wenjuan project and operate the selection after the build Deploy war/ear to a container .

3. Configure Deploy Build

war/ear Files: Is the relative path to the war package (relative to the workspace path, which is the relative path of the war package in the workspace), as my Maven execution completes and the project is built in the target directory of the workspace. WAR, so here's my path to write tar Get\ project. War.
Content Path: The release path of Tomcat, which uses localhost/(the name of the content path setting) to access the project.
Containers: Select Tomcat 7.x,credentials to add the user we added above Tomcat, the Tomcat URL is the address of the page where we normally access Tomcat.
Deploy On Failure: whether to publish to Tomcat when an error occurs.

Iv. test Results 1, view build log

The log allows you to see the deployment succeed.

2. View server

3. View Tomcat background

Without any problems, the hot deployment was successful.

Continuous integration of Jenkins hot-Deploy Java program via deploy plugin (ix)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.