SlideShare a Scribd company logo
1 of 23
Download to read offline
5 things I wish I knew about Gitlab CI
Sebastian Witowski
5 things I wish I knew about Gitlab CI
Sebastian Witowski
Have an hour to spare?
1. Interruptible jobs
build:
stage: build
interruptible: true
script:
- docker compose build
1. Interruptible jobs
2. Caching
You can use caching to, well,
cache stuff between jobs.
2. Caching
You can use caching to, well,
cache stuff between jobs.
But you can also specify if
you want to push or pull stuff
to cache using policy key.
default:
cache: &global_cache
key: $CI_COMMIT_REF_SLUG
paths:
- .cache/pip
- some/other/path/
policy: pull-push
job:
cache:
# inherit all global cache settings
<<: *global_cache
# override the policy
policy: pull
2. Caching with Fastzip
For caching/artifacts, you
can choose different level
of compression (low level of
compression runs faster, but
results in a larger zip file).
variables:
FF_USE_FASTZIP: "true"
# Available options are:
# fastest, fast, default, slow,
# or slowest
ARTIFACT_COMPRESSION_LEVEL: "fastest"
CACHE_COMPRESSION_LEVEL: "fastest"
3. Split slow tests into multiple jobs
• Make MR pipelines fast and main branch pipelines
thorough.
3. Split slow tests into multiple jobs
• Make MR pipelines fast and main branch pipelines
thorough.
• Or run the slow tests at the end of the test suite
(https:/
/stackoverflow.com/a/61539510)
4. Hidden jobs and anchors
Allows you to reuse parts of the config
# Source: https://github.com/wemake-services/wemake-django-template
.docker:
image: wemakeservices/wemake-dind:latest
interruptible: true
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
before_script:
- pwd && echo "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR"
- echo "$CI_JOB_TOKEN" | docker login "$REGISTRY" -u gitlab-ci-token --
password-stdin
- docker info && docker-compose --version && git --version
test:
stage: test
extends: .docker
before_script:
# Pulling cache:
- docker pull "${IMAGE_FULL_NAME}:dev" || true
- ...
# Source: https://github.com/wemake-services/wemake-django-template
.docker:
image: wemakeservices/wemake-dind:latest
interruptible: true
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
before_script:
- pwd && echo "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR"
- echo "$CI_JOB_TOKEN" | docker login "$REGISTRY" -u gitlab-ci-token --
password-stdin
- docker info && docker-compose --version && git --version
test:
stage: test
extends: .docker
before_script:
# Pulling cache:
- docker pull "${IMAGE_FULL_NAME}:dev" || true
- ...
# Source: https://github.com/wemake-services/wemake-django-template
.docker:
image: wemakeservices/wemake-dind:latest
interruptible: true
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
before_script:
- pwd && echo "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR"
- echo "$CI_JOB_TOKEN" | docker login "$REGISTRY" -u gitlab-ci-token --
password-stdin
- docker info && docker-compose --version && git --version
test:
stage: test
extends: .docker
before_script:
# Pulling cache:
- docker pull "${IMAGE_FULL_NAME}:dev" || true
- ...
# Source: https://github.com/wemake-services/wemake-django-template
.docker:
image: wemakeservices/wemake-dind:latest
interruptible: true
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
before_script:
- pwd && echo "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR"
- echo "$CI_JOB_TOKEN" | docker login "$REGISTRY" -u gitlab-ci-token --
password-stdin
- docker info && docker-compose --version && git --version
test:
stage: test
extends: .docker
before_script:
# Pulling cache:
- docker pull "${IMAGE_FULL_NAME}:dev" || true
- ...
# Source: https://github.com/wemake-services/wemake-django-template
.docker:
image: wemakeservices/wemake-dind:latest
interruptible: true
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
before_script:
- pwd && echo "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR"
- echo "$CI_JOB_TOKEN" | docker login "$REGISTRY" -u gitlab-ci-token --
password-stdin
- docker info && docker-compose --version && git --version
test:
stage: test
extends: .docker
before_script:
# Pulling cache:
- docker pull "${IMAGE_FULL_NAME}:dev" || true
- ...
# Source: https://github.com/wemake-services/wemake-django-template
.docker:
image: wemakeservices/wemake-dind:latest
interruptible: true
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay2
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
before_script: &docker-before-script
- pwd && echo "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR"
- echo "$CI_JOB_TOKEN" | docker login "$REGISTRY" -u gitlab-ci-token --
password-stdin
- docker info && docker-compose --version && git --version
test:
stage: test
extends: .docker
before_script:
- *docker-before-script
# Pulling cache:
- docker pull "${IMAGE_FULL_NAME}:dev" || true
- ...
5. Runners
5. Runners
• Very easy to set up and use (it's just a binary)
5. Runners
• Very easy to set up and use (it's just a binary)
• Save you money if you run many jobs
5. Runners
• Very easy to set up and use (it's just a binary)
• Save you money if you run many jobs
• Allows for much more flexibility (e.g. access to
proprietary code on your servers)
Wanna learn more?
Questions?
switowski.com
@SebaWitowski
Slides: https:/
/www.slideshare.net/SebastianWitowski

More Related Content

Similar to 5 Things I Wish I Knew About Gitlab CI

Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
Coscup x ruby conf tw 2021  google cloud buildpacks 剖析與實踐Coscup x ruby conf tw 2021  google cloud buildpacks 剖析與實踐
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐KAI CHU CHUNG
 
Build optimization mechanisms in GitLab and Docker
Build optimization mechanisms in GitLab and DockerBuild optimization mechanisms in GitLab and Docker
Build optimization mechanisms in GitLab and DockerDmytro Patkovskyi
 
Hands on Docker - Launch your own LEMP or LAMP stack
Hands on Docker -  Launch your own LEMP or LAMP stackHands on Docker -  Launch your own LEMP or LAMP stack
Hands on Docker - Launch your own LEMP or LAMP stackDana Luther
 
Gitlab ci, cncf.sk
Gitlab ci, cncf.skGitlab ci, cncf.sk
Gitlab ci, cncf.skJuraj Hantak
 
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chefMukta Aphale
 
Baking Docker Using Chef - ChefConf 2015
Baking Docker Using Chef - ChefConf 2015Baking Docker Using Chef - ChefConf 2015
Baking Docker Using Chef - ChefConf 2015Chef
 
Docker security
Docker securityDocker security
Docker securityJanos Suto
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushPantheon
 
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...Puppet
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configurationlutter
 
How To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub CloneHow To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub CloneVEXXHOST Private Cloud
 
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...Mihai Criveti
 
DevOps Workflow: A Tutorial on Linux Containers
DevOps Workflow: A Tutorial on Linux ContainersDevOps Workflow: A Tutorial on Linux Containers
DevOps Workflow: A Tutorial on Linux Containersinside-BigData.com
 
ContainerDayVietnam2016: Django Development with Docker
ContainerDayVietnam2016: Django Development with DockerContainerDayVietnam2016: Django Development with Docker
ContainerDayVietnam2016: Django Development with DockerDocker-Hanoi
 
Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Bo-Yi Wu
 
Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020CloudHero
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Ben Hall
 
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context ConstraintsAlessandro Arrichiello
 

Similar to 5 Things I Wish I Knew About Gitlab CI (20)

Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
Coscup x ruby conf tw 2021  google cloud buildpacks 剖析與實踐Coscup x ruby conf tw 2021  google cloud buildpacks 剖析與實踐
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
 
Build optimization mechanisms in GitLab and Docker
Build optimization mechanisms in GitLab and DockerBuild optimization mechanisms in GitLab and Docker
Build optimization mechanisms in GitLab and Docker
 
Hands on Docker - Launch your own LEMP or LAMP stack
Hands on Docker -  Launch your own LEMP or LAMP stackHands on Docker -  Launch your own LEMP or LAMP stack
Hands on Docker - Launch your own LEMP or LAMP stack
 
Gitlab ci, cncf.sk
Gitlab ci, cncf.skGitlab ci, cncf.sk
Gitlab ci, cncf.sk
 
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chef
 
Baking Docker Using Chef - ChefConf 2015
Baking Docker Using Chef - ChefConf 2015Baking Docker Using Chef - ChefConf 2015
Baking Docker Using Chef - ChefConf 2015
 
Docker security
Docker securityDocker security
Docker security
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and Drush
 
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configuration
 
How To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub CloneHow To Install GitLab As Your Private GitHub Clone
How To Install GitLab As Your Private GitHub Clone
 
Gradle como alternativa a maven
Gradle como alternativa a mavenGradle como alternativa a maven
Gradle como alternativa a maven
 
Docker, c'est bonheur !
Docker, c'est bonheur !Docker, c'est bonheur !
Docker, c'est bonheur !
 
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
Kubernetes Story - Day 2: Quay.io Container Registry for Publishing, Building...
 
DevOps Workflow: A Tutorial on Linux Containers
DevOps Workflow: A Tutorial on Linux ContainersDevOps Workflow: A Tutorial on Linux Containers
DevOps Workflow: A Tutorial on Linux Containers
 
ContainerDayVietnam2016: Django Development with Docker
ContainerDayVietnam2016: Django Development with DockerContainerDayVietnam2016: Django Development with Docker
ContainerDayVietnam2016: Django Development with Docker
 
Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署
 
Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020Docker Essentials Workshop— Innovation Labs July 2020
Docker Essentials Workshop— Innovation Labs July 2020
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
 
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
[Devconf.cz][2017] Understanding OpenShift Security Context Constraints
 

More from Sebastian Witowski

Python Versions and Dependencies Made Easy
Python Versions and Dependencies Made EasyPython Versions and Dependencies Made Easy
Python Versions and Dependencies Made EasySebastian Witowski
 
Productivity tips for developers
Productivity tips for developersProductivity tips for developers
Productivity tips for developersSebastian Witowski
 
Wait, IPython can do that?! (30 minutes)
Wait, IPython can do that?! (30 minutes)Wait, IPython can do that?! (30 minutes)
Wait, IPython can do that?! (30 minutes)Sebastian Witowski
 
It's 2019 & I'm still using Python 2! Should I be worried?
It's 2019 & I'm still using Python 2! Should I be worried?It's 2019 & I'm still using Python 2! Should I be worried?
It's 2019 & I'm still using Python 2! Should I be worried?Sebastian Witowski
 

More from Sebastian Witowski (6)

Writing Faster Python 3
Writing Faster Python 3Writing Faster Python 3
Writing Faster Python 3
 
Python Versions and Dependencies Made Easy
Python Versions and Dependencies Made EasyPython Versions and Dependencies Made Easy
Python Versions and Dependencies Made Easy
 
Productivity tips for developers
Productivity tips for developersProductivity tips for developers
Productivity tips for developers
 
Wait, IPython can do that?! (30 minutes)
Wait, IPython can do that?! (30 minutes)Wait, IPython can do that?! (30 minutes)
Wait, IPython can do that?! (30 minutes)
 
It's 2019 & I'm still using Python 2! Should I be worried?
It's 2019 & I'm still using Python 2! Should I be worried?It's 2019 & I'm still using Python 2! Should I be worried?
It's 2019 & I'm still using Python 2! Should I be worried?
 
Wait, IPython can do that?
Wait, IPython can do that?Wait, IPython can do that?
Wait, IPython can do that?
 

Recently uploaded

DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 

Recently uploaded (20)

DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 

5 Things I Wish I Knew About Gitlab CI

  • 1. 5 things I wish I knew about Gitlab CI Sebastian Witowski
  • 2. 5 things I wish I knew about Gitlab CI Sebastian Witowski
  • 3. Have an hour to spare?
  • 5. build: stage: build interruptible: true script: - docker compose build 1. Interruptible jobs
  • 6. 2. Caching You can use caching to, well, cache stuff between jobs.
  • 7. 2. Caching You can use caching to, well, cache stuff between jobs. But you can also specify if you want to push or pull stuff to cache using policy key. default: cache: &global_cache key: $CI_COMMIT_REF_SLUG paths: - .cache/pip - some/other/path/ policy: pull-push job: cache: # inherit all global cache settings <<: *global_cache # override the policy policy: pull
  • 8. 2. Caching with Fastzip For caching/artifacts, you can choose different level of compression (low level of compression runs faster, but results in a larger zip file). variables: FF_USE_FASTZIP: "true" # Available options are: # fastest, fast, default, slow, # or slowest ARTIFACT_COMPRESSION_LEVEL: "fastest" CACHE_COMPRESSION_LEVEL: "fastest"
  • 9. 3. Split slow tests into multiple jobs • Make MR pipelines fast and main branch pipelines thorough.
  • 10. 3. Split slow tests into multiple jobs • Make MR pipelines fast and main branch pipelines thorough. • Or run the slow tests at the end of the test suite (https:/ /stackoverflow.com/a/61539510)
  • 11. 4. Hidden jobs and anchors Allows you to reuse parts of the config
  • 12. # Source: https://github.com/wemake-services/wemake-django-template .docker: image: wemakeservices/wemake-dind:latest interruptible: true services: - docker:dind variables: DOCKER_DRIVER: overlay2 DOCKER_BUILDKIT: 1 COMPOSE_DOCKER_CLI_BUILD: 1 before_script: - pwd && echo "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR" - echo "$CI_JOB_TOKEN" | docker login "$REGISTRY" -u gitlab-ci-token -- password-stdin - docker info && docker-compose --version && git --version test: stage: test extends: .docker before_script: # Pulling cache: - docker pull "${IMAGE_FULL_NAME}:dev" || true - ...
  • 13. # Source: https://github.com/wemake-services/wemake-django-template .docker: image: wemakeservices/wemake-dind:latest interruptible: true services: - docker:dind variables: DOCKER_DRIVER: overlay2 DOCKER_BUILDKIT: 1 COMPOSE_DOCKER_CLI_BUILD: 1 before_script: - pwd && echo "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR" - echo "$CI_JOB_TOKEN" | docker login "$REGISTRY" -u gitlab-ci-token -- password-stdin - docker info && docker-compose --version && git --version test: stage: test extends: .docker before_script: # Pulling cache: - docker pull "${IMAGE_FULL_NAME}:dev" || true - ...
  • 14. # Source: https://github.com/wemake-services/wemake-django-template .docker: image: wemakeservices/wemake-dind:latest interruptible: true services: - docker:dind variables: DOCKER_DRIVER: overlay2 DOCKER_BUILDKIT: 1 COMPOSE_DOCKER_CLI_BUILD: 1 before_script: - pwd && echo "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR" - echo "$CI_JOB_TOKEN" | docker login "$REGISTRY" -u gitlab-ci-token -- password-stdin - docker info && docker-compose --version && git --version test: stage: test extends: .docker before_script: # Pulling cache: - docker pull "${IMAGE_FULL_NAME}:dev" || true - ...
  • 15. # Source: https://github.com/wemake-services/wemake-django-template .docker: image: wemakeservices/wemake-dind:latest interruptible: true services: - docker:dind variables: DOCKER_DRIVER: overlay2 DOCKER_BUILDKIT: 1 COMPOSE_DOCKER_CLI_BUILD: 1 before_script: - pwd && echo "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR" - echo "$CI_JOB_TOKEN" | docker login "$REGISTRY" -u gitlab-ci-token -- password-stdin - docker info && docker-compose --version && git --version test: stage: test extends: .docker before_script: # Pulling cache: - docker pull "${IMAGE_FULL_NAME}:dev" || true - ...
  • 16. # Source: https://github.com/wemake-services/wemake-django-template .docker: image: wemakeservices/wemake-dind:latest interruptible: true services: - docker:dind variables: DOCKER_DRIVER: overlay2 DOCKER_BUILDKIT: 1 COMPOSE_DOCKER_CLI_BUILD: 1 before_script: - pwd && echo "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR" - echo "$CI_JOB_TOKEN" | docker login "$REGISTRY" -u gitlab-ci-token -- password-stdin - docker info && docker-compose --version && git --version test: stage: test extends: .docker before_script: # Pulling cache: - docker pull "${IMAGE_FULL_NAME}:dev" || true - ...
  • 17. # Source: https://github.com/wemake-services/wemake-django-template .docker: image: wemakeservices/wemake-dind:latest interruptible: true services: - docker:dind variables: DOCKER_DRIVER: overlay2 DOCKER_BUILDKIT: 1 COMPOSE_DOCKER_CLI_BUILD: 1 before_script: &docker-before-script - pwd && echo "$CI_PROJECT_DIR" && cd "$CI_PROJECT_DIR" - echo "$CI_JOB_TOKEN" | docker login "$REGISTRY" -u gitlab-ci-token -- password-stdin - docker info && docker-compose --version && git --version test: stage: test extends: .docker before_script: - *docker-before-script # Pulling cache: - docker pull "${IMAGE_FULL_NAME}:dev" || true - ...
  • 19. 5. Runners • Very easy to set up and use (it's just a binary)
  • 20. 5. Runners • Very easy to set up and use (it's just a binary) • Save you money if you run many jobs
  • 21. 5. Runners • Very easy to set up and use (it's just a binary) • Save you money if you run many jobs • Allows for much more flexibility (e.g. access to proprietary code on your servers)