Book Image

GitLab Quick Start Guide

By : Adam O'Grady
Book Image

GitLab Quick Start Guide

By: Adam O'Grady

Overview of this book

Gitlab is an open source repository management and version control toolkit with an enterprise offering. This book is the ideal guide to GitLab as a version control system (VCS), issue management tool, and a continuous integration platform. The book starts with an introduction to GitLab, a walkthrough of its features, and explores concepts such as version control systems, continuous integration, and continuous deployment. It then takes you through the process of downloading and installing a local copy of the on-premise version of GitLab in Ubuntu and/or CentOS. You will look at some common work?ows associated with GitLab work?ow and learn about project management in GitLab. You will see tools and techniques for migrating your code base from various version control systems such as GitHub and SVN to GitLab. By the end of the book, you will be using Gitlab for repository management, and be able to migrate projects from other VCSs to GitLab.
Table of Contents (10 chapters)

Adding .gitlab-ci.yml to our example project

We've added tests to our ROT13Formatter project, but now we need to get those tests to be automatically executed in GitLab (either GitLab.com or our own hosted instance). To do this, let's create a file called .gitlab-ci.yml in our project and add the following to it:

before_script:
- apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq ca-certificates git php php-xml
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
- php composer-setup.php
- php composer.phar install

phpunit:
script:
- vendor/bin/phpunit tests/ROT13FormatterTest

This exact file was discussed in the previous section, so we know that it simply executes a series of commands to configure the Runner and then runs one task that executes our tests. Now save, commit, and...