Travis integration of Drupal projects

Written by Noë Snaterse on 5th March 2015

What is Travis-ci?

From Wikipedia: “Travis CI is a open-source hosted, distributed continuous integration service used to build and test projects hosted at GitHub”.

What does this mean?

This means that we can automatically run tests once a push has been made to Github. So, let’s say we use a branching model loosely based on gitflow. What I mean is basically that we develop features in another branch than de master (or 7.x-1.x for Drupal).

But this means I have to develop my modules on Github?!

Yes. However, I would recommend you publish them on Drupal.org too, because this is where people trust modules to come from. Besides, Git is a distributed version control system, which means it is actually perfectly fine to have multiple remotes. Another advantage is that git tracks your open source contributions, which might be a kind of programmers portfolio.

So what I use is the origin remote in Drupal.org and another Github branch which is hosted on Github. I develop new features on a feature branch which I sync on Github, so whenever I push the feature branch Travis will run and I will know if the feature passes the build or fails.

How do we test Drupal modules with Travis?

This is actually a good question because Drupal uses a Simplest, and as such needs a whole Drupal installation to run. Well fortunately for us someone already did just that.

The installation is also pretty simple, just follow the steps in the readme file, and you are up and running.

Your thoughts

No comments so far

Devhouse Spindle