This article begins to introduce the simple use of Jenkins. For the installation of Jenkins, please refer to Getting Started with Jenkins-Installation; Example: In the linux environment, the installed jenkins, integrated svn, tomcat environment, the project is a maven project. |
Jenkins configuration
On the Jenkins home page, click Manage Jenkins, then click Manage Plugins to install the necessary plugins, svn, maven, ssh, etc.
Then on the Jenkins home page, click Manage Jenkins, then click Global Tool Configuration tool configuration, configure JDK, Maven, etc.
Jenkins uses
Step 1: Create a new task on the homepage, fill in the task name, and select a free-style project
The second step, the project name, can not be modified
Step 3: Add svn address, and set up, user name and password
Step 4: When building, there are two situations
Case 1, use maven to build the project and use the plug-in to publish
After construction, use the plug-in to publish the project and release the project. The plug-in that needs to be used for project release is (Deploy to container Plugin). To publish to tomcat, you need to use the user name and password of tomcat. Tomcat users can configure it in the conf/tomcat-users.xml file in tomcat
tomcat-users.xml configuration
Case 2, use the shell command to build the project, and then publish it directly with the command . When executing tomcat startup, you need to add the command export BUILD_ID=dontKillMe
Jenkins build output results