Recommended Server for Continuous Integration for a PHP Project

Recommended server for continuous integration for a PHP project

I have had good luck with phpUnderControl, which is based on CruiseControl.

What continuous integration tool suits for php?

Jenkins (formerly Hudson) is by far the best solution. It has a nice PHP integration (see http://jenkins-php.org/)

Hosted Continuous Integration for PHP?

There's a list of hosted continuous integration providers on Quora.

Some of them also support PHP:

  • circleci.com
  • drone.io
  • codeship.io (disclaimer: I'm one of the cofounders)
  • travis-ci.org

Setting up a deployment / build / CI cycle for PHP projects

I've been through buildbot, CruiseControl.net, CruiseControl and Hudson. All though I really liked CruiseControl*, it was just too much of a hassle with really complex dependency cases. buildbot is not easy to set up, but it's got a nice aura (I just like python, that's all). But hudson won over the former three because:

  1. It's just easy to set up
  2. It's easy to customize
  3. It looks good and got nice overview functionality
  4. It got point-and-click updates, for itself and all installed plugins. This is a really nice feature, that I appreciate more and more

Caveat: I only ever used linux as base for the above mentioned build servers (CC.net ran on mono), but they should all - according to the docs - run cross-platform.

Setting up a hudson server

Prerequisites:

  • Java (1.5 will serve you just fine)
  • Read access to the subversion server (I have a separate account for the hudson user)

From here, it's just:

java -jar hudson.war

This will run a small server instance right off your console, and you should be able to browse the installation at your http://localhost:8080, if you don't have anything else running on that port in advance (you can specify another port by passing the --httpPort=ANOTHER_HTTP_PORT option to the above command) and everything went well in the 'installation' process.

If you go to the available plugins directory (http://localhost:8080/pluginManager/available), you'll find plugins for supporting your above mentioned tasks (subversion support is installed per default).

If that has whet you appetite, you should install a java application server, such as tomcat or jetty. Installation instructions are available for all major application servers

Update: Kohsuke Kawaguchi has constructed a windows service installer for hudson

Setting up a project in hudson

The links in the following walk-through assumes a running instance of hudson located at http://localhost:8080

  1. Select new Job (http://localhost:8080/view/All/newJob) from the menu on the left
  2. Give the job a name and tick Build a free-style software project on the list
  3. Pressing 'ok' will take you to the configuration page of the job. All the options have a little question mark besides them. Pressing this will bring up a help text regarding the option.
  4. Under the option group 'Source Code Management' you would be using Subversion. Hudson accepts both url access as well as local module access
  5. Under the option group 'Build Triggers', you would use 'Poll SCM'. The syntax used here is that of cron, so polling the subversion repository every 5 minutes would be */5 * * * *
  6. The process of building the project is specified under the option group 'Build'. If you already have an ant build file with all the targets you need, you're in luck. Just choose 'Invoke ant' and write the name of the target. The option group supports maven and shell commands as well out of the box, but there is also a plugin available for phing.
  7. Tick off additional build actions in 'Post Build Actions', such as e-mail notifications or archiving of build artefacts.

For setting up processes for which hudson have no plugins, you can either call them directly through a shell script from within the build setup, or you could write you own plugin

Pitfalls:

  • If you have it produce build artefacts, remember to have hudson clean up after itself in regular intervals.
  • If you have more than 20 projects set up, consider not displaying their build status as the default main page on hudson

Good luck!

Continuous Integration Server: Hudson or Sismo?

The language match is not key in your hunt for the best CI server; it's all the features around:

  • source control
  • concurrent build
  • trigger build
  • notification

Even for simple project, Jenkins (the new name for Hudson) is easy to use and quick to install. Then it is really easy to scale Jenkins up by adding more nodes (satellite machine that can execute build) when you need to. Also Jenkins has hundreds of plugin for numerous task.

Have a look at Bamboo, Jenkins, TeamCity, and CruiseControl Features to compare some of the features of the big names (you might actually want to consider Bamboo, TeamCity or Cruise Control over Jenkins)

Choosing the correct CI Server for my needs

Have you seen/considered Hudson ?

https://hudson.dev.java.net/

If you're building your .NET project with NAnt for example, it has a plugin that may
allow it to serve your needs.

It integrates with most SCM systems, bug trackers, etc. and is extremely extensible.

In my experience, Hudson has been superior to Cruise* on most fronts. Anytime
I've needed to connect it to something else, someone has already created a plugin.

It's easy to configure, has plugins for most aspects of current software engineering
practices. It includes Winstone and can run completely standalone, or within any
Java App/Servlet container. I've had zero issues running it in Tomcat and Glassfish
for example.

Here's the list of its current plugins

http://wiki.hudson-ci.org/display/HUDSON/Plugins

It seems to meet your goals

* Needs to be able to live on the same server as our SCM system (SVN)

no problem

* The Server is (unfortunately) an XP Pro Machine.

I have not personally had any issues running the standalone variant on Win XP,
haven't tried it on other servers/containers on XP though.

* Needs to handle .NET builds.

Assuming NAnt meets your needs or you're already using it, should be good to go here
in short order

* Would like to have some profiling capability. Or the ability to add at a later date.

If existing plugins can't accommodate your needs, plugin framework is excellent and you
could roll your own.

* Budget, free preferred.

Free and actively developed/maintained

* While we're more than capable, configuration would be preferred to be easy.

Config is quick and easy.

* Our SVN web front end is using apache. Would like the CI's front end to do the same, but can deal with IIS otherwise.

This may be a sticking point, but if the included Winstone won't work, it needs an App/Servlet container.

I've converted a few projects to Hudson which were using CruiseControl, and haven't looked back. I also push it for new projects whenever possible.

Regards

What is your preferred php deployment strategy?

For PHP, SVN with Phing build scripts are the way to go. Phing is similar to ANT but is written in PHP, which makes it much easier for PHP developers to modify for their needs.

Our deployment routine is as follows:

  • Everyone develops on the same local server at work, every developer has a checkout on his machine back home as well.
  • Commits trigger a post-commit hook which updates a staging server.
  • Tests are ran on staging server, if they pass - continue.
  • Phing build script is ran:
  • Takes down production server, switching the domain to an "Under construction" page
  • Runs SVN update on production checkout
  • Runs schema deltas script
  • Runs tests
  • If tests fail - run rollback script
  • If tests pass, server routes back to production checkout

There's also phpUnderControl, which is a Continuous Integration server. I didn't find it very useful for web projects to be honest.

Designing a PHP Project and Pipeline

I think you're trying to tackle too much at once, and you're over-complicating it. Sketch out what you are trying to do on paper first, making it as simple as you possibly can. Then, make it even simpler. Throw away any ideas that are 'nice to have' in the first version (the axiom You Ain't Gonna Need It is very helpful here).

Your first aim is to develop a prototype that just about works. Do not get bogged down in fancy UI or learning clever technology unless it is absolutely essential to the success of your enterprise.

Also, approach possible users, or people you know in the field of your project, and ask them whether they think it is a good idea. Be willing to hear that the scope of the project needs refining.

Then, set up Git on your local machine, and get something working. Don't worry about whether you are doing it perfectly at first. If you actually have existing team members, push it to a remote Git site so they can pull from there1. A VPS with SSH access is suitable for this, it'll cost you a few GBP/USD per month. Learn branching and merging if you can, it is very useful.

When you have stuff taking shape, push to a test machine on the web (re-using the same VPS) and try it out there. Let some users onto it as early as you can, and release as often as you can.

It is a good idea to write tests, yes, but don't spend excessive time worrying about CI and your bug reporting mechanims before your prototype is ready.


1 Always keep an offsite backup, of course.

Speeding up PHP continuous integration build server on Hudson CI

I'm not a PHP expert at all, but you ought to be able to split your PHPUnit tests onto multiple Hudson slaves if you need to. I would just split your test suite up and run each subset as a separate, parallel Hudson job. If you have a machine with multiple CPUs / cores you can run multiple slaves on it.

One obvious thing you didn't mention - how about just upgrading your hardware, or taking a look at what else is running on the Hudson host and possibly taking up resources ?



Related Topics



Leave a reply



Submit