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)

Deconstructing an advanced .gitlab-ci.yml file

Now that we've configured GitLab to run continuous integration and continuous deployment with our example project, it's worth exploring a more advanced .gitlab-ci.yml file and breaking it down to make sure that we understand what all of the components do. To this end, here's an example file that uses more jobs and more advanced parameters:

image: bitnami/laravel:latest

services:
- postgres:9.6

variables:
POSTGRES_DATABASE: postgres
POSTGRES_PASSWORD: password
DB_HOST: postgres
DB_USERNAME: root

stages:
- test
- package
- deploy

php_unit_test:
stage: test
script:
- cp .env.example .env
- composer install
- php artisan key:generate
- php artisan migrate
- vendor/bin/phpunit
cache:
key: composer
paths:
- vendor/

js_unit_test:
stage: test
script:
- npm install
- npm run test

package_upload...