PHP Build Task from Cory Fowler’s DevOps PHPWorld Presentation


As you may have seen from the DevOps presentation I have been hanging out with Cory lately…

For his PHPWorld Presentation we teamed up to see how hard it would be to get our DevOps demo working with PHP.  Specifically creating a CI build for PHP and as part of that pipeline run a load test…turns out it was a piece of cake and it took longer to write this post than get it set up!!

Below are the steps to create a release pipeline with PHP using Composer and Visual Studio Online

Step 1. Check in your PHP Project


In this case we used Cory’s super simple Composer Sample

Step 2. Add a Custom Build Task in VSO to Package your PHP Application

Creating a custom build task is pretty straightforward and requires these steps

  1. Download the Build Task sample: Composer.Zip from here
  2. Install Npm
  3. Install the TFX-CLI by running: npm install -g tfx-cli
  4. Run tfx login. (requires PAT which can be created using these directions
  5. tfx build tasks upload ./ComposerTask

(Jeff Bramwell did a great post on creating a Build task…If you go through his walk through just be aware the **tfx build tasks create **is currently broken so I have uploaded my sample here)

Step 3. Create a Build that Uses the Composer Task created above

1. One the Build Task hit the green action button and select the “Empty” Template


2. As this build will require PHP and Composer to installed on the Build agent please Press Next and select the on premises agent as described in Cory’s blog and then press Create


3. Adding a task to your Build you will see in the Package category the Composer Task created in Step 2.  While there are options you send to composer the default will package your PHP application.


4. Verify the deployment was successful

Adding a quick web performance test will easily tell you whether your deployment was successful (Oft times that packaging and deploying will “succeed” but the application has run time issues)


Set up the parameters for your quick performance test:


To create a registered Connection you must go to control panel add a generic service…


I always seem to forget this!  Directions for setting that are here:


At this time you are ready to save and QUEUE NEW BUILD BABY!




Discussion is closed.

Feedback usabilla icon