Using a Continuous Build Server With PHP

See Also 

The IDE supports creating and starting build jobs using the Hudson build server. Hudson's usefulness for PHP projects is that it allows PHPUnit tests to be performed automatically according to a schedule.

For more information about setting up and using a Hudson build server, see the following documents.

The Jenkins build server should also work with the IDE, though this is not as well tested.

Hudson Administrator

Hudson is usually run on a remote machine. This section contains information for the administrator of the Hudson or Jenkins host machine.

In order for Hudson (or Jenkins) to be used with PHP and to provide test results, the Hudson or Jenkins server should be set up with the plugins described on the web page. (Hudson has equivalent plugins.) The host machine for the Hudson or Jenkins server should also have PHP and PEAR installed with the PHP plugins listed on the Template for Jenkins Jobs for PHP page.

Adding a Hudson Instance.

  1. Right-click the Hudson Builders node in the Services window and choose Add Hudson Instance.
  2. Type the Name for the instance that will be displayed under the Hudson Builders node.
  3. Specify the server URL, the auto-refresh setting. Click Add.

After you add a Hudson instance, a node for the instance is added below the Hudson Builders node. You can expand the node to view the status of builds on that instance.

Setting Up a PHP Project to be Built

For a PHP project to build on Hudson, the project must have the following set up:

You also need to have PhpProject Wizard (PPW) installed on your local machine. Use PEAR to install PPW. See the page.

PHP Options for Hudson

To set PHP options, open Tools > Options > PHP (NetBeans Preferences > PHP on Mac) and go to the Hudson tab.

Setting Up a New Build Job.

  1. Choose Team > Create Build Job from the main menu.
    Alternatively, in the Services window, right-click the Hudson instance you want to use and choose New Build.
  2. Select the build server instance from the dropdown list.
  3. Specify the name for the build job.
  4. Select the project from the dropdown list.

    The build server will use the sources in the project's repository.

  5. Click Create. The IDE generates build.xml and phpunit.xml.dist files in the project.
  6. Commit the project's new build.xml and phpunit.xml.dist files in your version control system.

After you supply the details for the build, you can start the build process on the server by right-clicking the build that you want to start and choosing Start Job. When a job is building, the node for the job is displayed as running. You can expand the node for the job to view past builds and build artifacts.

For details about using PHP with a continuous integration server, see the following NetBeansPHP blog entry.

See also
About PHP Projects
Working with PHP

Legal Notices