SlideShare a Scribd company logo
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

What's hot (20)

PDF
GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...
GITS Indonesia
 
PPTX
GitLab for CI/CD process
HYS Enterprise
 
PDF
CI with Gitlab & Docker
Joerg Henning
 
PDF
FOSDEM 2017: GitLab CI
OlinData
 
PDF
Git training v10
Skander Hamza
 
PPTX
Git & GitLab
Gaurav Wable
 
PDF
What's New for GitLab CI/CD February 2020
Noa Harel
 
PDF
Git and git flow
Fran García
 
PPTX
Introduction git
Dian Sigit Prastowo
 
PPTX
CI-CD WITH GITLAB WORKFLOW
AddWeb Solution Pvt. Ltd.
 
PDF
Introduction to Git and Github
Houari ZEGAI
 
PPTX
Intro to git and git hub
Venkat Malladi
 
PPTX
Git - Basic Crash Course
Nilay Binjola
 
PDF
CD using ArgoCD(KnolX).pdf
Knoldus Inc.
 
PDF
Default GitLab CI Pipeline - Auto DevOps
Rajith Bhanuka Mahanama
 
PPTX
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Rueful Robin
 
PDF
Formation autour de git et git lab
Abdelghani Azri
 
PDF
Introducing GitLab (September 2018)
Noa Harel
 
PPTX
Git One Day Training Notes
glen_a_smith
 
PDF
GitHub Actions in action
Oleksii Holub
 
GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...
GITS Indonesia
 
GitLab for CI/CD process
HYS Enterprise
 
CI with Gitlab & Docker
Joerg Henning
 
FOSDEM 2017: GitLab CI
OlinData
 
Git training v10
Skander Hamza
 
Git & GitLab
Gaurav Wable
 
What's New for GitLab CI/CD February 2020
Noa Harel
 
Git and git flow
Fran García
 
Introduction git
Dian Sigit Prastowo
 
CI-CD WITH GITLAB WORKFLOW
AddWeb Solution Pvt. Ltd.
 
Introduction to Git and Github
Houari ZEGAI
 
Intro to git and git hub
Venkat Malladi
 
Git - Basic Crash Course
Nilay Binjola
 
CD using ArgoCD(KnolX).pdf
Knoldus Inc.
 
Default GitLab CI Pipeline - Auto DevOps
Rajith Bhanuka Mahanama
 
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Rueful Robin
 
Formation autour de git et git lab
Abdelghani Azri
 
Introducing GitLab (September 2018)
Noa Harel
 
Git One Day Training Notes
glen_a_smith
 
GitHub Actions in action
Oleksii Holub
 

Similar to Using GitLab CI (20)

PDF
Webinar - Unbox GitLab CI/CD
Annie Huang
 
PDF
What's New in GitLab and Software Development Trends
Noa Harel
 
PDF
Webinar - Continuous Integration with GitLab
OlinData
 
PDF
A Ci Experience
Umut IŞIK
 
PDF
Gitlab and Lingvokot
Lingvokot
 
PDF
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Michael Lihs
 
PDF
Introducing GitLab (September 2018)
Noa Harel
 
PPTX
Continuous Integration & Development with Gitlab
Ayush Sharma
 
PDF
Introducing GitLab (June 2018)
Noa Harel
 
PDF
Gitlab for JS developers (BrisJs meetup, 2019-Apr-01)
Vladimir Roudakov
 
PDF
Portable CI wGitLab and Github led by Gavin Pickin.pdf
Ortus Solutions, Corp
 
PPTX
Docker e git lab
Gianluca Padovani
 
PDF
Survival of the Continuist
Paul Blundell
 
PDF
Enterprise git
Pedro Melo
 
PDF
Continuous Integration
Danilo Pianini
 
PDF
Let’s start Continuous Integration with jenkins
Tomohide Kakeya
 
ODP
Continous integration
Jeremy Wilken
 
PDF
Jenkins vs GitLab CI
CEE-SEC(R)
 
PPTX
Git reposirory descritiopn use this for demo p
shailesh patil
 
PPTX
Continuous integration for open source distros v 3.0
Sriram Narayanan
 
Webinar - Unbox GitLab CI/CD
Annie Huang
 
What's New in GitLab and Software Development Trends
Noa Harel
 
Webinar - Continuous Integration with GitLab
OlinData
 
A Ci Experience
Umut IŞIK
 
Gitlab and Lingvokot
Lingvokot
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Michael Lihs
 
Introducing GitLab (September 2018)
Noa Harel
 
Continuous Integration & Development with Gitlab
Ayush Sharma
 
Introducing GitLab (June 2018)
Noa Harel
 
Gitlab for JS developers (BrisJs meetup, 2019-Apr-01)
Vladimir Roudakov
 
Portable CI wGitLab and Github led by Gavin Pickin.pdf
Ortus Solutions, Corp
 
Docker e git lab
Gianluca Padovani
 
Survival of the Continuist
Paul Blundell
 
Enterprise git
Pedro Melo
 
Continuous Integration
Danilo Pianini
 
Let’s start Continuous Integration with jenkins
Tomohide Kakeya
 
Continous integration
Jeremy Wilken
 
Jenkins vs GitLab CI
CEE-SEC(R)
 
Git reposirory descritiopn use this for demo p
shailesh patil
 
Continuous integration for open source distros v 3.0
Sriram Narayanan
 
Ad

Recently uploaded (20)

PDF
The Next-Gen HMIS Software AI, Blockchain & Cloud for Housing.pdf
Prudence B2B
 
PDF
AI Software Development Process, Strategies and Challenges
Net-Craft.com
 
PDF
capitulando la keynote de GrafanaCON 2025 - Madrid
Imma Valls Bernaus
 
PDF
Rewards and Recognition (2).pdf
ethan Talor
 
PDF
Why Edge Computing Matters in Mobile Application Tech.pdf
IMG Global Infotech
 
PPTX
CV-Project_2024 version 01222222222.pptx
MohammadSiddiqui70
 
PPTX
IObit Driver Booster Pro 12.4-12.5 license keys 2025-2026
chaudhryakashoo065
 
PPTX
Agentforce – TDX 2025 Hackathon Achievement
GetOnCRM Solutions
 
PPTX
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
pcprocore
 
PDF
TEASMA: A Practical Methodology for Test Adequacy Assessment of Deep Neural N...
Lionel Briand
 
PDF
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
 
PDF
Mastering VPC Architecture Build for Scale from Day 1.pdf
Devseccops.ai
 
PDF
Which Hiring Management Tools Offer the Best ROI?
HireME
 
DOCX
Zoho Creator Solution for EI by Elsner Technologies.docx
Elsner Technologies Pvt. Ltd.
 
PDF
Azure AI Foundry: The AI app and agent factory
Maxim Salnikov
 
PPTX
Introduction to web development | MERN Stack
JosephLiyon
 
PDF
What Is an Internal Quality Audit and Why It Matters for Your QMS
BizPortals365
 
PDF
IObit Uninstaller Pro 14.3.1.8 Crack for Windows Latest
utfefguu
 
PDF
Best Software Development at Best Prices
softechies7
 
PDF
Code Once; Run Everywhere - A Beginner’s Journey with React Native
Hasitha Walpola
 
The Next-Gen HMIS Software AI, Blockchain & Cloud for Housing.pdf
Prudence B2B
 
AI Software Development Process, Strategies and Challenges
Net-Craft.com
 
capitulando la keynote de GrafanaCON 2025 - Madrid
Imma Valls Bernaus
 
Rewards and Recognition (2).pdf
ethan Talor
 
Why Edge Computing Matters in Mobile Application Tech.pdf
IMG Global Infotech
 
CV-Project_2024 version 01222222222.pptx
MohammadSiddiqui70
 
IObit Driver Booster Pro 12.4-12.5 license keys 2025-2026
chaudhryakashoo065
 
Agentforce – TDX 2025 Hackathon Achievement
GetOnCRM Solutions
 
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
pcprocore
 
TEASMA: A Practical Methodology for Test Adequacy Assessment of Deep Neural N...
Lionel Briand
 
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
 
Mastering VPC Architecture Build for Scale from Day 1.pdf
Devseccops.ai
 
Which Hiring Management Tools Offer the Best ROI?
HireME
 
Zoho Creator Solution for EI by Elsner Technologies.docx
Elsner Technologies Pvt. Ltd.
 
Azure AI Foundry: The AI app and agent factory
Maxim Salnikov
 
Introduction to web development | MERN Stack
JosephLiyon
 
What Is an Internal Quality Audit and Why It Matters for Your QMS
BizPortals365
 
IObit Uninstaller Pro 14.3.1.8 Crack for Windows Latest
utfefguu
 
Best Software Development at Best Prices
softechies7
 
Code Once; Run Everywhere - A Beginner’s Journey with React Native
Hasitha Walpola
 
Ad

Using GitLab CI