If we talk about PHP5 test and deployment, a solution come in mind Xinc, the continuous integration server in PHP5. The solution provides a built-in support to Subversion and Phing, and could be easily extended to work with alternative version control or build tools.

xinc-dashboardsample.png

The interest of Xinc is especially for projects with many developers working in the same time, everyone can commit changes to an SVN server, where Xinc listen to changes and triggers different build script if a change is detected. After building the project, Xinc reacts on the result of the build. Depending on whether the build was successful or failed it triggers special publishing scripts, which can deploy software, send notification emails or create deliverables.

Xinc runs as a daemon process in the background processing multiple projects. The projects itself are defined in xml and make use of tasks (defined in Plugins) to run the build process.

Installing Xinc

The easiest way to install Xinc is using PEAR :

    pear channel-discover pear.xinc.eu
pear install VersionControl_SVN-alpha
pear install --alldeps xinc/Xinc-beta

Finally you need to run the post-installation script :

    pear run-scripts xinc/Xinc

Configuration scripts for Xinc

Once we have Xinc installed on our server, we can start creating the configuration file config.xml. First we create a project with the settings below :

    Name : XincProject
svn Repository : svn://svn.sample/trunk
project path : /var/xinc/projects/Xincproject

Then create /etc/xinc/conf.d/XincProject.xml :


    <?xml version="1.0"?>

    <xinc engine="Sunrise">
    <project name="XincProject">
    <property name="dir" value="${projectdir}/${project.name}" />
    <schedule interval="240" />
    <modificationset>
    <svn directory="${dir}" update="true" />
    </modificationset>
    <builders>
    <phingbuilder buildfile="${dir}/build.xml" />
    </builders>
    <publishers>
    <onfailure>
    <email to="[email protected]" subject="Build failed"
    message="Build of project failed" />
    </onfailure>
    <onsuccess>
    <email to="[email protected]" subject="Build success"
    message="Build of project was successful" />
    </onsuccess>
    </publishers>
    </project>
    </xinc>

Now you are ready to start xinc deamon from :

    /etc/init.d/xinc start

To test xinc simply make any change in your repository and commit. You should receive the first email within minutes concerning build success or failure.

More details on configurations files and xinc usage could be found at http://code.google.com/p/xinc/, documentation is available here :
http://www.xinc.eu/api/documentation/get/file/xinc/latest-successful/Enduser/index.html