Using GitLab CI
“ 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. ”
- Martin Fowler
Why GitLab CI?
Integration
Fully integrated with GitLab
Easy to start
A few lines in yml (YAML) inside of .gitlab-ci.yml and a bit clicks
Scalable
Concurrent jobs (in parallel), many runners, tagged runners
Isolated test environment
Using Docker containers
GitLab CI configuration
Is done via .gitlab-ci.yml le:
Example for NodeJS project:
nodejs_run:
stage: test
script:
- npm install
- npm test
How GitLab CI differs from
other CI's?
Runners
This is an application that processes builds. It receives commands
from GitLab CI.
It's possible to tag runners so jobs run on runners which can process
them (e.g. di erent OS)
Executors
Shell
Localy
Docker
Inside of Docker container
Docker-SSH
In Docker container communicating over SSH
SSH
On remote server using SSH
Stages
Used to group your jobs in stages to create multiple pipelines
Builds of next stage are run after success
Repo cleaning
By default, GitLab CI cleans build dir between builds for the sake of
concurrency
But we can preserve builds between builds (Hello, npm and
node_modules !)
Job concurrency
Jobs of the same stage run in parallel
Start using GitLab CI
Get runner first
A simple Ubuntu Server VDS can play this role.
Provision it via script:
# Gitlab CI multi runner
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.
apt-get install -y gitlab-ci-multi-runner
echo 'run "gitlab-ci-multi-runner register"'
Run gitlab-ci-multi-runner register and answer questions.
You can nd your unique registration token under Settings ---> Runners
section.
Add .gitlab-ci.yml to your repo
Example for nodejs:
nodejs_run:
stage: test
script:
- npm install
- npm test
Did you expect anything?
This is all!
Pro tips for usage
Use cache option in your
.gitlab-ci.yml to preserve dirs
or files
This line will cache all git untracked les and les in node_modules dir
cache:
untracked: true
paths:
- node_modules/
Build skip
Build will be skipped if your commit message contains [ci skip]
Validate your .gitlab-ci.yml
Using lint: gitlab.com/ci/lint
Advanced usage for JS projects
aka "extension"
How to save build stats for a
long time?
Bash scripts will save us!
Private static web server
(e.g. nginx)
Use it to store your coverage, static analysis, test cases info for a
long time
How to get your info
Collect your test coverage with istanbul (GH: )
(or isparta, GH: )
gotwarlost/istanbul
douglasduteil/isparta
Get your mocha test stats in HTML with reporter (GH:
)
mochawesome
adamgruber/mochawesome
Catch your static analysis with plato (GH: )es-analysis/plato
But how to export this info to
my static web server?
Use scriptsomekind bash
Use it like that (line in your .gitlab-ci.yml). npm test should generate
istanbul, mocha and plato reports.
my_gitlab_ci_job:
script:
- npm test
...
- /my/path/to/build-export.sh $CI_BUILD_ID $CI_PROJECT_DIR my-project-name
Why not use GitLab CI Web hooks? Because we need access to repository les
What about badges?
Use to generate SVG image (via bash script), then ...shields.io
... use bash script to save it into public web space
You can use private nginx server, but exclude is from auth for sure:
location ~* ((badge_maintainability.svg)|(badge_tests.svg)|(badge_coverage.svg))$ {
auth_basic off;
}
Add badge to your README.md. Example for mochawesome:
[![test status](http://path/to/latest/badge_tests.svg)](http://path/to/latest/mochawesome-reports
Questions?
THE END
Useful links:
-
-
-
-
- My email:
- Our organization on GitHub:
Docs for .gitlab-ci.yml
GitLab Runner repository README.md
Installation on linux
Our custom bash scripts
maxim.sysoev@lingvokot.com
github.com/Lingvokot

More Related Content

PPTX
Introduction to GItlab CICD Presentation.pptx
PDF
Gitlab ci, cncf.sk
PPTX
Gitlab CI/CD
PDF
Devops Porto - CI/CD at Gitlab
PDF
Continuous Integration/Deployment with Gitlab CI
PDF
Gitlab ci-cd
PDF
Introducing GitLab (September 2018)
PPTX
Git Lab Introduction
Introduction to GItlab CICD Presentation.pptx
Gitlab ci, cncf.sk
Gitlab CI/CD
Devops Porto - CI/CD at Gitlab
Continuous Integration/Deployment with Gitlab CI
Gitlab ci-cd
Introducing GitLab (September 2018)
Git Lab Introduction

What's hot (20)

PPTX
GitLab for CI/CD process
PDF
GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...
PPTX
GitLab.pptx
PDF
Gitlab, GitOps & ArgoCD
PPTX
Git & GitLab
PDF
Introduction to Github Actions
PDF
CI with Gitlab & Docker
PDF
What's New for GitLab CI/CD February 2020
PDF
Introducing GitLab
PPTX
GitOps - Modern best practices for high velocity app dev using cloud native t...
PDF
Gitops: the kubernetes way
PDF
GitOps and ArgoCD
PDF
Git training v10
PDF
Kubernetes GitOps featuring GitHub, Kustomize and ArgoCD
PDF
GitOps with ArgoCD
PDF
Introducing GitLab (June 2018)
PDF
Deploy Application on Kubernetes
PDF
GitOps with Gitkube
PPTX
Git and github
PDF
Intro to Git and GitHub
GitLab for CI/CD process
GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...
GitLab.pptx
Gitlab, GitOps & ArgoCD
Git & GitLab
Introduction to Github Actions
CI with Gitlab & Docker
What's New for GitLab CI/CD February 2020
Introducing GitLab
GitOps - Modern best practices for high velocity app dev using cloud native t...
Gitops: the kubernetes way
GitOps and ArgoCD
Git training v10
Kubernetes GitOps featuring GitHub, Kustomize and ArgoCD
GitOps with ArgoCD
Introducing GitLab (June 2018)
Deploy Application on Kubernetes
GitOps with Gitkube
Git and github
Intro to Git and GitHub
Ad

Similar to Using GitLab CI (20)

PDF
FOSDEM 2017: GitLab CI
PDF
Webinar - Unbox GitLab CI/CD
PDF
What's New in GitLab and Software Development Trends
PDF
Webinar - Continuous Integration with GitLab
PDF
A Ci Experience
PDF
Gitlab and Lingvokot
PDF
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
PDF
Introducing GitLab (September 2018)
PPTX
Continuous Integration & Development with Gitlab
PDF
Gitlab for JS developers (BrisJs meetup, 2019-Apr-01)
PDF
Portable CI wGitLab and Github led by Gavin Pickin.pdf
PPTX
Docker e git lab
PDF
Survival of the Continuist
PDF
Enterprise git
PDF
Continuous Integration
PDF
Let’s start Continuous Integration with jenkins
ODP
Continous integration
PDF
Jenkins vs GitLab CI
PPTX
Git reposirory descritiopn use this for demo p
PPTX
Continuous integration for open source distros v 3.0
FOSDEM 2017: GitLab CI
Webinar - Unbox GitLab CI/CD
What's New in GitLab and Software Development Trends
Webinar - Continuous Integration with GitLab
A Ci Experience
Gitlab and Lingvokot
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Introducing GitLab (September 2018)
Continuous Integration & Development with Gitlab
Gitlab for JS developers (BrisJs meetup, 2019-Apr-01)
Portable CI wGitLab and Github led by Gavin Pickin.pdf
Docker e git lab
Survival of the Continuist
Enterprise git
Continuous Integration
Let’s start Continuous Integration with jenkins
Continous integration
Jenkins vs GitLab CI
Git reposirory descritiopn use this for demo p
Continuous integration for open source distros v 3.0
Ad

Recently uploaded (20)

PDF
Practical Indispensable Project Management Tips for Delivering Successful Exp...
DOCX
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
PDF
Autodesk AutoCAD Crack Free Download 2025
DOC
UTEP毕业证学历认证,宾夕法尼亚克拉里恩大学毕业证未毕业
PPTX
Weekly report ppt - harsh dattuprasad patel.pptx
PDF
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
PDF
DNT Brochure 2025 – ISV Solutions @ D365
PDF
BoxLang Dynamic AWS Lambda - Japan Edition
PDF
Salesforce Agentforce AI Implementation.pdf
PDF
iTop VPN Crack Latest Version Full Key 2025
PPTX
Introduction to Windows Operating System
PDF
Introduction to Ragic - #1 No Code Tool For Digitalizing Your Business Proces...
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PPTX
Computer Software - Technology and Livelihood Education
PDF
Topaz Photo AI Crack New Download (Latest 2025)
PPTX
Cybersecurity: Protecting the Digital World
PPTX
Matchmaking for JVMs: How to Pick the Perfect GC Partner
PPTX
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
PDF
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
DOCX
How to Use SharePoint as an ISO-Compliant Document Management System
Practical Indispensable Project Management Tips for Delivering Successful Exp...
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
Autodesk AutoCAD Crack Free Download 2025
UTEP毕业证学历认证,宾夕法尼亚克拉里恩大学毕业证未毕业
Weekly report ppt - harsh dattuprasad patel.pptx
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
DNT Brochure 2025 – ISV Solutions @ D365
BoxLang Dynamic AWS Lambda - Japan Edition
Salesforce Agentforce AI Implementation.pdf
iTop VPN Crack Latest Version Full Key 2025
Introduction to Windows Operating System
Introduction to Ragic - #1 No Code Tool For Digitalizing Your Business Proces...
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
Computer Software - Technology and Livelihood Education
Topaz Photo AI Crack New Download (Latest 2025)
Cybersecurity: Protecting the Digital World
Matchmaking for JVMs: How to Pick the Perfect GC Partner
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
How to Use SharePoint as an ISO-Compliant Document Management System

Using GitLab CI