Test and Deploy PHP Applications Automatically on IBM Bluemix

Continuous delivery is pretty awesome. There’s no fiddling about manually packaging or transferring code; instead, your code is automatically packaged and deployed on an ongoing basis, and you can see (and test) the results within a few minutes of making a change.

Up until recently, if you were using Bluemix, you needed to rely on external or third-party services coupled with various custom scripts to implement continuous delivery for your Bluemix applications. To make things easier, a Bluemix Continuous Delivery service was recently introduced, which comes tightly integrated with Bluemix out of the box and which provides a secure, automated way to build, test, and deploy your Bluemix applications.

I recently had an opportunity to try the new Bluemix Continuous Delivery service with a PHP application on GitHub. In my usage scenario, I wanted my target Bluemix deployment to always reflect the latest “tests passed” version of the PHP application’s dev-master branch.

The basic process I settled on was:

  • Each time a pull request is created in the GitHub source repository, the source code will be automatically tested by Travis CI with PHPUnit to ensure all unit tests pass.
  • If the unit tests pass, the pull request will be manually or automatically merged into the repository’s development branch. This merge will automatically trigger a new deployment of the application on Bluemix using a Bluemix Continuous Delivery toolchain.
  • If the unit tests fail, the pull request will not be merged and the current deployment on Bluemix will remain unaffected.

Here’s what the process looks like:

Sounds interesting? To find out how to do the same for your Bluemix applications, read my IBM developerWorks article which has a complete walkthrough of the steps.

PHP and Bluemix at the IBM Bluemix Meetup Dubai

I’ll be speaking at the IBM Bluemix Dubai user group meeting next week.

  • Using PHP with IBM Bluemix (Mon Aug 28 2017 at 19:00)
    This session covers the basics of developing and deploying PHP applications on IBM Bluemix. It will be based heavily on my experiences working with different IBM Bluemix services, which I’ve also described in various articles. It will include a hands-on coding demonstration that you can follow along with on your laptop.

If you’re in Dubai next weekend, please drop by, grab a cup of coffee and say hello!

Update: Slides are now available, as are photos of the event.