Reader small image

You're reading from  GitLab Quick Start Guide

Product typeBook
Published inNov 2018
PublisherPackt
ISBN-139781789534344
Edition1st Edition
Tools
Concepts
Right arrow
Author (1)
Adam O'Grady
Adam O'Grady
author image
Adam O'Grady

Adam O'Grady hails from the remote Perth, Western Australia, and can usually be found on Twitter at @adamjogrady or in meatspace wrangling with code. His first taste of programming came from building games into graphics calculators at high school, and quickly developed into a passion. A few years later, while doing social media marketing for an ISP, his first big break arrived; building custom applications to monitor and respond to social feeds. After that, he spent a few years working for the government building systems that used satellite and geographic data to spot and predict bushfires, and now you can find him leading a small team of engineering mavens at a local health start-up.
Read more about Adam O'Grady

Right arrow

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...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
GitLab Quick Start Guide
Published in: Nov 2018Publisher: PacktISBN-13: 9781789534344

Author (1)

author image
Adam O'Grady

Adam O'Grady hails from the remote Perth, Western Australia, and can usually be found on Twitter at @adamjogrady or in meatspace wrangling with code. His first taste of programming came from building games into graphics calculators at high school, and quickly developed into a passion. A few years later, while doing social media marketing for an ISP, his first big break arrived; building custom applications to monitor and respond to social feeds. After that, he spent a few years working for the government building systems that used satellite and geographic data to spot and predict bushfires, and now you can find him leading a small team of engineering mavens at a local health start-up.
Read more about Adam O'Grady