SlideShare uma empresa Scribd logo
1 de 9
CI CD WORKFLOW
WITH
GITLAB
By Team CALMS Squad
Tools used
GitLab:- To manage code and versioning
Docker:- To build ship and run containers
Gitlab Runner:- For ci
Ansible:- For cicd provisioning instance
Gitlab CI/CD
with Ansible
Workflow
Gitlab ⇒ Gitlab-Runner => build docker image => Ansible
Developers pushes their code to repo.
Gitlab-Runner build job then triggers via webhook and by that application is
packaged into docker image and pushed to registry.
And Gitlab-Runner build job runs Ansible playbook which will provision server
according to Dev/stage/production environment with its dependencies and
requirements.
And after successful/unsuccessful build notification is send to team.
Gitlab-Runner build jobs examples
Running shell commands
Taking pull from git
Like installing dependencies via composer install
Cleaning Drupal caches via drush cr
Updating database via drush updb
Importing configs via drush cim and again clearing caches via drush cr
Running Ansible playbook via Gitlab-Runner
Benefits of running Ansible playbook is everything can be managed
from one place i.e playbook
Means one can clone code from repo
Installing dependencies and package app into containers and deploy it
on server.
When compared to Gitlab-runner shell commands, In playbook the shell
commands will also be executed by the playbook itself so all the things
like installing dependencies, clearing caches, updating database and
importing configs can be done easily.
Shell command example:-
● Clone code
○ if cd project_name;
○ then
○ git branch; git status; git checkout {{branch_name}}; git pull origin {{branch_name}};
○ docker exec -i {{container_name}} composer install -d /var/www/html/{{project_name}};
○ docker exec -i {{container_name}} drush cim -y --root=/var/www/html/{{project_name}}/web;
○ docker exec -i {{container_name}} drush updb -y--root=/var/www/html/{{project_name}}/web;
○ docker exec -i {{container_name}} drush cr -y --root=/var/www/html/{{project_name}}/web;
○ else
○ git clone {{github_repo_url}} project_name;
○ cd findamol;
○ git branch; git status; git checkout {{branch_name}}; git pull origin {{branch_name}};
○ docker exec -i {{container_name}} composer install -d /var/www/html/{{project_name}};
○ docker exec -i {{container_name}} drush cim -y --root=/var/www/html/{{project_name}}/web;
○ docker exec -i {{container_name}} drush updb -y --root=/var/www/html/{{project_name}}/web;
○ docker exec -i {{container_name}} drush cr -y --root=/var/www/html/{{project_name}}/web;
○ fi
Ansible playbook example:-
● Run Playbook which contains task for cloning code, installing
dependencies, updating database and configs and clearing caches
● Tasks:-
○ Clone code
○ Setup project
○ Start containers
○ Install dependencies (composer install)
○ Import configs (drush cim -y)
○ Updating database (drush updb)
○ Clear caches (drush cr)
Reach us at :
Email:
1. hi@addwebsolution.com or
2. contact@addwebsolution.com
Phone:
1. +1-302-261-5724
2. +44-020-8144-0266
3. +91 903 317 7471
We are Social:
Team Culture | LinkedIn | Happy Clients | Twitter

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Formation autour de git et git lab
Formation autour de git et git labFormation autour de git et git lab
Formation autour de git et git lab
 
Meetup 23 - 03 - Application Delivery on K8S with GitOps
Meetup 23 - 03 - Application Delivery on K8S with GitOpsMeetup 23 - 03 - Application Delivery on K8S with GitOps
Meetup 23 - 03 - Application Delivery on K8S with GitOps
 
DevOps with GitHub Actions
DevOps with GitHub ActionsDevOps with GitHub Actions
DevOps with GitHub Actions
 
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...
 
GitOps - Operation By Pull Request
GitOps - Operation By Pull RequestGitOps - Operation By Pull Request
GitOps - Operation By Pull Request
 
GitOps Toolkit (Cloud Native Nordics Tech Talk)
GitOps Toolkit (Cloud Native Nordics Tech Talk)GitOps Toolkit (Cloud Native Nordics Tech Talk)
GitOps Toolkit (Cloud Native Nordics Tech Talk)
 
Build CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation SlidesBuild CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation Slides
 
CI/CD with GitHub Actions
CI/CD with GitHub ActionsCI/CD with GitHub Actions
CI/CD with GitHub Actions
 
What's New for GitLab CI/CD February 2020
What's New for GitLab CI/CD February 2020What's New for GitLab CI/CD February 2020
What's New for GitLab CI/CD February 2020
 
Git & GitLab
Git & GitLabGit & GitLab
Git & GitLab
 
Argocd up and running
Argocd up and runningArgocd up and running
Argocd up and running
 
Gitlab ci-cd
Gitlab ci-cdGitlab ci-cd
Gitlab ci-cd
 
Gitlab CI : Integration et Déploiement Continue
Gitlab CI : Integration et Déploiement ContinueGitlab CI : Integration et Déploiement Continue
Gitlab CI : Integration et Déploiement Continue
 
Jenkins vs GitLab CI
Jenkins vs GitLab CIJenkins vs GitLab CI
Jenkins vs GitLab CI
 
How to write a Dockerfile
How to write a DockerfileHow to write a Dockerfile
How to write a Dockerfile
 
Gitops Hands On
Gitops Hands OnGitops Hands On
Gitops Hands On
 
Docker Swarm Introduction
Docker Swarm IntroductionDocker Swarm Introduction
Docker Swarm Introduction
 
Jenkins-CI
Jenkins-CIJenkins-CI
Jenkins-CI
 
CD using ArgoCD(KnolX).pdf
CD using ArgoCD(KnolX).pdfCD using ArgoCD(KnolX).pdf
CD using ArgoCD(KnolX).pdf
 
Devops Porto - CI/CD at Gitlab
Devops Porto - CI/CD at GitlabDevops Porto - CI/CD at Gitlab
Devops Porto - CI/CD at Gitlab
 

Semelhante a CI-CD WITH GITLAB WORKFLOW

Life of a Chromium Developer
Life of a Chromium DeveloperLife of a Chromium Developer
Life of a Chromium Developer
mpaproductions
 

Semelhante a CI-CD WITH GITLAB WORKFLOW (20)

[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Continuous Delivery com Docker, OpenShift e Jenkins
Continuous Delivery com Docker, OpenShift e JenkinsContinuous Delivery com Docker, OpenShift e Jenkins
Continuous Delivery com Docker, OpenShift e Jenkins
 
Life of a Chromium Developer
Life of a Chromium DeveloperLife of a Chromium Developer
Life of a Chromium Developer
 
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
 
ContainerDayVietnam2016: Django Development with Docker
ContainerDayVietnam2016: Django Development with DockerContainerDayVietnam2016: Django Development with Docker
ContainerDayVietnam2016: Django Development with Docker
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'a
 
Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署
 
DCEU 18: Developing with Docker Containers
DCEU 18: Developing with Docker ContainersDCEU 18: Developing with Docker Containers
DCEU 18: Developing with Docker Containers
 
The Fairy Tale of the One Command Build Script
The Fairy Tale of the One Command Build ScriptThe Fairy Tale of the One Command Build Script
The Fairy Tale of the One Command Build Script
 
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
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient way
 
Using Docker For Development
Using Docker For DevelopmentUsing Docker For Development
Using Docker For Development
 
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
 
Docker4Drupal 2.1 for Development
Docker4Drupal 2.1 for DevelopmentDocker4Drupal 2.1 for Development
Docker4Drupal 2.1 for Development
 
groovy & grails - lecture 9
groovy & grails - lecture 9groovy & grails - lecture 9
groovy & grails - lecture 9
 
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day ThailandCI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
 
Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tips
 
oSC-2023-Cross-Build.pdf
oSC-2023-Cross-Build.pdfoSC-2023-Cross-Build.pdf
oSC-2023-Cross-Build.pdf
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
 

Mais de AddWeb Solution Pvt. Ltd.

Mais de AddWeb Solution Pvt. Ltd. (20)

Top SaaS Frameworks for Software Product Development.pdf
Top SaaS Frameworks for Software Product Development.pdfTop SaaS Frameworks for Software Product Development.pdf
Top SaaS Frameworks for Software Product Development.pdf
 
The Ultimate Step-by-Step Guide to Develop a Calendar App.pdf
The Ultimate Step-by-Step Guide to Develop a Calendar App.pdfThe Ultimate Step-by-Step Guide to Develop a Calendar App.pdf
The Ultimate Step-by-Step Guide to Develop a Calendar App.pdf
 
Top Exclusive Mobile App Ideas for Real Estate Businesses.pdf
Top Exclusive Mobile App Ideas for Real Estate Businesses.pdfTop Exclusive Mobile App Ideas for Real Estate Businesses.pdf
Top Exclusive Mobile App Ideas for Real Estate Businesses.pdf
 
How to Start A Food Delivery Business Like DoorDash in 2024.pdf
How to Start A Food Delivery Business Like DoorDash in 2024.pdfHow to Start A Food Delivery Business Like DoorDash in 2024.pdf
How to Start A Food Delivery Business Like DoorDash in 2024.pdf
 
Choosing the Right Node.js Framework For App Development 2024.pdf
Choosing the Right Node.js Framework For App Development 2024.pdfChoosing the Right Node.js Framework For App Development 2024.pdf
Choosing the Right Node.js Framework For App Development 2024.pdf
 
The Complete Guide to Serverless Computing.pdf
The Complete Guide to Serverless Computing.pdfThe Complete Guide to Serverless Computing.pdf
The Complete Guide to Serverless Computing.pdf
 
How to Implement Content Marketing for Ecommerce SEO.pdf
How to Implement Content Marketing for Ecommerce SEO.pdfHow to Implement Content Marketing for Ecommerce SEO.pdf
How to Implement Content Marketing for Ecommerce SEO.pdf
 
Why Use Vue JS The Ultimate Guide for Frontend Every Aspect Covered.pdf
Why Use Vue JS The Ultimate Guide for Frontend Every Aspect Covered.pdfWhy Use Vue JS The Ultimate Guide for Frontend Every Aspect Covered.pdf
Why Use Vue JS The Ultimate Guide for Frontend Every Aspect Covered.pdf
 
Everything to Know About Custom Healthcare App Development.pdf
Everything to Know About Custom Healthcare App Development.pdfEverything to Know About Custom Healthcare App Development.pdf
Everything to Know About Custom Healthcare App Development.pdf
 
How Much Does It Cost to Build a React Native App in 2024.pdf
How Much Does It Cost to Build a React Native App in 2024.pdfHow Much Does It Cost to Build a React Native App in 2024.pdf
How Much Does It Cost to Build a React Native App in 2024.pdf
 
How Much Does HR & Staffing Software Development Cost.pdf
How Much Does HR & Staffing Software Development Cost.pdfHow Much Does HR & Staffing Software Development Cost.pdf
How Much Does HR & Staffing Software Development Cost.pdf
 
Guide to Developing a Cloud Based SaaS App
Guide to Developing a Cloud Based SaaS AppGuide to Developing a Cloud Based SaaS App
Guide to Developing a Cloud Based SaaS App
 
Why Choose Drupal As Your Restaurant CMS In 2024.pdf
Why Choose Drupal As Your Restaurant CMS In 2024.pdfWhy Choose Drupal As Your Restaurant CMS In 2024.pdf
Why Choose Drupal As Your Restaurant CMS In 2024.pdf
 
Why Use CakePHP Over Other Web Frameworks Explore Pros & Cons.pdf
Why Use CakePHP Over Other Web Frameworks Explore Pros & Cons.pdfWhy Use CakePHP Over Other Web Frameworks Explore Pros & Cons.pdf
Why Use CakePHP Over Other Web Frameworks Explore Pros & Cons.pdf
 
How to Hire a DevOps Consultant in 2024.pdf
How to Hire a DevOps Consultant in 2024.pdfHow to Hire a DevOps Consultant in 2024.pdf
How to Hire a DevOps Consultant in 2024.pdf
 
Importance of UXUi in Mobile App Development.pdf
Importance of UXUi in Mobile App Development.pdfImportance of UXUi in Mobile App Development.pdf
Importance of UXUi in Mobile App Development.pdf
 
Features and Benefits of Logistics Software Development.pdf
Features and Benefits of Logistics Software Development.pdfFeatures and Benefits of Logistics Software Development.pdf
Features and Benefits of Logistics Software Development.pdf
 
The Pros and Cons of Flutter App Development.pdf
The Pros and Cons of Flutter App Development.pdfThe Pros and Cons of Flutter App Development.pdf
The Pros and Cons of Flutter App Development.pdf
 
Cost and Features of Developing a Successful Food Delivery Application.pdf
Cost and Features of Developing a Successful Food Delivery Application.pdfCost and Features of Developing a Successful Food Delivery Application.pdf
Cost and Features of Developing a Successful Food Delivery Application.pdf
 
Steps for SaaS Product Development for Streamlined Business Productivity
Steps for SaaS Product Development for Streamlined Business ProductivitySteps for SaaS Product Development for Streamlined Business Productivity
Steps for SaaS Product Development for Streamlined Business Productivity
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

CI-CD WITH GITLAB WORKFLOW

  • 1. CI CD WORKFLOW WITH GITLAB By Team CALMS Squad
  • 2. Tools used GitLab:- To manage code and versioning Docker:- To build ship and run containers Gitlab Runner:- For ci Ansible:- For cicd provisioning instance
  • 4. Workflow Gitlab ⇒ Gitlab-Runner => build docker image => Ansible Developers pushes their code to repo. Gitlab-Runner build job then triggers via webhook and by that application is packaged into docker image and pushed to registry. And Gitlab-Runner build job runs Ansible playbook which will provision server according to Dev/stage/production environment with its dependencies and requirements. And after successful/unsuccessful build notification is send to team.
  • 5. Gitlab-Runner build jobs examples Running shell commands Taking pull from git Like installing dependencies via composer install Cleaning Drupal caches via drush cr Updating database via drush updb Importing configs via drush cim and again clearing caches via drush cr
  • 6. Running Ansible playbook via Gitlab-Runner Benefits of running Ansible playbook is everything can be managed from one place i.e playbook Means one can clone code from repo Installing dependencies and package app into containers and deploy it on server. When compared to Gitlab-runner shell commands, In playbook the shell commands will also be executed by the playbook itself so all the things like installing dependencies, clearing caches, updating database and importing configs can be done easily.
  • 7. Shell command example:- ● Clone code ○ if cd project_name; ○ then ○ git branch; git status; git checkout {{branch_name}}; git pull origin {{branch_name}}; ○ docker exec -i {{container_name}} composer install -d /var/www/html/{{project_name}}; ○ docker exec -i {{container_name}} drush cim -y --root=/var/www/html/{{project_name}}/web; ○ docker exec -i {{container_name}} drush updb -y--root=/var/www/html/{{project_name}}/web; ○ docker exec -i {{container_name}} drush cr -y --root=/var/www/html/{{project_name}}/web; ○ else ○ git clone {{github_repo_url}} project_name; ○ cd findamol; ○ git branch; git status; git checkout {{branch_name}}; git pull origin {{branch_name}}; ○ docker exec -i {{container_name}} composer install -d /var/www/html/{{project_name}}; ○ docker exec -i {{container_name}} drush cim -y --root=/var/www/html/{{project_name}}/web; ○ docker exec -i {{container_name}} drush updb -y --root=/var/www/html/{{project_name}}/web; ○ docker exec -i {{container_name}} drush cr -y --root=/var/www/html/{{project_name}}/web; ○ fi
  • 8. Ansible playbook example:- ● Run Playbook which contains task for cloning code, installing dependencies, updating database and configs and clearing caches ● Tasks:- ○ Clone code ○ Setup project ○ Start containers ○ Install dependencies (composer install) ○ Import configs (drush cim -y) ○ Updating database (drush updb) ○ Clear caches (drush cr)
  • 9. Reach us at : Email: 1. hi@addwebsolution.com or 2. contact@addwebsolution.com Phone: 1. +1-302-261-5724 2. +44-020-8144-0266 3. +91 903 317 7471 We are Social: Team Culture | LinkedIn | Happy Clients | Twitter