SlideShare uma empresa Scribd logo
1 de 33
Baixar para ler offline
Automated Drupal
deployment with
Git & Capistrano
Farez Rahman
Freelance Drupal developer
Co-founder: OnSavvy.com
About this session
Git+Capistrano for deployment
Mainly Capistrano
Overview - not too detailed
Input/feedback/questions from you guys
Lots of info online - links at the end
Show of hands please...
Some sort of automated deployment process
Git and Capistrano
Git only + SSH
FTP/SFTP
Aegir?
Drush?
Pantheon?
No idea!
Goal
Automated deployment:
reduce manual human error
Anyone can deploy:
startup = speed is important
Wins...
Reduced multiple steps turned into one step
ssh, git pull, update db, revert features, clear
cache...
“cap deploy”
Wins...
Less steps missed out due to human error
Wins...
No manual SSH into server
great for non-geeks
Wins...
Doing more for each deploy
just add to deploy script
Wins...
Quick to rollback
“cap deploy:rollback”
Wins
Less boring
Costs...
Setup costs...
capistrano, ruby
training for other team members
Costs
Security
potential to run malicious commands on server
from developer’s machine
Why capistrano
Looked at a few options (git hooks, Jenkins,
capistrano)
capistrano - simple, does the job for us
Drupal deploy scripts available (capdrupal,
capistrano-drupal)
Capistrano
Ruby Gem
Remote control for server commands
No server-side installations
Runs over SSH
Our setup
CapDrupal (Ruby Gem)
Drupal-specific Capistrano tasks
We use modified version of CapDrupal
There are others (cap-drupal, capistrano-
drupal...)
CapDrupal (Ruby Gem)...
Drush
CapDrupal needs Drush on your server
Capistrano itself doesn’t..
but no Drush = limited options
How to deploy
1. Make local changes
2. git commit and push
3. $ “cap deploy”
That’s it
What “cap deploy” does
SSH into server
Takes site offline
Backup of db (using drush & backup_migrate)
Clones latest revision from dev branch
Points site root to that latest clone
Runs update db
Reverts features
Clears cache
Puts site back online
Directory structure on server
current -> releases/20130805211651 (symlink)
releases/
20130801135258
20130805211547
20130805211651
shared/
cached-copy/
files/
settings.php
NB: running “cap deploy:setup” creates the dir structure
Before “cap deploy”
current -> releases/20130805211651
releases/
20130801135258
20130805211547
20130805211651
shared/
cached-copy/
files/
settings.php
After “cap deploy”
current -> releases/20130805212640 (points to new clone)
releases/
20130801135258
20130805211547
20130805211651
20130805212640 <- new git clone
shared/
cached-copy/
files/
settings.php
Local directory structure
app/ <- drupal root
config/
deploy.rb <- project specific settings
dev.rb <- site specific settings
live.rb
Capfile
deploy.rb
Local directory structure
app/ <- drupal root
config/
deploy.rb <- project specific settings
dev.rb <- site specific settings
live.rb
Capfile
dev.rb
Rolling back
“cap deploy:rollback”
Doesn't rollback database
But can create custom cap tasks to do that
Customisations to Capdrupal
“backup db”, “update db”, “revert features”
= not relevant when only updating CSS
so we removed them from deploy task
can be run by themselves when needed
All Capistrano tasks “cap -T”
Potential improvements
Create backups of db, that can be rolled back
(e.g new copy of db and settings.php for each
new deploy)
Fully automated deployment, continuous
integration
References
YouTube:
- Simple and powerful site deployment with capistrano - by
Kim Pepper - http://youtu.be/ulK-lhv8eI0
- DrupalCon Munich 2012: Deploy with Capistrano - by
Michael Priest - http://youtu.be/fvkiWfjmKQ4
Github:
https://github.com/antistatique/capdrupal
https://github.com/previousnext/capistrano-drupal
https://github.com/capistrano
Google capistrano drupal
Feel free to get in touch
Farez Rahman
slideshare.net/onsavvy
onsavvy.com/profile/farez-rahman
d.o: user/261497
Twitter: farez
farez @ redkeydigital.com

Mais conteúdo relacionado

Mais procurados

Mais procurados (19)

Jenkins to Gitlab - Intelligent Build-Pipelines
Jenkins to Gitlab - Intelligent Build-PipelinesJenkins to Gitlab - Intelligent Build-Pipelines
Jenkins to Gitlab - Intelligent Build-Pipelines
 
Jenkins days workshop pipelines - Eric Long
Jenkins days workshop  pipelines - Eric LongJenkins days workshop  pipelines - Eric Long
Jenkins days workshop pipelines - Eric Long
 
Getting Started With Jenkins And Drupal
Getting Started With Jenkins And DrupalGetting Started With Jenkins And Drupal
Getting Started With Jenkins And Drupal
 
Getting started with Octopus Deploy
Getting started with Octopus DeployGetting started with Octopus Deploy
Getting started with Octopus Deploy
 
"13 ways to run web applications on the Internet" Andrii Shumada
"13 ways to run web applications on the Internet" Andrii Shumada"13 ways to run web applications on the Internet" Andrii Shumada
"13 ways to run web applications on the Internet" Andrii Shumada
 
Improve your Java Environment with Docker
Improve your Java Environment with DockerImprove your Java Environment with Docker
Improve your Java Environment with Docker
 
Intro to Git for Drupal 7
Intro to Git for Drupal 7Intro to Git for Drupal 7
Intro to Git for Drupal 7
 
Madison PHP 2015 - DevOps For Small Teams
Madison PHP 2015 - DevOps For Small TeamsMadison PHP 2015 - DevOps For Small Teams
Madison PHP 2015 - DevOps For Small Teams
 
Learn jobDSL for Jenkins
Learn jobDSL for JenkinsLearn jobDSL for Jenkins
Learn jobDSL for Jenkins
 
Test-Driven Infrastructure with Chef
Test-Driven Infrastructure with ChefTest-Driven Infrastructure with Chef
Test-Driven Infrastructure with Chef
 
Automated Infrastructure and Application Management
Automated Infrastructure and Application ManagementAutomated Infrastructure and Application Management
Automated Infrastructure and Application Management
 
Brujug Jenkins pipeline scalability
Brujug Jenkins pipeline scalabilityBrujug Jenkins pipeline scalability
Brujug Jenkins pipeline scalability
 
CI : the first_step: Auto Testing with CircleCI - (MOSG)
CI : the first_step: Auto Testing with CircleCI - (MOSG)CI : the first_step: Auto Testing with CircleCI - (MOSG)
CI : the first_step: Auto Testing with CircleCI - (MOSG)
 
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
Learning chef
Learning chefLearning chef
Learning chef
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
 
1. react - native: setup
1. react - native: setup1. react - native: setup
1. react - native: setup
 
Drupal Continuous Integration with Jenkins - Deploy
Drupal Continuous Integration with Jenkins - DeployDrupal Continuous Integration with Jenkins - Deploy
Drupal Continuous Integration with Jenkins - Deploy
 

Destaque

169 Ch 26_lecture_presentation
 169 Ch 26_lecture_presentation 169 Ch 26_lecture_presentation
169 Ch 26_lecture_presentation
gwrandall
 
169 Ch 27_lecture_presentation
 169 Ch 27_lecture_presentation 169 Ch 27_lecture_presentation
169 Ch 27_lecture_presentation
gwrandall
 
163 ch 17_lecture_presentation
163 ch 17_lecture_presentation163 ch 17_lecture_presentation
163 ch 17_lecture_presentation
gwrandall
 
163 ch 15_lecture_presentation
163 ch 15_lecture_presentation163 ch 15_lecture_presentation
163 ch 15_lecture_presentation
gwrandall
 
163 ch 01_lecture_presentation
163 ch 01_lecture_presentation163 ch 01_lecture_presentation
163 ch 01_lecture_presentation
gwrandall
 
163 ch 11_lecture_presentation
163 ch 11_lecture_presentation163 ch 11_lecture_presentation
163 ch 11_lecture_presentation
gwrandall
 
163 ch 07_lecture_presentation
163 ch 07_lecture_presentation163 ch 07_lecture_presentation
163 ch 07_lecture_presentation
gwrandall
 
169 Ch 28_lecture_presentation
 169 Ch 28_lecture_presentation 169 Ch 28_lecture_presentation
169 Ch 28_lecture_presentation
gwrandall
 
163 ch 14_lecture_presentation
163 ch 14_lecture_presentation163 ch 14_lecture_presentation
163 ch 14_lecture_presentation
gwrandall
 
169 Ch 21_lecture_presentation
 169 Ch 21_lecture_presentation 169 Ch 21_lecture_presentation
169 Ch 21_lecture_presentation
gwrandall
 
169 Ch 19_lecture_presentation
 169 Ch 19_lecture_presentation 169 Ch 19_lecture_presentation
169 Ch 19_lecture_presentation
gwrandall
 
169 Ch 23_lecture_presentation
 169 Ch 23_lecture_presentation 169 Ch 23_lecture_presentation
169 Ch 23_lecture_presentation
gwrandall
 
169 Ch 22_lecture_presentation
 169 Ch 22_lecture_presentation 169 Ch 22_lecture_presentation
169 Ch 22_lecture_presentation
gwrandall
 
169 Ch 20_lecture_presentation
 169 Ch 20_lecture_presentation 169 Ch 20_lecture_presentation
169 Ch 20_lecture_presentation
gwrandall
 
169 Ch 29_lecture_presentation
 169 Ch 29_lecture_presentation 169 Ch 29_lecture_presentation
169 Ch 29_lecture_presentation
gwrandall
 
163 ch 19_lecture_presentation
163 ch 19_lecture_presentation163 ch 19_lecture_presentation
163 ch 19_lecture_presentation
gwrandall
 

Destaque (20)

TirtheshPrajapatiBday
TirtheshPrajapatiBdayTirtheshPrajapatiBday
TirtheshPrajapatiBday
 
Prueba gbi
Prueba gbiPrueba gbi
Prueba gbi
 
Flp web app presentation
Flp web app presentationFlp web app presentation
Flp web app presentation
 
169 Ch 26_lecture_presentation
 169 Ch 26_lecture_presentation 169 Ch 26_lecture_presentation
169 Ch 26_lecture_presentation
 
169 Ch 27_lecture_presentation
 169 Ch 27_lecture_presentation 169 Ch 27_lecture_presentation
169 Ch 27_lecture_presentation
 
163 ch 17_lecture_presentation
163 ch 17_lecture_presentation163 ch 17_lecture_presentation
163 ch 17_lecture_presentation
 
163 ch 15_lecture_presentation
163 ch 15_lecture_presentation163 ch 15_lecture_presentation
163 ch 15_lecture_presentation
 
Propiedades de los materiales
Propiedades de los materialesPropiedades de los materiales
Propiedades de los materiales
 
163 ch 01_lecture_presentation
163 ch 01_lecture_presentation163 ch 01_lecture_presentation
163 ch 01_lecture_presentation
 
163 ch 11_lecture_presentation
163 ch 11_lecture_presentation163 ch 11_lecture_presentation
163 ch 11_lecture_presentation
 
163 ch 07_lecture_presentation
163 ch 07_lecture_presentation163 ch 07_lecture_presentation
163 ch 07_lecture_presentation
 
169 Ch 28_lecture_presentation
 169 Ch 28_lecture_presentation 169 Ch 28_lecture_presentation
169 Ch 28_lecture_presentation
 
163 ch 14_lecture_presentation
163 ch 14_lecture_presentation163 ch 14_lecture_presentation
163 ch 14_lecture_presentation
 
169 Ch 21_lecture_presentation
 169 Ch 21_lecture_presentation 169 Ch 21_lecture_presentation
169 Ch 21_lecture_presentation
 
169 Ch 19_lecture_presentation
 169 Ch 19_lecture_presentation 169 Ch 19_lecture_presentation
169 Ch 19_lecture_presentation
 
169 Ch 23_lecture_presentation
 169 Ch 23_lecture_presentation 169 Ch 23_lecture_presentation
169 Ch 23_lecture_presentation
 
169 Ch 22_lecture_presentation
 169 Ch 22_lecture_presentation 169 Ch 22_lecture_presentation
169 Ch 22_lecture_presentation
 
169 Ch 20_lecture_presentation
 169 Ch 20_lecture_presentation 169 Ch 20_lecture_presentation
169 Ch 20_lecture_presentation
 
169 Ch 29_lecture_presentation
 169 Ch 29_lecture_presentation 169 Ch 29_lecture_presentation
169 Ch 29_lecture_presentation
 
163 ch 19_lecture_presentation
163 ch 19_lecture_presentation163 ch 19_lecture_presentation
163 ch 19_lecture_presentation
 

Semelhante a Automated Drupal deployment with Git and Capistrano

Embracing Distributed Version Control
Embracing Distributed Version ControlEmbracing Distributed Version Control
Embracing Distributed Version Control
Nowell Strite
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshare
tomcopeland
 
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison DowdneySetting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Weaveworks
 

Semelhante a Automated Drupal deployment with Git and Capistrano (20)

Embracing Distributed Version Control
Embracing Distributed Version ControlEmbracing Distributed Version Control
Embracing Distributed Version Control
 
Development Setup of B-Translator
Development Setup of B-TranslatorDevelopment Setup of B-Translator
Development Setup of B-Translator
 
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
 
Git
GitGit
Git
 
Control your deployments with Capistrano
Control your deployments with CapistranoControl your deployments with Capistrano
Control your deployments with Capistrano
 
Git workflows presentation
Git workflows presentationGit workflows presentation
Git workflows presentation
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshare
 
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
 
Instrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con GitlabInstrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con Gitlab
 
Deploying TYPO3 Neos websites using Surf
Deploying TYPO3 Neos websites using SurfDeploying TYPO3 Neos websites using Surf
Deploying TYPO3 Neos websites using Surf
 
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison DowdneySetting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
 
Introduction to FreeNAS development by John Hixson
Introduction to FreeNAS development by John HixsonIntroduction to FreeNAS development by John Hixson
Introduction to FreeNAS development by John Hixson
 
Professional deployment
Professional deploymentProfessional deployment
Professional deployment
 
Acquia BLT for the Win, or How to speed up the project setup, development an...
Acquia BLT for the Win, or  How to speed up the project setup, development an...Acquia BLT for the Win, or  How to speed up the project setup, development an...
Acquia BLT for the Win, or How to speed up the project setup, development an...
 
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)
 
Version Control ThinkVitamin
Version Control ThinkVitaminVersion Control ThinkVitamin
Version Control ThinkVitamin
 
Magento Performance Optimization 101
Magento Performance Optimization 101Magento Performance Optimization 101
Magento Performance Optimization 101
 
Capistrano
CapistranoCapistrano
Capistrano
 

Último

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

Automated Drupal deployment with Git and Capistrano