SlideShare a Scribd company logo
1 of 27
Download to read offline
Gitlab CI Hands-on experience
Ivan Rimac
COPYRIGHT
Barrage — Visual identity © Barrage d.o.o. 2020. All Rights Reserved.
About the speaker
- Background in programming
- 8 years of experience
- Currently @ barrage.net - Osijek - Croatia
- Specialized in devops practices and security
- Successfully using Gitlab CI in production over 6 years
2
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Intro
Why did we started practicing DevOps
- Shift from occasionally performed, to routinely performed
- Enabled via automation - automation isn't the goal it’s the technique to achieve
the goal
- Drive consistency
- Detect problems early
- Remove friction
- Increase your bus factor!
Intro | Pipeline configuration | Pipeline reuse | Pipeline controls
3
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Intro
Gitlab CI configuration management
- Pipeline configuration
- DAG
- Parent/Child
- Multi-project
- Pipeline component reuse
- Before and after scripts
- Includes, templates and extends
- Pipeline controls
- Variables
- Rules
Intro | Pipeline configuration | Pipeline reuse | Pipeline controls
4
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Intro
Pipeline configuration - basic
Intro | Pipeline configuration | Pipeline reuse | Pipeline controls
5
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline configuration
All jobs in a Stage must
complete successfully before
proceeding to the next stage
Pipeline configuration - with options
Intro | Pipeline configuration | Pipeline reuse | Pipeline controls
6
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline configuration
This job has
`allow_failure: true`
…so the pipeline proceeds
even though job failed
This job has
`when: manual`
...so it waits for someone
with the permission to click
a “Play” button”
Pipeline configuration - Directed Acyclic Graph (DAG)
Intro | Pipeline configuration | Pipeline reuse | Pipeline controls
7
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline configuration
Pipeline configuration - DAG visualization
Intro | Pipeline configuration | Pipeline reuse | Pipeline controls
8
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline configuration
Pipeline configuration - DAG visualization
Intro | Pipeline configuration | Pipeline reuse | Pipeline controls
9
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline configuration
Pipeline configuration - Parent/Child pipelines for
Monorepos
Intro | Pipeline configuration | Pipeline reuse | Pipeline controls
10
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline configuration
Run the job if there are
changes in those files
Include files from
elsewhere in the project -
must reference a YAML file
`strategy: depend`
Means to hold this pipeline
until the other pipeline
finishes
Pipeline configuration - Multi-Project pipelines
Intro | Pipeline configuration | Pipeline reuse | Pipeline controls
11
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline configuration
The job with trigger is
referred to as the “bridge”
job
Specify project and branch
Pipeline reuse - “before” and “after” scripts
Intro | Pipeline configuration | Pipeline reuse | Pipeline controls
12
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline reuse
The “Before” script is
concatenated to the main
script and runs in the same
shell
The “After” script is run in a
separate shell and does not
not impact the success exit
code
Both works well with a
“default” block
Pipeline reuse - Local include
Intro | Pipeline configuration | Pipeline reuse | Pipeline controls
13
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline reuse
Includes are processed
when the CI is parsed (on
Gitlab itself, not on a
Runner)
`local` is the default.
It includes CI configuration
from elsewhere in this
project.
Pipeline reuse - Project and Remote include
Intro | Pipeline configuration | Pipeline reuse | Pipeline controls
14
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline reuse
Include CI configuration
from another project on the
Gitlab instance
Or from a raw URL
anywhere in the network
Pipeline reuse - Extending templates of Gitlab
Intro | Pipeline configuration | Pipeline reuse | Pipeline controls
15
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline reuse
Templates are developed
by Gitlab and come with
Gitlab instance
Different types of “templates” in Gitlab
- CI configuration templates
- Project templates
- Issue and Merge request description
templates
Pipeline reuse - Project and Remote include
Intro | Pipeline configuration | Pipeline reuse | Pipeline controls
16
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline reuse
Jobs starting with a dot (“.”)
are “hidden” - they are only
used for inheritance and
don’t run on their own.
The `extends` block means
to inherit the references
block, and override any
hashes that are listed here.
Pipeline controls - Variables in the UI at the Project Level
Intro | Pipeline configuration | Pipeline reuse | Pipeline controls
17
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline controls
Variables can also be set at
the Group and Instance
level
Pipeline controls - Variables for a Pipeline run
Intro | Pipeline configuration | Pipeline reuse | Pipeline controls
18
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline controls
Prepopulate the keys and values using
URL parameters
.../pipelines/new?ref=<branch>&var=[<v
ariable_key>]=<value>
Pipeline controls - Variables in the CI Configuration
Intro | Pipeline configuration | Pipeline reuse | Pipeline controls
19
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline controls
Pipeline controls - Predefined Variables
Intro | Pipeline configuration | Pipeline reuse | Pipeline controls
20
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline controls
Pipeline controls - How variables are processed
- Values for this run
- Manually (UI) or in API request
- Values configured
- For Project, Group or Instance
- Values inherited
- From Jobs in previous Stages
- Values in YAML
- Using the `variables:` block
- Values from Gitlab
- “Predefined Variables”
Intro | Pipeline configuration | Pipeline reuse | Pipeline controls
21
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline controls
CI Engine
Main Gitlab
server
CI Jobs
Gitlab Runner
Pipeline controls - rules: The Basics
-
Intro | Pipeline configuration | Pipeline reuse | Pipeline controls
22
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline controls
“If” statements can
reference Variables -
including the predefined
ones, as in this case
Pipeline controls - rules Quick Reference
-
Intro | Pipeline configuration | Pipeline reuse | Pipeline controls
23
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline controls
Clauses
if
changes
exists
(... or none)
Operators
(just the variable)
==
!=
=~
!~
&&
||
Results
when
allow_failure
start_in
“when” options
always
never
on_success
on_failure
manual
delayed
(... or none)
Pipeline controls - rules examples
-
Intro | Pipeline configuration | Pipeline reuse | Pipeline controls
24
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline controls
If $CI_PIPELINE_SOURCE is set to
merge_request_event
or schedule, the job is executed
Any other value for $CI_PIPELINE_SOURCE
does not execute the job because there is no
standalone `when:` clause
If $CI_PIPELINE_SOURCE is set to any valid
value other than
merge_request_event or schedule, the job is
executed
Pipeline controls - when do pipelines run?
-
Intro | Pipeline configuration | Pipeline reuse | Pipeline controls
25
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline control
New commit
New branch
New tag
Manual
API call
Scheduled
The variable
ci_pipeline_source
...can help us with this. Values include:
- push
- web
- schedule
- api
- chat
- webide
- trigger
- pipeline
- external
- external_pull_request_event
- parent_pipeline
- merge_request_event
Extra information
- Gitlab API
- Gitlab CLI CLI https://python-gitlab.readthedocs.io/
- Leveraging and extending Auto Devops feature
- Job artifacts
- Container and language-specific registries
- Parallel and Matrix Testing
- ………..
26
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility
Thank you!
Q&A
Feel free to reach out if you have any questions!
hello@barrage.net || www.barrage.net
27
Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility

More Related Content

Similar to Shift Remote: DevOps: Gitlab ci hands-on experience - Ivan Rimac (Barrage)

20161124 - Final Presentation - Luuk Moonen - brede versie
20161124 - Final Presentation - Luuk Moonen - brede versie20161124 - Final Presentation - Luuk Moonen - brede versie
20161124 - Final Presentation - Luuk Moonen - brede versie
Luuk Moonen
 
Mastering FPGA Design through Debug, Adrian Hernandez, Xilinx
Mastering FPGA Design through Debug, Adrian Hernandez, XilinxMastering FPGA Design through Debug, Adrian Hernandez, Xilinx
Mastering FPGA Design through Debug, Adrian Hernandez, Xilinx
FPGA Central
 
Process selection for manufacturing fms
Process selection for manufacturing fmsProcess selection for manufacturing fms
Process selection for manufacturing fms
Kinshook Chaturvedi
 

Similar to Shift Remote: DevOps: Gitlab ci hands-on experience - Ivan Rimac (Barrage) (20)

Quadratisch. Praktisch. Gut. K8s-native Quality Assurance mit Testkube @ Java...
Quadratisch. Praktisch. Gut. K8s-native Quality Assurance mit Testkube @ Java...Quadratisch. Praktisch. Gut. K8s-native Quality Assurance mit Testkube @ Java...
Quadratisch. Praktisch. Gut. K8s-native Quality Assurance mit Testkube @ Java...
 
Conway Case Study - Optimizing Application Integration SDLC
Conway Case Study -  Optimizing Application Integration SDLCConway Case Study -  Optimizing Application Integration SDLC
Conway Case Study - Optimizing Application Integration SDLC
 
Containerising bootiful microservices javaeeconf
Containerising bootiful microservices javaeeconfContainerising bootiful microservices javaeeconf
Containerising bootiful microservices javaeeconf
 
20161124 - Final Presentation - Luuk Moonen - brede versie
20161124 - Final Presentation - Luuk Moonen - brede versie20161124 - Final Presentation - Luuk Moonen - brede versie
20161124 - Final Presentation - Luuk Moonen - brede versie
 
Components of CI/CD in DevOps
Components of CI/CD in DevOpsComponents of CI/CD in DevOps
Components of CI/CD in DevOps
 
CI CD OPS WHATHAVEYOU
CI CD OPS WHATHAVEYOUCI CD OPS WHATHAVEYOU
CI CD OPS WHATHAVEYOU
 
OSMC 2010 | Monitoring mit Icinga by Icinga Team
OSMC 2010 | Monitoring mit Icinga by Icinga TeamOSMC 2010 | Monitoring mit Icinga by Icinga Team
OSMC 2010 | Monitoring mit Icinga by Icinga Team
 
Mastering FPGA Design through Debug, Adrian Hernandez, Xilinx
Mastering FPGA Design through Debug, Adrian Hernandez, XilinxMastering FPGA Design through Debug, Adrian Hernandez, Xilinx
Mastering FPGA Design through Debug, Adrian Hernandez, Xilinx
 
Advances in Verification - Workshop at BMS College of Engineering
Advances in Verification - Workshop at BMS College of EngineeringAdvances in Verification - Workshop at BMS College of Engineering
Advances in Verification - Workshop at BMS College of Engineering
 
Pipeline_Patterns_R7.pdf
Pipeline_Patterns_R7.pdfPipeline_Patterns_R7.pdf
Pipeline_Patterns_R7.pdf
 
Why Kubernetes? Cloud Native and Developer Experience at Zalando - Enterprise...
Why Kubernetes? Cloud Native and Developer Experience at Zalando - Enterprise...Why Kubernetes? Cloud Native and Developer Experience at Zalando - Enterprise...
Why Kubernetes? Cloud Native and Developer Experience at Zalando - Enterprise...
 
Abhay-Resume
Abhay-ResumeAbhay-Resume
Abhay-Resume
 
TEC118 – How Do You Manage the Configuration of Your Environments from Metal ...
TEC118 –How Do You Manage the Configuration of Your Environments from Metal ...TEC118 –How Do You Manage the Configuration of Your Environments from Metal ...
TEC118 – How Do You Manage the Configuration of Your Environments from Metal ...
 
Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gat...
Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gat...Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gat...
Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gat...
 
XP Days Ukraine 2019
XP Days Ukraine 2019XP Days Ukraine 2019
XP Days Ukraine 2019
 
Continuous Integration and Delivery using TeamCity and Jenkins
Continuous Integration and Delivery using TeamCity and JenkinsContinuous Integration and Delivery using TeamCity and Jenkins
Continuous Integration and Delivery using TeamCity and Jenkins
 
Extend Agile and DevOps Practices Across Hybrid IT
Extend Agile and DevOps Practices Across Hybrid ITExtend Agile and DevOps Practices Across Hybrid IT
Extend Agile and DevOps Practices Across Hybrid IT
 
Process selection for manufacturing fms
Process selection for manufacturing fmsProcess selection for manufacturing fms
Process selection for manufacturing fms
 
Template Design for SAGD
Template Design for SAGDTemplate Design for SAGD
Template Design for SAGD
 
Why Kubernetes? Cloud Native and Developer Experience at Zalando - OWL Tech &...
Why Kubernetes? Cloud Native and Developer Experience at Zalando - OWL Tech &...Why Kubernetes? Cloud Native and Developer Experience at Zalando - OWL Tech &...
Why Kubernetes? Cloud Native and Developer Experience at Zalando - OWL Tech &...
 

More from Shift Conference

More from Shift Conference (20)

Shift Remote: AI: How Does Face Recognition Work (ars futura)
Shift Remote: AI: How Does Face Recognition Work  (ars futura)Shift Remote: AI: How Does Face Recognition Work  (ars futura)
Shift Remote: AI: How Does Face Recognition Work (ars futura)
 
Shift Remote: AI: Behind the scenes development in an AI company - Matija Ili...
Shift Remote: AI: Behind the scenes development in an AI company - Matija Ili...Shift Remote: AI: Behind the scenes development in an AI company - Matija Ili...
Shift Remote: AI: Behind the scenes development in an AI company - Matija Ili...
 
Shift Remote: AI: Smarter AI with analytical graph databases - Victor Lee (Ti...
Shift Remote: AI: Smarter AI with analytical graph databases - Victor Lee (Ti...Shift Remote: AI: Smarter AI with analytical graph databases - Victor Lee (Ti...
Shift Remote: AI: Smarter AI with analytical graph databases - Victor Lee (Ti...
 
Shift Remote: DevOps: Devops with Azure Devops and Github - Juarez Junior (Mi...
Shift Remote: DevOps: Devops with Azure Devops and Github - Juarez Junior (Mi...Shift Remote: DevOps: Devops with Azure Devops and Github - Juarez Junior (Mi...
Shift Remote: DevOps: Devops with Azure Devops and Github - Juarez Junior (Mi...
 
Shift Remote: DevOps: Autodesks research into digital twins for AEC - Kean W...
Shift Remote: DevOps: Autodesks research into digital twins for AEC -  Kean W...Shift Remote: DevOps: Autodesks research into digital twins for AEC -  Kean W...
Shift Remote: DevOps: Autodesks research into digital twins for AEC - Kean W...
 
Shift Remote: DevOps: When metrics are not enough, and everyone is on-call - ...
Shift Remote: DevOps: When metrics are not enough, and everyone is on-call - ...Shift Remote: DevOps: When metrics are not enough, and everyone is on-call - ...
Shift Remote: DevOps: When metrics are not enough, and everyone is on-call - ...
 
Shift Remote: DevOps: Modern incident management with opsgenie - Kristijan L...
Shift Remote: DevOps: Modern incident management with opsgenie -  Kristijan L...Shift Remote: DevOps: Modern incident management with opsgenie -  Kristijan L...
Shift Remote: DevOps: Modern incident management with opsgenie - Kristijan L...
 
Shift Remote: DevOps: DevOps Heroes - Adding Advanced Automation to your Tool...
Shift Remote: DevOps: DevOps Heroes - Adding Advanced Automation to your Tool...Shift Remote: DevOps: DevOps Heroes - Adding Advanced Automation to your Tool...
Shift Remote: DevOps: DevOps Heroes - Adding Advanced Automation to your Tool...
 
Shift Remote: DevOps: An (Un)expected Journey - Zeljko Margeta (RBA)
Shift Remote: DevOps: An (Un)expected Journey - Zeljko Margeta (RBA)Shift Remote: DevOps: An (Un)expected Journey - Zeljko Margeta (RBA)
Shift Remote: DevOps: An (Un)expected Journey - Zeljko Margeta (RBA)
 
Shift Remote: Game Dev - Localising Mobile Games - Marta Kunic (Nanobit)
Shift Remote: Game Dev - Localising Mobile Games - Marta Kunic (Nanobit)Shift Remote: Game Dev - Localising Mobile Games - Marta Kunic (Nanobit)
Shift Remote: Game Dev - Localising Mobile Games - Marta Kunic (Nanobit)
 
Shift Remote: Game Dev - Challenges Introducing Open Source to the Games Indu...
Shift Remote: Game Dev - Challenges Introducing Open Source to the Games Indu...Shift Remote: Game Dev - Challenges Introducing Open Source to the Games Indu...
Shift Remote: Game Dev - Challenges Introducing Open Source to the Games Indu...
 
Shift Remote: Game Dev - Ghost in the Machine: Authorial Voice in System Desi...
Shift Remote: Game Dev - Ghost in the Machine: Authorial Voice in System Desi...Shift Remote: Game Dev - Ghost in the Machine: Authorial Voice in System Desi...
Shift Remote: Game Dev - Ghost in the Machine: Authorial Voice in System Desi...
 
Shift Remote: Game Dev - Building Better Worlds with Game Culturalization - K...
Shift Remote: Game Dev - Building Better Worlds with Game Culturalization - K...Shift Remote: Game Dev - Building Better Worlds with Game Culturalization - K...
Shift Remote: Game Dev - Building Better Worlds with Game Culturalization - K...
 
Shift Remote: Game Dev - Open Match: An Open Source Matchmaking Framework - J...
Shift Remote: Game Dev - Open Match: An Open Source Matchmaking Framework - J...Shift Remote: Game Dev - Open Match: An Open Source Matchmaking Framework - J...
Shift Remote: Game Dev - Open Match: An Open Source Matchmaking Framework - J...
 
Shift Remote: Game Dev - Designing Inside the Box - Fernando Reyes Medina (34...
Shift Remote: Game Dev - Designing Inside the Box - Fernando Reyes Medina (34...Shift Remote: Game Dev - Designing Inside the Box - Fernando Reyes Medina (34...
Shift Remote: Game Dev - Designing Inside the Box - Fernando Reyes Medina (34...
 
Shift Remote: Mobile - Efficiently Building Native Frameworks for Multiple Pl...
Shift Remote: Mobile - Efficiently Building Native Frameworks for Multiple Pl...Shift Remote: Mobile - Efficiently Building Native Frameworks for Multiple Pl...
Shift Remote: Mobile - Efficiently Building Native Frameworks for Multiple Pl...
 
Shift Remote: Mobile - Introduction to MotionLayout on Android - Denis Fodor ...
Shift Remote: Mobile - Introduction to MotionLayout on Android - Denis Fodor ...Shift Remote: Mobile - Introduction to MotionLayout on Android - Denis Fodor ...
Shift Remote: Mobile - Introduction to MotionLayout on Android - Denis Fodor ...
 
Shift Remote: Mobile - Devops-ify your life with Github Actions - Nicola Cort...
Shift Remote: Mobile - Devops-ify your life with Github Actions - Nicola Cort...Shift Remote: Mobile - Devops-ify your life with Github Actions - Nicola Cort...
Shift Remote: Mobile - Devops-ify your life with Github Actions - Nicola Cort...
 
Shift Remote: WEB - GraphQL and React – Quick Start - Dubravko Bogovic (Infobip)
Shift Remote: WEB - GraphQL and React – Quick Start - Dubravko Bogovic (Infobip)Shift Remote: WEB - GraphQL and React – Quick Start - Dubravko Bogovic (Infobip)
Shift Remote: WEB - GraphQL and React – Quick Start - Dubravko Bogovic (Infobip)
 
Shift Remote: WEB - The Features of WebXR Beyond Virtual Reality - Ada Rose C...
Shift Remote: WEB - The Features of WebXR Beyond Virtual Reality - Ada Rose C...Shift Remote: WEB - The Features of WebXR Beyond Virtual Reality - Ada Rose C...
Shift Remote: WEB - The Features of WebXR Beyond Virtual Reality - Ada Rose C...
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 

Shift Remote: DevOps: Gitlab ci hands-on experience - Ivan Rimac (Barrage)

  • 1. Gitlab CI Hands-on experience Ivan Rimac COPYRIGHT Barrage — Visual identity © Barrage d.o.o. 2020. All Rights Reserved.
  • 2. About the speaker - Background in programming - 8 years of experience - Currently @ barrage.net - Osijek - Croatia - Specialized in devops practices and security - Successfully using Gitlab CI in production over 6 years 2 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Intro
  • 3. Why did we started practicing DevOps - Shift from occasionally performed, to routinely performed - Enabled via automation - automation isn't the goal it’s the technique to achieve the goal - Drive consistency - Detect problems early - Remove friction - Increase your bus factor! Intro | Pipeline configuration | Pipeline reuse | Pipeline controls 3 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Intro
  • 4. Gitlab CI configuration management - Pipeline configuration - DAG - Parent/Child - Multi-project - Pipeline component reuse - Before and after scripts - Includes, templates and extends - Pipeline controls - Variables - Rules Intro | Pipeline configuration | Pipeline reuse | Pipeline controls 4 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Intro
  • 5. Pipeline configuration - basic Intro | Pipeline configuration | Pipeline reuse | Pipeline controls 5 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline configuration All jobs in a Stage must complete successfully before proceeding to the next stage
  • 6. Pipeline configuration - with options Intro | Pipeline configuration | Pipeline reuse | Pipeline controls 6 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline configuration This job has `allow_failure: true` …so the pipeline proceeds even though job failed This job has `when: manual` ...so it waits for someone with the permission to click a “Play” button”
  • 7. Pipeline configuration - Directed Acyclic Graph (DAG) Intro | Pipeline configuration | Pipeline reuse | Pipeline controls 7 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline configuration
  • 8. Pipeline configuration - DAG visualization Intro | Pipeline configuration | Pipeline reuse | Pipeline controls 8 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline configuration
  • 9. Pipeline configuration - DAG visualization Intro | Pipeline configuration | Pipeline reuse | Pipeline controls 9 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline configuration
  • 10. Pipeline configuration - Parent/Child pipelines for Monorepos Intro | Pipeline configuration | Pipeline reuse | Pipeline controls 10 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline configuration Run the job if there are changes in those files Include files from elsewhere in the project - must reference a YAML file `strategy: depend` Means to hold this pipeline until the other pipeline finishes
  • 11. Pipeline configuration - Multi-Project pipelines Intro | Pipeline configuration | Pipeline reuse | Pipeline controls 11 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline configuration The job with trigger is referred to as the “bridge” job Specify project and branch
  • 12. Pipeline reuse - “before” and “after” scripts Intro | Pipeline configuration | Pipeline reuse | Pipeline controls 12 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline reuse The “Before” script is concatenated to the main script and runs in the same shell The “After” script is run in a separate shell and does not not impact the success exit code Both works well with a “default” block
  • 13. Pipeline reuse - Local include Intro | Pipeline configuration | Pipeline reuse | Pipeline controls 13 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline reuse Includes are processed when the CI is parsed (on Gitlab itself, not on a Runner) `local` is the default. It includes CI configuration from elsewhere in this project.
  • 14. Pipeline reuse - Project and Remote include Intro | Pipeline configuration | Pipeline reuse | Pipeline controls 14 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline reuse Include CI configuration from another project on the Gitlab instance Or from a raw URL anywhere in the network
  • 15. Pipeline reuse - Extending templates of Gitlab Intro | Pipeline configuration | Pipeline reuse | Pipeline controls 15 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline reuse Templates are developed by Gitlab and come with Gitlab instance Different types of “templates” in Gitlab - CI configuration templates - Project templates - Issue and Merge request description templates
  • 16. Pipeline reuse - Project and Remote include Intro | Pipeline configuration | Pipeline reuse | Pipeline controls 16 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline reuse Jobs starting with a dot (“.”) are “hidden” - they are only used for inheritance and don’t run on their own. The `extends` block means to inherit the references block, and override any hashes that are listed here.
  • 17. Pipeline controls - Variables in the UI at the Project Level Intro | Pipeline configuration | Pipeline reuse | Pipeline controls 17 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline controls Variables can also be set at the Group and Instance level
  • 18. Pipeline controls - Variables for a Pipeline run Intro | Pipeline configuration | Pipeline reuse | Pipeline controls 18 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline controls Prepopulate the keys and values using URL parameters .../pipelines/new?ref=<branch>&var=[<v ariable_key>]=<value>
  • 19. Pipeline controls - Variables in the CI Configuration Intro | Pipeline configuration | Pipeline reuse | Pipeline controls 19 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline controls
  • 20. Pipeline controls - Predefined Variables Intro | Pipeline configuration | Pipeline reuse | Pipeline controls 20 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline controls
  • 21. Pipeline controls - How variables are processed - Values for this run - Manually (UI) or in API request - Values configured - For Project, Group or Instance - Values inherited - From Jobs in previous Stages - Values in YAML - Using the `variables:` block - Values from Gitlab - “Predefined Variables” Intro | Pipeline configuration | Pipeline reuse | Pipeline controls 21 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline controls CI Engine Main Gitlab server CI Jobs Gitlab Runner
  • 22. Pipeline controls - rules: The Basics - Intro | Pipeline configuration | Pipeline reuse | Pipeline controls 22 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline controls “If” statements can reference Variables - including the predefined ones, as in this case
  • 23. Pipeline controls - rules Quick Reference - Intro | Pipeline configuration | Pipeline reuse | Pipeline controls 23 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline controls Clauses if changes exists (... or none) Operators (just the variable) == != =~ !~ && || Results when allow_failure start_in “when” options always never on_success on_failure manual delayed (... or none)
  • 24. Pipeline controls - rules examples - Intro | Pipeline configuration | Pipeline reuse | Pipeline controls 24 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline controls If $CI_PIPELINE_SOURCE is set to merge_request_event or schedule, the job is executed Any other value for $CI_PIPELINE_SOURCE does not execute the job because there is no standalone `when:` clause If $CI_PIPELINE_SOURCE is set to any valid value other than merge_request_event or schedule, the job is executed
  • 25. Pipeline controls - when do pipelines run? - Intro | Pipeline configuration | Pipeline reuse | Pipeline controls 25 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility | Pipeline control New commit New branch New tag Manual API call Scheduled The variable ci_pipeline_source ...can help us with this. Values include: - push - web - schedule - api - chat - webide - trigger - pipeline - external - external_pull_request_event - parent_pipeline - merge_request_event
  • 26. Extra information - Gitlab API - Gitlab CLI CLI https://python-gitlab.readthedocs.io/ - Leveraging and extending Auto Devops feature - Job artifacts - Container and language-specific registries - Parallel and Matrix Testing - ……….. 26 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility
  • 27. Thank you! Q&A Feel free to reach out if you have any questions! hello@barrage.net || www.barrage.net 27 Barrage d.o.o. | Dedication - Technology - Progression - Productivity - Flexibility