Hudson Continuous Integration Framework Memo

Hudson is a good thing for automatic construction (strictly speaking, it is only a part of continuous integration), a web project of java open source

environment
build: 1. Download: Download hudson from the official website, just a compressed package,

2. Run: java -jar hudson.war The default is port 8080. You can specify the port.
Of course, hudson.war can be placed in tomcat as a normal web project circle.

3. Initial success Browser access http://localhost:8080/hudson


4. Plug-in installation, provide many plug-ins, and download a few commonly used ones.


System
configuration: configure functions such as java, maven, git, svn, mail, etc.

Create a task
1. Add a new task, name, and select Discard Old Builds. Only 1 point is reserved each time. You can set it
. 2. Specify the svn path. If authentication is required, there will be a prompt. Of course, you can also set it in the user module.
3.build trigger: module, generally recommended build poll, */5 * * * *//5 minutes to detect an update
4. Build module choose how to build, support ant maven, etc.; then select the corresponding command such as ant ( clean jar) mvn (clean package site)
5.post-action Specifies to generate various reports, email notifications, depending on the configuration of the plugin, many depend on the build script, such as the report of the test case, the plugin needs to provide the corresponding Test- *.xml file, which is generated by compilation
6. After the task is created, you can choose to build immediately. You can view the command line during the build and track the build
. 7. The home page provides a view of the status and success rate. Click to view the build record of each project.

Several concepts of Hudson
1. Workspace, there is a concept of a workspace without creating a task, that is, the path of the checkout code from svn, which is usually located in the user directory, such as C:\Users\SYZ\.hudson\jobs\sls-security \workspace
2. Plugin, hudson's function depends on the plugin, you will be prompted to download the plugin for the first time, the plugin can be maintained in the management interface, the installation directory of the plugin: C:\Users\SYZ\.hudson\plugins

Several questions:
1. How to manage code that is not managed by cvs? You can put it directly in the workspace
2. Where are the generated files? It is placed in the workspace by default, and it needs to be downloaded manually. The build is successful, and it doesn't feel humane enough.
3. Where is the javadoc, if you select it, there is a menu of docment on the left
4. Visualization of the test report? , you need plug-ins, post-action selection corresponding items, and specify the path, remember that the build script needs to have this function.
5. How to do other plugins? Most of them are the same as the junit test report. Each configuration needs to be studied by yourself.



If
there is no hudson , strictly speaking, hudson is only responsible for continuous integration, not version construction. If there is no hudson, you can write a continuous integration framework. , including the following functions
1. svn checkout
2. Compile and package (ant, compile, report, jar, etc.)
3. Email function: Know the project team members
4. Periodic scheduling: Execute once a day
5. Deploy to container: Deploy and restart. .
6. Integrate into a bat file, start and execute

1 and 2 can be completed in ant's build.xml, 3 and 4 are completed in the corresponding java project, 5 and 6 are made into bat scripts

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326563676&siteId=291194637