SlideShare a Scribd company logo
1 of 23
Download to read offline
1
Unbox GitLab CI/CD
2
Agenda
● What is GitLab CI/CD
● Why GitLab CI/CD
● How to benefit from GitLab CI/CD
○ Quick start
○ Advanced workflows
■ Faster pipeline
■ Templating(include)
■ Dynamic child pipeline
■ Manual approval flow
■ K8s deployment
■ Security tests
3
What is GitLab CI/CD
GitLab CI/CD is a capability built into GitLab for software development through the
continuous methodologies:
Continuous Integration (CI)
Automated testing and artifact creation
Continuous Delivery (CD)
Automated deployment to test and staging environments
Manual deployment to Production
Continuous Deployment (CD)
Automated deployment to Production
4
Why consider GitLab CI/CD
● Versioned build & tests: a
.gitlab-ci.yml file contains your tests
and build scripts, ensuring every
branch gets build & tests it needs.
● Build artifacts & test results:
binaries, other build artifacts and
test results can be stored and
explored in GitLab.
● Native Docker support: custom
Docker images, spin up services as
part of testing, build new Docker
images, even run on Kubernetes.
● Multi-language: build scripts are
command line driven and work with
any language.
● Real time logging: a link in the
merge request takes you to the
current log.
● One application: no integrations to
maintain, no extra license costs, no
switching back and forth between
applications
5
Get Started with GitLab CI/CD
6
Run your first GitLab CI/CD pipeline
Step 1: Define what to run
Step 2: Define where to run
Step 3: Give it a go!
7
Basic pipeline definition syntax
Yaml format for pipeline definition (.gitlab-ci.yml by default)
8
GitLab runner/executors brief
GitLab CI Runner is where the task is executed.
Runner types:
● Shared
● Group
● Project specific
GitLab
Server
Runner Runner
Common executor types:
● Shell (not ssh)
● Docker (most common)
● Kubernetes
Runner installations:
● Linux
● Windows
● MacOS
● Container/K8S
9
Ways to trigger GitLab pipeline
● Push your code to GitLab repository*
● Run it manually from the UI
● Schedule it to run at later time
● “Trigger”ed by upstream pipeline
● Use API to launch a pipeline with “trigger”
10
Advanced GitLab CI/CD Workflows
11
How to get my pipeline run faster?
● Parallel
crop_pictures
stage: Prepare
script: crop_pics.sh
enforce_relative_links:
stage: Prepare
script: src/other/code/links.sh
● Directed Acyclic Graph
linux-build:
stage: build
mac-build:
stage: build
linux-rspec:
stage: test
needs: [“linux-build”]
mac-rspec:
stage: test
needs: [“mac-build”]
linux-prod:
stage: deploy
needs: [“linux-build”]
mac-prod:
stage: deploy
needs: [“mac-build”]
12
More ways to make your faster
● Caching
cache:
paths:
- binary/
- .config
● Rules/condition
pseudo-deploy:
stage: deploy
only:
- branches
except:
- master
job:
script: "echo Hello, Rules!"
rules:
- if:
'$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
== "master"'
when: always
- if: '$VAR =~ /pattern/'
when: manual
- when: on_success
13
Bored with writing every code block?
CI file template
14
Use of ‘include’
include: '/templates/.after-script-template.yml'
include:
- project: 'my-group/my-project'
ref: master
file: '/templates/.gitlab-ci-template.yml'
include:
- remote: 'https://gitlab.com/awesome-project/raw/master/.gitlab-ci-template.yml'
include:
- template: Auto-DevOps.gitlab-ci.yml
● Reuse code from the same project with include:local
● Reuse code from the another project with include:file
● Reuse code from arbitrary http(s) location with include:remote
● Reuse code from template with include:template
15
Need to “compute” a pipeline?
An example use case:
A project has 1000+ test cases with in-house test harness and want to run all of them in parallel during CI
process. Authoring and maintaining the pipeline might be tedious.
Example code:
generate-config:
stage: build
script: generate-ci-config > generated-config.yml
artifacts:
paths:
- generated-config.yml
child-pipeline:
stage: test
trigger:
include:
- artifact: generated-config.yml
job: generate-config
16
Want to get the pipeline wait for approval?
● Create a manual step with some environment.
approve:
stage: Approve
script:
- echo Approved!
environment:
name: approval_env
when: manual
allow_failure: false
only:
- master
● Protect the approval_env environment in the protected
environments settings by adding only needed user to
“Allowed to Deploy” list.
17
How can I run the whole pipeline conditionally?
● Workflow:rules controls to the entirety of a pipeline
workflow:
rules:
- if: $CI_COMMIT_REF_NAME =~ /-wip$/
when: never
- if: $CI_COMMIT_TAG
when: never
- when: always
18
Minimal code to build and deploy to k8s?
● Prepare your Dockerfile in the repo
● Enabled Auto DevOps
● Connect to your K8S cluster
● Install Helm, Ingress and Prometheus (optional)
● Deploy your application!
19
Wish to run security tests more frequently?
● Include your security test template in your .gitlab-ci.yml file
include:
- template: SAST.gitlab-ci.yml
● Run your pipeline
20
Review your security test result
● Check the result in your merge request
● View the report via Security Dashboard
● Pipeline level
● Project level
● Group level
21
The Top 10 OWASP vulnerabilities
The Top 10 OWASP vulnerabilities in 2020 are:
1. Injection
2. Broken Authentication
3. Sensitive Data Exposure
4. XML External Entities (XXE)
5. Broken Access Control
6. Security Misconfigurations
7. Cross Site Scripting (XSS)
8. Insecure Deserialization
9. Using Components with known vulnerabilities
10. Insufficient logging and monitoring
https://owasp.org/www-project-top-ten/
https://owasp.org/www-community/Source_Code_Analysis_Tools
https://about.gitlab.com/solutions/pci-compliance/
https://about.gitlab.com/blog/2020/01/21/gitlab-is-now-a-m
ember-of-the-owasp-foundation/
22
Seamlessly test for vulnerabilities within the developer workflow
App sec
tests
23
Q & A

More Related Content

What's hot

GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...
GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...
GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...GITS Indonesia
 
Default GitLab CI Pipeline - Auto DevOps
Default GitLab CI Pipeline - Auto DevOpsDefault GitLab CI Pipeline - Auto DevOps
Default GitLab CI Pipeline - Auto DevOpsRajith Bhanuka Mahanama
 
Gitlab ci, cncf.sk
Gitlab ci, cncf.skGitlab ci, cncf.sk
Gitlab ci, cncf.skJuraj Hantak
 
Git Lab Introduction
Git Lab IntroductionGit Lab Introduction
Git Lab IntroductionKrunal Doshi
 
CI with Gitlab & Docker
CI with Gitlab & DockerCI with Gitlab & Docker
CI with Gitlab & DockerJoerg Henning
 
GitOps and ArgoCD
GitOps and ArgoCDGitOps and ArgoCD
GitOps and ArgoCDOmar Fathy
 
Helm Charts Security 101
Helm Charts Security 101Helm Charts Security 101
Helm Charts Security 101Deep Datta
 
Introduction to Gitlab
Introduction to GitlabIntroduction to Gitlab
Introduction to GitlabJulien Pivotto
 
GitOps 101 Presentation.pdf
GitOps 101 Presentation.pdfGitOps 101 Presentation.pdf
GitOps 101 Presentation.pdfssuser31375f
 
Git flow for daily use
Git flow for daily useGit flow for daily use
Git flow for daily useMediacurrent
 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub ActionsKnoldus Inc.
 
Using GitLab CI
Using GitLab CIUsing GitLab CI
Using GitLab CIColCh
 

What's hot (20)

GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...
GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...
GITS Class #16: CI/CD (Continuous Integration & Continuous Deployment) with G...
 
Default GitLab CI Pipeline - Auto DevOps
Default GitLab CI Pipeline - Auto DevOpsDefault GitLab CI Pipeline - Auto DevOps
Default GitLab CI Pipeline - Auto DevOps
 
Gitlab ci, cncf.sk
Gitlab ci, cncf.skGitlab ci, cncf.sk
Gitlab ci, cncf.sk
 
Git Lab Introduction
Git Lab IntroductionGit Lab Introduction
Git Lab Introduction
 
CI with Gitlab & Docker
CI with Gitlab & DockerCI with Gitlab & Docker
CI with Gitlab & Docker
 
GitOps and ArgoCD
GitOps and ArgoCDGitOps and ArgoCD
GitOps and ArgoCD
 
GitOps with Gitkube
GitOps with GitkubeGitOps with Gitkube
GitOps with Gitkube
 
Jenkins
JenkinsJenkins
Jenkins
 
Gitlab ci-cd
Gitlab ci-cdGitlab ci-cd
Gitlab ci-cd
 
GitLab.pptx
GitLab.pptxGitLab.pptx
GitLab.pptx
 
Helm Charts Security 101
Helm Charts Security 101Helm Charts Security 101
Helm Charts Security 101
 
Introduction to Gitlab
Introduction to GitlabIntroduction to Gitlab
Introduction to Gitlab
 
Introducing GitLab
Introducing GitLabIntroducing GitLab
Introducing GitLab
 
GitOps 101 Presentation.pdf
GitOps 101 Presentation.pdfGitOps 101 Presentation.pdf
GitOps 101 Presentation.pdf
 
Jenkins CI presentation
Jenkins CI presentationJenkins CI presentation
Jenkins CI presentation
 
Git flow for daily use
Git flow for daily useGit flow for daily use
Git flow for daily use
 
Introduction to GitHub Actions
Introduction to GitHub ActionsIntroduction to GitHub Actions
Introduction to GitHub Actions
 
CI/CD with GitHub Actions
CI/CD with GitHub ActionsCI/CD with GitHub Actions
CI/CD with GitHub Actions
 
Automation CICD
Automation CICDAutomation CICD
Automation CICD
 
Using GitLab CI
Using GitLab CIUsing GitLab CI
Using GitLab CI
 

Similar to Webinar - Unbox GitLab CI/CD

Gitlab ci e kubernetes, build test and deploy your projects like a pro
Gitlab ci e kubernetes, build test and deploy your projects like a proGitlab ci e kubernetes, build test and deploy your projects like a pro
Gitlab ci e kubernetes, build test and deploy your projects like a prosparkfabrik
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Opersys inc.
 
Continuous Deployment with Kubernetes, Docker and GitLab CI
Continuous Deployment with Kubernetes, Docker and GitLab CIContinuous Deployment with Kubernetes, Docker and GitLab CI
Continuous Deployment with Kubernetes, Docker and GitLab CIalexanderkiel
 
CI/CD Pipeline mit Gitlab CI und Kubernetes
CI/CD Pipeline mit Gitlab CI und KubernetesCI/CD Pipeline mit Gitlab CI und Kubernetes
CI/CD Pipeline mit Gitlab CI und Kubernetesinovex GmbH
 
Gocd – Kubernetes/Nomad Continuous Deployment
Gocd – Kubernetes/Nomad Continuous DeploymentGocd – Kubernetes/Nomad Continuous Deployment
Gocd – Kubernetes/Nomad Continuous DeploymentLeandro Totino Pereira
 
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...Oleg Shalygin
 
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
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDocker, Inc.
 
Advanced Code Flow, Notes From the Field
Advanced Code Flow, Notes From the FieldAdvanced Code Flow, Notes From the Field
Advanced Code Flow, Notes From the FieldAriel Moskovich
 
Enhance Your Kubernetes CI/CD Pipelines With GitLab & Open Source
Enhance Your Kubernetes CI/CD Pipelines With GitLab & Open SourceEnhance Your Kubernetes CI/CD Pipelines With GitLab & Open Source
Enhance Your Kubernetes CI/CD Pipelines With GitLab & Open SourceNico Meisenzahl
 
Infrastructure = Code
Infrastructure = CodeInfrastructure = Code
Infrastructure = CodeGeorg Sorst
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'acorehard_by
 
Docker based-Pipelines with Codefresh
Docker based-Pipelines with CodefreshDocker based-Pipelines with Codefresh
Docker based-Pipelines with CodefreshCodefresh
 
Making your app soar without a container manifest
Making your app soar without a container manifestMaking your app soar without a container manifest
Making your app soar without a container manifestLibbySchulze
 
Automate Your Automation | DrupalCon Vienna
Automate Your Automation | DrupalCon ViennaAutomate Your Automation | DrupalCon Vienna
Automate Your Automation | DrupalCon ViennaPantheon
 
Deploy Multinode GitLab Runner in openSUSE 15.1 Instances with Ansible Automa...
Deploy Multinode GitLab Runner in openSUSE 15.1 Instances with Ansible Automa...Deploy Multinode GitLab Runner in openSUSE 15.1 Instances with Ansible Automa...
Deploy Multinode GitLab Runner in openSUSE 15.1 Instances with Ansible Automa...Samsul Ma'arif
 
Life of a Chromium Developer
Life of a Chromium DeveloperLife of a Chromium Developer
Life of a Chromium Developermpaproductions
 
It's a Breeze to develop Apache Airflow (Apache Con Berlin)
It's a Breeze to develop Apache Airflow (Apache Con Berlin)It's a Breeze to develop Apache Airflow (Apache Con Berlin)
It's a Breeze to develop Apache Airflow (Apache Con Berlin)Jarek Potiuk
 

Similar to Webinar - Unbox GitLab CI/CD (20)

Gitlab ci e kubernetes, build test and deploy your projects like a pro
Gitlab ci e kubernetes, build test and deploy your projects like a proGitlab ci e kubernetes, build test and deploy your projects like a pro
Gitlab ci e kubernetes, build test and deploy your projects like a pro
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013
 
Continuous Deployment with Kubernetes, Docker and GitLab CI
Continuous Deployment with Kubernetes, Docker and GitLab CIContinuous Deployment with Kubernetes, Docker and GitLab CI
Continuous Deployment with Kubernetes, Docker and GitLab CI
 
CI/CD Pipeline mit Gitlab CI und Kubernetes
CI/CD Pipeline mit Gitlab CI und KubernetesCI/CD Pipeline mit Gitlab CI und Kubernetes
CI/CD Pipeline mit Gitlab CI und Kubernetes
 
Continuous testing
Continuous testingContinuous testing
Continuous testing
 
CI/CD with Github Actions
CI/CD with Github ActionsCI/CD with Github Actions
CI/CD with Github Actions
 
Gocd – Kubernetes/Nomad Continuous Deployment
Gocd – Kubernetes/Nomad Continuous DeploymentGocd – Kubernetes/Nomad Continuous Deployment
Gocd – Kubernetes/Nomad Continuous Deployment
 
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
 
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
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development Pipeline
 
Advanced Code Flow, Notes From the Field
Advanced Code Flow, Notes From the FieldAdvanced Code Flow, Notes From the Field
Advanced Code Flow, Notes From the Field
 
Enhance Your Kubernetes CI/CD Pipelines With GitLab & Open Source
Enhance Your Kubernetes CI/CD Pipelines With GitLab & Open SourceEnhance Your Kubernetes CI/CD Pipelines With GitLab & Open Source
Enhance Your Kubernetes CI/CD Pipelines With GitLab & Open Source
 
Infrastructure = Code
Infrastructure = CodeInfrastructure = Code
Infrastructure = Code
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'a
 
Docker based-Pipelines with Codefresh
Docker based-Pipelines with CodefreshDocker based-Pipelines with Codefresh
Docker based-Pipelines with Codefresh
 
Making your app soar without a container manifest
Making your app soar without a container manifestMaking your app soar without a container manifest
Making your app soar without a container manifest
 
Automate Your Automation | DrupalCon Vienna
Automate Your Automation | DrupalCon ViennaAutomate Your Automation | DrupalCon Vienna
Automate Your Automation | DrupalCon Vienna
 
Deploy Multinode GitLab Runner in openSUSE 15.1 Instances with Ansible Automa...
Deploy Multinode GitLab Runner in openSUSE 15.1 Instances with Ansible Automa...Deploy Multinode GitLab Runner in openSUSE 15.1 Instances with Ansible Automa...
Deploy Multinode GitLab Runner in openSUSE 15.1 Instances with Ansible Automa...
 
Life of a Chromium Developer
Life of a Chromium DeveloperLife of a Chromium Developer
Life of a Chromium Developer
 
It's a Breeze to develop Apache Airflow (Apache Con Berlin)
It's a Breeze to develop Apache Airflow (Apache Con Berlin)It's a Breeze to develop Apache Airflow (Apache Con Berlin)
It's a Breeze to develop Apache Airflow (Apache Con Berlin)
 

Recently uploaded

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
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 WoodJuan lago vázquez
 
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, ...apidays
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
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.pptxRustici Software
 
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​Bhuvaneswari Subramani
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
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)Zilliz
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
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 Ontologyjohnbeverley2021
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
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
 
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, ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
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
 
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​
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
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)
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 

Webinar - Unbox GitLab CI/CD

  • 2. 2 Agenda ● What is GitLab CI/CD ● Why GitLab CI/CD ● How to benefit from GitLab CI/CD ○ Quick start ○ Advanced workflows ■ Faster pipeline ■ Templating(include) ■ Dynamic child pipeline ■ Manual approval flow ■ K8s deployment ■ Security tests
  • 3. 3 What is GitLab CI/CD GitLab CI/CD is a capability built into GitLab for software development through the continuous methodologies: Continuous Integration (CI) Automated testing and artifact creation Continuous Delivery (CD) Automated deployment to test and staging environments Manual deployment to Production Continuous Deployment (CD) Automated deployment to Production
  • 4. 4 Why consider GitLab CI/CD ● Versioned build & tests: a .gitlab-ci.yml file contains your tests and build scripts, ensuring every branch gets build & tests it needs. ● Build artifacts & test results: binaries, other build artifacts and test results can be stored and explored in GitLab. ● Native Docker support: custom Docker images, spin up services as part of testing, build new Docker images, even run on Kubernetes. ● Multi-language: build scripts are command line driven and work with any language. ● Real time logging: a link in the merge request takes you to the current log. ● One application: no integrations to maintain, no extra license costs, no switching back and forth between applications
  • 5. 5 Get Started with GitLab CI/CD
  • 6. 6 Run your first GitLab CI/CD pipeline Step 1: Define what to run Step 2: Define where to run Step 3: Give it a go!
  • 7. 7 Basic pipeline definition syntax Yaml format for pipeline definition (.gitlab-ci.yml by default)
  • 8. 8 GitLab runner/executors brief GitLab CI Runner is where the task is executed. Runner types: ● Shared ● Group ● Project specific GitLab Server Runner Runner Common executor types: ● Shell (not ssh) ● Docker (most common) ● Kubernetes Runner installations: ● Linux ● Windows ● MacOS ● Container/K8S
  • 9. 9 Ways to trigger GitLab pipeline ● Push your code to GitLab repository* ● Run it manually from the UI ● Schedule it to run at later time ● “Trigger”ed by upstream pipeline ● Use API to launch a pipeline with “trigger”
  • 11. 11 How to get my pipeline run faster? ● Parallel crop_pictures stage: Prepare script: crop_pics.sh enforce_relative_links: stage: Prepare script: src/other/code/links.sh ● Directed Acyclic Graph linux-build: stage: build mac-build: stage: build linux-rspec: stage: test needs: [“linux-build”] mac-rspec: stage: test needs: [“mac-build”] linux-prod: stage: deploy needs: [“linux-build”] mac-prod: stage: deploy needs: [“mac-build”]
  • 12. 12 More ways to make your faster ● Caching cache: paths: - binary/ - .config ● Rules/condition pseudo-deploy: stage: deploy only: - branches except: - master job: script: "echo Hello, Rules!" rules: - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"' when: always - if: '$VAR =~ /pattern/' when: manual - when: on_success
  • 13. 13 Bored with writing every code block? CI file template
  • 14. 14 Use of ‘include’ include: '/templates/.after-script-template.yml' include: - project: 'my-group/my-project' ref: master file: '/templates/.gitlab-ci-template.yml' include: - remote: 'https://gitlab.com/awesome-project/raw/master/.gitlab-ci-template.yml' include: - template: Auto-DevOps.gitlab-ci.yml ● Reuse code from the same project with include:local ● Reuse code from the another project with include:file ● Reuse code from arbitrary http(s) location with include:remote ● Reuse code from template with include:template
  • 15. 15 Need to “compute” a pipeline? An example use case: A project has 1000+ test cases with in-house test harness and want to run all of them in parallel during CI process. Authoring and maintaining the pipeline might be tedious. Example code: generate-config: stage: build script: generate-ci-config > generated-config.yml artifacts: paths: - generated-config.yml child-pipeline: stage: test trigger: include: - artifact: generated-config.yml job: generate-config
  • 16. 16 Want to get the pipeline wait for approval? ● Create a manual step with some environment. approve: stage: Approve script: - echo Approved! environment: name: approval_env when: manual allow_failure: false only: - master ● Protect the approval_env environment in the protected environments settings by adding only needed user to “Allowed to Deploy” list.
  • 17. 17 How can I run the whole pipeline conditionally? ● Workflow:rules controls to the entirety of a pipeline workflow: rules: - if: $CI_COMMIT_REF_NAME =~ /-wip$/ when: never - if: $CI_COMMIT_TAG when: never - when: always
  • 18. 18 Minimal code to build and deploy to k8s? ● Prepare your Dockerfile in the repo ● Enabled Auto DevOps ● Connect to your K8S cluster ● Install Helm, Ingress and Prometheus (optional) ● Deploy your application!
  • 19. 19 Wish to run security tests more frequently? ● Include your security test template in your .gitlab-ci.yml file include: - template: SAST.gitlab-ci.yml ● Run your pipeline
  • 20. 20 Review your security test result ● Check the result in your merge request ● View the report via Security Dashboard ● Pipeline level ● Project level ● Group level
  • 21. 21 The Top 10 OWASP vulnerabilities The Top 10 OWASP vulnerabilities in 2020 are: 1. Injection 2. Broken Authentication 3. Sensitive Data Exposure 4. XML External Entities (XXE) 5. Broken Access Control 6. Security Misconfigurations 7. Cross Site Scripting (XSS) 8. Insecure Deserialization 9. Using Components with known vulnerabilities 10. Insufficient logging and monitoring https://owasp.org/www-project-top-ten/ https://owasp.org/www-community/Source_Code_Analysis_Tools https://about.gitlab.com/solutions/pci-compliance/ https://about.gitlab.com/blog/2020/01/21/gitlab-is-now-a-m ember-of-the-owasp-foundation/
  • 22. 22 Seamlessly test for vulnerabilities within the developer workflow App sec tests