Hudson
Hudson only needs a Java 5 or newer runtime. Stand alone model:
1. You can simply run the command line: Java -jar hudson.war
2. To see Hudson, simply bring up a web browser and go to URL http://myServer:8080 where myServer is the name of the system running Hudson.
Deploy Hudson in web container
Sometimes, installing the Hudson in web container is a better choice. Hudson also uses the 8080 port. It will cause confliction if you also use tomcat and Hudson seperatelly.
1. Copy hudson.war to C:\apache-tomcat-7.0.23\webapps, and startup the tomcat server by clicking C:\apache-tomcat-7.0.23\bin\startup.bat.
2. To see Hudson, simply bring up a web browser and go to URL http://myServer:8080/hudson, where myServer is the name of the system running Hudson.
Note: We’d better add this environment variable for tomcat. CATALINA_OPTS=-Xmx1024m -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -XX:MaxPermSize=256m
Sonar Plug-in for Huson
Copy the sonar.hpi into %HUDSON_HOME%\plugins. And restart the Tomcat server. Then the sonar plug-in will take effective in Hudson.
Sonar
1. Create database Save the following script as create_database.sql, and execute it on mysql command line tool.
- #
-
#CreateSonardatabaseanduser.
- #
- #Command:mysql-uroot-p<create_database.sql
- #
-
CREATEDATABASEsonarCHARACTERSETutf8COLLATEutf8_general_ci;
-
CREATEUSER'sonar'IDENTIFIEDBY'sonar';
-
GRANTALLONsonar.*TO'sonar'@'%'IDENTIFIEDBY'sonar';
-
GRANTALLONsonar.*TO'sonar'@'localhost'IDENTIFIEDBY'sonar';
-
FLUSHPRIVILEGES;
#
# Create Sonar database and user.
#
# Command: mysql -u root -p < create_database.sql
#
CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'sonar' IDENTIFIED BY 'sonar';
GRANT ALL ON sonar.* TO 'sonar'@'%' IDENTIFIED BY 'sonar';
GRANT ALL ON sonar.* TO 'sonar'@'localhost' IDENTIFIED BY 'sonar';
FLUSH PRIVILEGES;
2. unzip the distribution to C:\
3. If you do not use the default embedded database, edit conf/sonar.properties to configure the database access. Templates are available for every supported database. Just uncomment the lines you want.
- sonar.jdbc.url:jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8
- sonar.jdbc.driverClassName:com.mysql.jdbc.Driver
-
sonar.jdbc.validationQuery:select1
- sonar.jdbc.username:sonar
- sonar.jdbc.password:sonar
sonar.jdbc.url: jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8
sonar.jdbc.driverClassName: com.mysql.jdbc.Driver
sonar.jdbc.validationQuery: select 1
sonar.jdbc.username: sonar
sonar.jdbc.password: sonar
4. You can run sonar in standalone model by click C:/sonar-2.12/bin/windows-x86-32/ StartSonar.bat, and it will take port 80, you can use it by this link http://localhost:80/sonar. But we strongly recommend that you deploy it in web container. Let’s see
the next step.
5. Add environment variable CATALINA_OPTS with value
-Xmx1024m -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -XX:MaxPermSize=256m
6. Click C:\sonar-2.12\war\build-war.bat to create a war file. And then copy the sonar.war to C:\apache-tomcat-7.0.23\webapps
Note: do NOT remove C:\sonar-2.12 after you deployed war file. The original folder is still useful.
Prior to Sonar 2.2, the WAR file must be rebuilt each time the configuration is updated (new plugins or new extensions).
From Sonar 2.2 onwards, the WAR file is now linked to the Sonar directory (the directory where the distribution is unzipped). It implies that : •the directory where the distribution is unzipped cannot be removed
•there is no need to rebuild the WAR when installing/uninstalling plugins or rule extensions
•the WAR file must be deployed on the host which contains the Sonar directory
•the WAR file must be rebuilt when the Sonar directory is moved
•the WAR file must be rebuilt when a configuration file is updated (directory conf/)
7. Restart the tomcat server. Access sonar by http://localhost:8080/sonar .
1. Hudson needs some disk space to perform builds and keep archives. By default, this is set to windows user folder “ /.hudson”, but you can change this by adding environment variable “HUDSON_HOME".
2. Open http://localhost:8080/hudson/ , and click “Manage Hudson” at left side, and then click “Configure system” to setup global configurations. Some of the configurations are required; you cannot build successfully if you ignore them.
JDK: configure the java_home of java runtime.
Maven: specify the maven home path.
3. If you have installed sonar.hpi, you can see the following segment in the “Configure system” page.
set the following fields:
Server URL : http://localhost:8080/sonar/
Database URL: jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8
Database Driver: com.mysql.jdbc.Driver
Database login: sonar
Database password: sonar
4. At the same page, you can also set value for the “SMTP server”, so that Hudson will send mails to notify you when the build is broken or someone submitted error code to the SVN server.
5. and click “New Job” at left side. Give a name of the project and choice Build a Maven 2/3 project (Legacy), click “OK” button to navigate to next page.
6. At the “Source Code Management” choose the “SVN” option, specify value for “Repository URL”, and you will be asked for username and password later. You’d better specify the full path directly point at the project source folder, so that Hudson can find
the pom.xml easily without any further configurations.
e.g. svn://svnserver/SEC/projects/Megafon SNAP PoC/source code/trunk/brtconnector
7. If your workspace has the top-level pom.xml in somewhere other than the module root directory, specify the path (relative to the module root) here, such as parent/pom.xml.
If left empty, defaults to pom.xml
8. If you have installed sona.phi plug-in, select the checkbox before “Sonar” at the bottom of the page at “Post build Action” section.
9. Click the “Save” button to save all changes.
分享到:
相关推荐
### Hudson安装及其配置详解 #### 一、Hudson概述与作用 Hudson是一款非常流行的持续集成工具,主要用于自动化项目的构建、测试以及部署等流程。它能够实现项目的自动编译、打包、发布,并调用JUnit等测试框架进行...
Hudson 的优势在于其易于安装和配置,只需将 `hudson.war` 部署到Servlet容器,如Tomcat,即可开始使用,无需额外的数据库支持。 **Hudson 安装与使用** 1. **安装步骤** - 下载最新版的 `hudson.war` 文件。 - ...
### Hudson安装全过程详解 #### 一、前言 Hudson是一款开源持续集成工具,主要用于自动化构建、测试软件项目,支持多种SCM(如Git、SVN等),并且可以通过插件扩展功能。本文将详细介绍Hudson的安装过程,包括JDK...
【集成工具Hudson与Maven2的Hudson安装及配置】 持续集成(Continuous Integration, CI)是一种软件开发实践,强调开发人员频繁地将他们的代码更改集成到主分支,以尽早发现并解决潜在的问题。Hudson是一款开源的...
**一、Hudson安装** 1. **系统需求**: 首先确保你的系统满足Hudson的运行条件,通常它可以在Linux、Windows和Mac OS等操作系统上运行。 2. **下载安装包**: 访问Hudson官方网站或通过GitHub获取最新版本的Hudson ...
"Hudson安装详细步骤" Hudson是一款基于Java的持续集成工具,用于自动化构建、测试和部署软件项目。下面是Hudson安装的详细步骤: 一、下载Hudson 首先,需要从Hudson的官方网站下载最新版本的Hudson。当前最新...
【Hudson安装及使用手册】是一份详尽的指南,主要针对在Linux环境中部署和操作Hudson持续集成服务器。Hudson是开源的持续集成工具,它允许开发团队自动化构建、测试和部署软件,以提高软件开发效率和质量。本手册将...
【Hudson 安装配置详解】 Hudson 是一个开源的持续集成工具,它在软件开发过程中扮演着重要的角色,能够自动构建项目、执行测试并提供实时反馈,从而提高开发效率和代码质量。以下是对Hudson的详细安装配置步骤: ...
3. **Hudson安装**:下载Hudson的WAR文件,将其放置在Apache Tomcat或其他支持Servlet的Web服务器的webapps目录下。启动Web服务器,Hudson会自动解压并启动。 4. **Hudson配置**:访问Hudson的Web界面,完成初始...
这个资源包包含了Hudson的安装和配置指南以及Hudson的服务器应用文件,便于用户进行本地或远程安装。 首先,我们来详细了解Hudson的安装过程。Hudson的安装通常分为两个步骤:下载和启动。在提供的压缩包中,...
### Hudson安装配置手册知识点概述 #### 一、Hudson简介 Hudson是一种革命性的开源持续集成(CI)服务器,它吸取了以往CI服务器的经验教训,提供了简单易用且功能丰富的特性。Hudson的一个显著特点就是其易于配置,...
用户可以从官方网站下载 Hudson 的安装包,然后按照安装指南进行安装。在安装过程中,需要满足一些前提条件,如安装 JDK 和 ANT。此外,用户还需要配置 Hudson 的基本设置,如设置 JDK、ANT 和邮件信息。 2. Hudson...
- 易于安装和配置:Hudson 可以快速部署,与多种操作系统和应用服务器兼容。 - 强大的插件生态系统:提供了超过 1,000 个插件,覆盖各种工具和技术,如 Maven、Jenkins、Git 等。 - 用户友好的 Web 界面:方便管理和...
1. **Hudson安装** 安装Hudson通常涉及几个步骤:首先,下载最新版本的Hudson war文件,可以从官方网站获取。然后,将其放在一个支持Java的Web服务器(如Tomcat)的webapps目录下。启动服务器后,Hudson会自动生成...
使用这两个脚本时,你需要根据你的系统环境和Hudson安装位置进行适当的修改,例如调整`HUDSON_HOME`的路径,或者根据硬件资源调整JVM参数。修改完成后,你可以通过命令行以root权限运行`./start.sh`来启动Hudson,...
- **HUDSON_HOME**: 设置Hudson的配置文件目录,建议设为Hudson的安装目录,以便于管理和备份。 - **PATH**: 将Java和Ant的bin目录加入到系统PATH环境中。 - **CLASSPATH**: 将JDK的`tools.jar`加入到系统...
#### 五、Hudson安装与管理 1. **下载与安装**: - 下载Hudson安装包,并将其解压至指定目录。 - 运行Hudson服务,初次启动会引导用户完成基础配置。 2. **服务器配置**: - **Hudson Home Directory**:Hudson...
#### 二、安装前的准备与Hudson安装 **1. 安装前的准备** - **JDK安装:** 在安装Hudson之前,需要确保服务器上已安装Java Development Kit(JDK),因为Hudson基于Java运行。 **2. Hudson安装** - **安装...
Hudson 的安装和配置相对简单,仅需下载并安装 Hudson-war 包,然后配置 Jenkins 的插件和任务。 5. Sonar 安装和配置 Sonar 的安装和配置相对复杂,需要下载并安装 Sonar-server 和 Sonar-plugins,然后配置 ...