SlideShare a Scribd company logo
1 of 27
Download to read offline
Drupal deployments met
                          Capistrano
                          Openminds techtalk - 17/10/2012
                                   @openminds
                                www.openminds.be




donderdag 25 oktober 12
Hoe deploy je nu?

                    • Backup database
                    • Code updaten (met git? scp? sftp?)
                    • updatedb uitvoeren
                    • cache flushen


donderdag 25 oktober 12
Wat is daar mis mee?


                          Teveel manuele handelingen verhogen de kans
                                           op fouten.




donderdag 25 oktober 12
Ideaal scenario

                • Snel deployen door alle manuele processen te
                          automatiseren
                • Manuele processen individueel oproepen adhv
                          ‘tasks’
                • Snel een deploy ‘ongedaan’ maken



donderdag 25 oktober 12
• Open Source
                • Gemaakt om Rails Apps te deployen
                • Ruby




donderdag 25 oktober 12
Rubygems

                          gem install capistrano capistrano-ext railsless-deploy
                          capistrano-drupal




donderdag 25 oktober 12
SSH
                     Keypair          Machines

                          Pri          Laptop


                          Pub          Server


                                       Github




donderdag 25 oktober 12
Versiecontrole

                    • Git, SVN, ...
                    • code bijhouden in versies
                    • te ‘pushen’ naar een repository (repo)
                    • Capistrano zal code van repo halen


donderdag 25 oktober 12
DEMO




donderdag 25 oktober 12
• Geen benodigde software op de server
                • Capistrano voert commandos uit over ssh
                • Uitbreidbaar adhv tasks




donderdag 25 oktober 12
Aanpassen voor Drupal
                          Bij deploy:setup:
                • Symlink voor sites/default/files -> shared/files
                • sites/default/settings.php -> shared/settings.php
                          Na deploy:
                • Tasks voor drush commands




donderdag 25 oktober 12
donderdag 25 oktober 12
capistrano-drupal gem

                • Veelvoorkomende Drupal deployment tasks
                          (Drush commands)
                • implementeert before en after hooks




donderdag 25 oktober 12
capistrano-drupal gem

                          deploy:setup
                • files directory in shared
                • settings.php in shared




donderdag 25 oktober 12
capistrano-drupal gem
                          drupal:symlink_shared
                • settings.php en files directory symlinken naar
                          shared
                • after deploy:symlink




donderdag 25 oktober 12
capistrano-drupal gem

                          drush:update
                • drush updatedb
                • after ‘deploy:symlink’




donderdag 25 oktober 12
capistrano-drupal gem

                          drush:cache_clear
                • drush cc
                • after ‘deploy:symlink’




donderdag 25 oktober 12
capistrano-drupal gem
                                Update Code

                           Symlink files directory &
                                 settings.php

                                 Update DB

                                Flush caches




donderdag 25 oktober 12
DEMO




donderdag 25 oktober 12
Probleem

                • alle configuratie zit in de database
                • Continuous Integration moeilijk
                • wat met meerdere developers?




donderdag 25 oktober 12
Ideale situatie
                          2-richtingsverkeer
                • Content komt terug upstream, naar Stag en
                          Dev
                • Configuratie downstream: Stag en Prod




donderdag 25 oktober 12
Oplossing
                          Configuratie in code
                •         Versiecontrole (Git, SVN, ...)
                •         Te debuggen
                •         Te diffen
                •         Reproduceerbare resultaten
                •         opdeling tussen content en configuratie




donderdag 25 oktober 12
donderdag 25 oktober 12
Context en Features
                                 Module
                • Context zijn set regels tijdens page load, ziet
                          wat actief is
                • Features pakt dit in met ‘code’ (views, node,
                          types)
                • Features te enablen met ‘drush’
                • Drush runnen vanuit capistrano


donderdag 25 oktober 12
Features Drush


                • drush features-update feature_name
                • drush features-revert feature_name




donderdag 25 oktober 12
Capo.io



donderdag 25 oktober 12
End



donderdag 25 oktober 12

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Drupal deployments met capistrano

  • 1. Drupal deployments met Capistrano Openminds techtalk - 17/10/2012 @openminds www.openminds.be donderdag 25 oktober 12
  • 2. Hoe deploy je nu? • Backup database • Code updaten (met git? scp? sftp?) • updatedb uitvoeren • cache flushen donderdag 25 oktober 12
  • 3. Wat is daar mis mee? Teveel manuele handelingen verhogen de kans op fouten. donderdag 25 oktober 12
  • 4. Ideaal scenario • Snel deployen door alle manuele processen te automatiseren • Manuele processen individueel oproepen adhv ‘tasks’ • Snel een deploy ‘ongedaan’ maken donderdag 25 oktober 12
  • 5. • Open Source • Gemaakt om Rails Apps te deployen • Ruby donderdag 25 oktober 12
  • 6. Rubygems gem install capistrano capistrano-ext railsless-deploy capistrano-drupal donderdag 25 oktober 12
  • 7. SSH Keypair Machines Pri Laptop Pub Server Github donderdag 25 oktober 12
  • 8. Versiecontrole • Git, SVN, ... • code bijhouden in versies • te ‘pushen’ naar een repository (repo) • Capistrano zal code van repo halen donderdag 25 oktober 12
  • 10. • Geen benodigde software op de server • Capistrano voert commandos uit over ssh • Uitbreidbaar adhv tasks donderdag 25 oktober 12
  • 11. Aanpassen voor Drupal Bij deploy:setup: • Symlink voor sites/default/files -> shared/files • sites/default/settings.php -> shared/settings.php Na deploy: • Tasks voor drush commands donderdag 25 oktober 12
  • 13. capistrano-drupal gem • Veelvoorkomende Drupal deployment tasks (Drush commands) • implementeert before en after hooks donderdag 25 oktober 12
  • 14. capistrano-drupal gem deploy:setup • files directory in shared • settings.php in shared donderdag 25 oktober 12
  • 15. capistrano-drupal gem drupal:symlink_shared • settings.php en files directory symlinken naar shared • after deploy:symlink donderdag 25 oktober 12
  • 16. capistrano-drupal gem drush:update • drush updatedb • after ‘deploy:symlink’ donderdag 25 oktober 12
  • 17. capistrano-drupal gem drush:cache_clear • drush cc • after ‘deploy:symlink’ donderdag 25 oktober 12
  • 18. capistrano-drupal gem Update Code Symlink files directory & settings.php Update DB Flush caches donderdag 25 oktober 12
  • 20. Probleem • alle configuratie zit in de database • Continuous Integration moeilijk • wat met meerdere developers? donderdag 25 oktober 12
  • 21. Ideale situatie 2-richtingsverkeer • Content komt terug upstream, naar Stag en Dev • Configuratie downstream: Stag en Prod donderdag 25 oktober 12
  • 22. Oplossing Configuratie in code • Versiecontrole (Git, SVN, ...) • Te debuggen • Te diffen • Reproduceerbare resultaten • opdeling tussen content en configuratie donderdag 25 oktober 12
  • 24. Context en Features Module • Context zijn set regels tijdens page load, ziet wat actief is • Features pakt dit in met ‘code’ (views, node, types) • Features te enablen met ‘drush’ • Drush runnen vanuit capistrano donderdag 25 oktober 12
  • 25. Features Drush • drush features-update feature_name • drush features-revert feature_name donderdag 25 oktober 12