Hudson_CI: PHP continues integration

Source: Internet
Author: User
Tags php continuous integration
Hudson_CI: PHP continuous integration 1. there are many concepts of continuous integration on the Internet, so I will not detail them here. CI is short for continuous integration. continuous integration is frequent and continuous integration in the work of multiple team members, and feedback is given. A typical continuous integration cycle includes the following steps :?? 1. the continuous integration server continuously checks on the version control server for continuous integration with PHP on behalf of Hudson_CI.

1. concept of continuous integration

There are a lot of concepts online, so I will not detail them here.

CI is short for continuous integration. continuous integration is frequent and continuous integration in the work of multiple team members, and feedback is given. A typical continuous integration cycle includes the following steps:
?? 1. the continuous integration server constantly checks the code status from the version control server to see if the code is updated.
?? 2. if the code has been submitted to the latest version, download the latest code from the version control server.
?? 3. after the code is completely updated, call the automated compilation script to compile the code.
?? 4. run all automated tests.
?? 5. perform code analysis.
?? 6. generate executable software that can be provided to testers for testing.
?? Continuous Integration server, such as CruiseControl or VSTS
?? CruiseControl, Anthill, Bamboo, TeamCity, Continuum, hudson

II. Overview of hudson

Hudson is a revolutionary open-source CI server that has learned a lot from its previous CI servers. One of the most attractive features of Hudson is its ease of configuration: it is difficult to find a CI server that is easier to set, and it is also difficult to find a CI server with such rich out-of-the-box features. The second reason Hudson is easy to use is that it has a powerful plug-in framework, so it is easy to add features. For example, a Hudson plug-in can track FindBugs and code overwrite over time. It can also report the trend of test results (from JUnit or TestNG) and build results and corresponding execution time.

Hudson needs to run Java 5. To use a container other than the embedded container (Winstone) that comes with Hudson, you only need to use a Servlet 2.4 container. Winstone is sufficient in most cases.

?

?

?

?

?

?

?

?

?

?

?

Http://download.oracle.com/auth/otn-pub/java/jdk/7/jdk-7-linux-x64.tar.gz? E = 1315298113 & h = 13590cea0d85730ad003c4b86a96ff7f


Http://mirror.bjtu.edu.cn/apache/tomcat/tomcat-7/v7.0.21/bin/apache-tomcat-7.0.21.tar.gz


Http://www.oschina.net/p/hudson/

Http://hudson-ci.org/download/
Http://hudson-ci.org/download/plugins/



Http://xdebug.org/download.php
Http://xdebug.org/files/xdebug-2.1.2.tgz



Http://pear.php.net/package/PHP_CodeSniffer/download
Http://download.pear.php.net/package/PHP_CodeSniffer-1.3.0.tgz


Php directory/usr/local/lib/php/

===========================================/Tmp/hudson

-------------------- JDK
The jdk1.6.0 _ 23 directory is generated in the current directory. copy the directory to the specified directory/usr/local/jdk.


??? Set the environment variable vim. bash_profile ?? Export JAVA_HOME =/usr/local/jdk
??? Settings ~ /. Bashrc: alias java = "/usr/local/jdk/bin/java"


Java-version




----------- Tomcat

1 .??? Download the tar.gz package at the tomcat site, for example:
Apache-tomcat-6.0.29.tar.gz
2 .??? Run the command to decompress: tar zxf apache-tomcat-6.0.29.tar.gz to generate the apache-tomcat Directory
? Mv apache-tomcat-7.0.21 apache-tomcat
3 .??? Modify the conf/server. xml file:
?????????????? ConnectionTimeout = "20000"
?????????????? RedirectPort = "8443" type = "regxph" text = "yourobjectname"/>
??? To:
??? ?????????????? ConnectionTimeout = "20000"
?????????????? RedirectPort = "8443"
URIEncoding = "UTF-8"/>
??? (Modified based on the character set of the test machine)
4 .??? Run bin/startup. sh to start tomcat and check whether Port 8080 is listened.
5 .??? Access url: http: // host-url: 8080/at the front end. if a cat is installed, the installation is successful.



------------- Hudson

Copy hudson. war to the webapps directory under the tomcat Directory

Access http: // host-url: 8080/hudson. if the user sees that hudson is loading, the configuration is successful.

System Management-system configuration? Install jdk and remove automatic installation. java_home:/usr/local/jdk


By default, hudson's data workspace is installed in ~ /. Hudson


Hudon restart
Cd/tmp/hudson/apache-tomcat
Java-jar webapps/hudson/WEB-INF/hudson-cli.jar-s http: // 192.168.1.95: 8080/hudson restart


--------------- Install the hudson plugin

Http://hudson-ci.org/download/plugins/

Install phing
Http://hudson-ci.org/download/plugins/phing/0.7/phing.hpi
Obtain the hpi file
Go to Hudson? Plug-in management? -- Advanced
Install by using the Upload plug-in
Restart Hudson to complete installation


Phing plug-in configuration ??????????????????
Http://www.phing.info/trac/wiki/Users/Download


----------------- Xedug ????????????????
Http://xdebug.org/download.php


2 .??? Execute pear install xdebug-2.1.0.tgz
3 .??? If no xdebug. so exists under/path/to/php5/lib/php/extensions/, copy xdebug. so to the preceding directory.
4 .??? Modify php. ini and add:
[Xdebug]
Extension = xdebug. so
5 .??? Write a php script:
Phpinfo ();

Set to test. php
Run the script: php test. php | grep-I xdebug
If an output is displayed, the installation is successful.




------------------- Create a job









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.