Update March 2020 - I’ve given written a newer more updated version of this article, check it out over here.


Gitlab provides some good documentation on getting build runners for your projects set up which can be found here. However I haven’t found a good article on setting up Gitlab CI for PHP applications yet.

This article is not going to discuss setting up shared runners on Gitlab since I felt the documentation provided by them in the link above was easy enough to follow, what this I am going to focus on is the .gitlab-ci.yml configuration that I’m currently using in my projects to do the following:

  • Run PHP CS against our code base to ensure that it conforms to PSR-2
  • Run PHPUnit against our code base to ensure that our unit tests pass against different versions of PHP (5.6, 7.0, 7.1)
Continue reading

Update May 2017, looks like with the Gitab update to V9, which uses a new Gitlab API v4, Packages will not let you enable new repositories

I’ve made amendments to the necessary files and packages on this fork:

https://github.com/talvbansal/packages on the “gitlab” branch.

As long as you change step 2 in the guide below everything should work as expected:

git clone https://github.com/talvbansal/packages
cd packages
git checkout gitlab
composer install -o --no-dev

After moving our source control server from gitolite to a privately hosted gitlab instance the next thing I wanted to do was get our internal Satis server to automatically update whenever code was pushed to a repository.
Continue reading


Where I work, we’ve been using an Ubuntu Server running gitolite to act as our “Source control server” and manage permissions and access. Its worked well, and after some initial configuration (which I recall being pretty tricky) looking after the gitolite instance has been pretty easy and could easily continue to serve our needs as a small business well.

Adding new users required you to get an ssh key from the new user, add it to an “administration repository” and then add their name to a config file within that repository. The same config file could then be used to determine which access rights they had to repositories as well as defining new repositories.

We also use a satis install to act as a private composer for our internal private packages.

One of the things gitolite doesn’t provide you with is any sort of front end at all, everything has to be done through the terminal. It also requires you to have all of the following tools separately:

  • Issue tracker
  • File browser
  • Activity stream
  • Pull request management

Which are all features that github has built in natively.

Continue reading
Author's picture

Talv Bansal

Full Stack Developer, Part Time Photographer

Head of Software Engineering