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)