PNLUG

Gitlab CI/CD

OpenTalk 2018

Cristian Pavan | Stefano Morandi
2018-05-30

Who we are

Cristian Pavan

Drupal e devops specialist

FLOSS entusiast

MySQL cluster destroyer

Stefano Morandi

Senior GNU/Linux Sysadmin

FLOSS entusiast

Fanatic Debian geek :-D

Introduction

Dev nowadays

Software moves fast

More complex stack (no more LAMP only)

Clients want new features…

…and want them now!

Methodologies

  • XP
  • Agile
  • Scrum
  • Kanban
  • … and more

Methodologies

DevOps

Sorry, your browser does not support SVG.

Methodologies

Focus on

  • small iterations
  • comunication
  • teamwork
  • metrics
  • tests

CI | Definition

Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day.
Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible – Martin Fowler

CI | Benefits

  • Minimize the cost of integration
  • Reproducible procedures
  • Rapidly exposing failures
  • Report healt of the code base

CD | Definition

Continuous Delivery is a software engineering approach in which continuous integration, automated testing, and automated deployment capabilities allow software to be developed and deployed rapidly, reliably and repeatedly with minimal human intervention. Still, the deployment to production is defined strategically and triggered manually. – Gitlab

CD | Definition

Continuous Deployment is a software development practice in which every code change goes through the entire pipeline and is put into production automatically, resulting in many production deployments every day. It does everything that Continuous Delivery does, but the process is fully automated, there’s no human intervention at all.

Delivery vs Deployment

codeproject_ci_cd.png

CD | Benefits

  • Minimize the cost of deployment
  • Reproducible procedures
  • Rapidly exposing failures
  • Feedback
  • Friday 5pm deployments
  • No more pauses

xkcd_303_compiling.png

CI/CD | How

  • Must use a version control system (git)
  • Automated ALL the things!
  • Tests, lot of tests
  • Dashboard

Gitlab

Introduction

All you can eat!

gitlab_devops_lifecycle.png

Gitlab-CI

gitlab_cicd_pipeline.png

Pipelines and jobs

A (CI/CD) pipeline is an automated expression of your process for getting software from version control right through to your users and customers - jenkins.io

Pipelines and jobs

A pipeline is a group of jobs that get executed in stages(batches).

gitlab_pipelines.png

Runner

It run jobs and sends the results to GitLab CI

Could be runs everywhere

gitlab-ci.yml

image: php:5.6

before_script:
- apt-get update -yqq && apt-get dist-upgrade

services:
- mysql

test:mysql:
  script:
  - vendor/bin/phpunit --configuration phpunit_mysql.xml

But… it makes you happy?

Sure!

harold-1.jpg

Sources

Sources

License Information

Except where otherwise noted, this work, “Gitlab CI/CD”, is © 2018, under the Creative Commons license CC BY-SA 4.0.

Cristian Pavan

Stefano Morandi