SlideShare uma empresa Scribd logo
1 de 40
Baixar para ler offline
Bastian Widmer / @dasrecht
Manage and Deploy your
sites with Drush
Who are you?
Bastian Widmer
@dasrecht / bastianwidmer.ch
Switzerland
DevOps @ Amazee Labs
Agenda 1 Introduction
2
3
4
5
Where we want to go!
Where we are today?
Putting it together
Outlook to D8
Where we are today
• 3rd party deployment frameworks 

(e.g. capistrano, idephix)
• Deployment „Strategies“
• rsync
• scp
• ftp upload
• git pull (and pray)
Cluster SSH, anyone?
„the DevOps way to kill 5 servers with one keystroke“
Where we want to go!
• Deploying with a tool we know at heart : DRUSH
• Multi Server Deployments
• Running Tasks
• Git Remote cache
• Possibility to rollback a release
Where we want to go!
• Deploying with a tool we know at heart : DRUSH
• Multi Server Deployments
• Running Tasks
• Git Remote cache
• Possibility to rollback a release
More Automation leaves less
room to human error
Look at your future
deployment
Now, back to me…
Putting the parts together, shall we?
Parts 1 Installing Drush Deploy
2
3
4
Drush Deploy Configuration
Drush Aliases
The first deployment
Installing drush-deploy
• cd ~/.drush
• git clone --branch 7.x-1.x http://git.drupal.org/
project/drush_deploy.git
Now getting your
Drupal site ready
Standardisation!
• Cleanup your environments
• Establish standards for
• Configurations (e.g. settings.php)
• File paths (/sites/defaults/files)
• Webroot paths
aliases.drushrc.php
1 <?php!
2 $aliases['web1'] = array(!
3 'root' => '/var/www/drupal',!
4 'remote-user' => 'www-data',!
5 'remote-host' => 'web1.example.com',!
6 );!
7 $aliases['web2'] = $aliases['web1'];!
8 $aliases['web2']['remote-host'] = 'web2.example.com';!
9 ?>!
1 <?php!
2 $aliases['web1'] = array(!
3 'root' => '/var/www/drupal',!
4 'remote-user' => 'www-data',!
5 'remote-host' => 'web1.example.com',!
6 );!
7 $aliases['web2'] = $aliases['web1'];!
8 $aliases['web2']['remote-host'] = 'web2.example.com';!
9 ?>!
drush @web1 user-login
drush sql-sync @web1 default
aliases.drushrc.php
Drush Deploy
Configuration
deploy.drushrc.php
1 <?php!
2 $options['application'] = 'drupal';!
3 $options['deploy-repository'] = 'git@github.com:AmazeeLabs/
new-site.git';!
4 $options['branch'] = "live";!
5 $options['keep-releases'] = 3;!
6 $options['deploy-via'] = 'RemoteCache';!
7 $options['docroot'] = '/var/www/drupal';!
8 $options['git_enable_submodules'] = TRUE;!
9 ?>!
deploy.drushrc.php
1 <?php!
2 $options['application'] = 'drupal';!
3 $options['deploy-repository'] = 'git@github.com:AmazeeLabs/
new-site.git';!
4 $options['branch'] = "live";!
5 $options['keep-releases'] = 3;!
6 $options['deploy-via'] = 'RemoteCache';!
7 $options['docroot'] = '/var/www/drupal';!
8 $options['git_enable_submodules'] = TRUE;!
9 ?>!
deploy.drushrc.php
1 <?php!
2 $options['application'] = 'drupal';!
3 $options['deploy-repository'] = 'git@github.com:AmazeeLabs/
new-site.git';!
4 $options['branch'] = "live";!
5 $options['keep-releases'] = 3;!
6 $options['deploy-via'] = 'RemoteCache';!
7 $options['docroot'] = '/var/www/drupal';!
8 $options['git_enable_submodules'] = TRUE;!
9 ?>!
Adopt a GIT Workflow
Git Flow : http://s.nrdy.ch/git-flow
deploy.drushrc.php
1 <?php!
2 $options['application'] = 'drupal';!
3 $options['deploy-repository'] = 'git@github.com:AmazeeLabs/
new-site.git';!
4 $options['branch'] = "live";!
5 $options['keep-releases'] = 3;!
6 $options['deploy-via'] = 'RemoteCache';!
7 $options['docroot'] = '/var/www/drupal';!
8 $options['git_enable_submodules'] = TRUE;!
9 ?>!
deploy.drushrc.php
1 <?php!
2 $options['application'] = 'drupal';!
3 $options['deploy-repository'] = 'git@github.com:AmazeeLabs/
new-site.git';!
4 $options['branch'] = "live";!
5 $options['keep-releases'] = 3;!
6 $options['deploy-via'] = 'RemoteCache';!
7 $options['docroot'] = '/var/www/drupal';!
8 $options['git_enable_submodules'] = TRUE;!
9 ?>!
keep-releases allows you
to roll back to the last state
deploy.drushrc.php
1 <?php!
2 $options['application'] = 'drupal';!
3 $options['deploy-repository'] = 'git@github.com:AmazeeLabs/
new-site.git';!
4 $options['branch'] = "live";!
5 $options['keep-releases'] = 3;!
6 $options['deploy-via'] = 'RemoteCache';!
7 $options['docroot'] = '/var/www/drupal';!
8 $options['git_enable_submodules'] = TRUE;!
9 ?>!
Filesystem Structure
Prepare your server :
drush deploy-setup
@web1
Filesystem Structure
Current Release
Is a symlink to the
latest release
directory
Filesystem Structure
Releases
Filesystem Structure
Shared (Git Cache /
Configuration)
Filesystem Structure
Webroot (symlink to current)
• updates your remote cache
• initializes and updates git submodules
• creates a new release directory
• copies your current codebase to the release directory
• executes your tasks
• links the ‚current‘ directory with your new deployed
code
drush deploy @web1
drush deploy-rollback @web1
• relinks the current directory with the last release
• removes the faulty release
Nice but what about
drush deploy @live
aliases.drushrc.php
• Multi Server Deployments? Alias Lists!
10 $aliases['live'] = array(!
11 'site-list' => array('@web1', '@web2');!
12 );
http://drush.ws/examples/
example.aliases.drushrc.php
Automated aliases!
• aliases are built on the fly
• information about servers is stored in a json file
• server groups are built automatically
Automated aliases!
1 <?php!
2 !
3 $sitename = 'CHANGEME';!
4 !
5 // - DO NOT make changes below this Comment!
6 !
7 // Basic error handling!
8 if($sitename == 'CHANGEME')!
9 die("[ERROR] - Luke, you should change the Sitename in
aliases.drushrc.php!n“);!
10 …!
http://s.nrdy.ch/drush-aliases
Time to Implement?
Deployment Tasks
• Before or after moving to new version
• on one or all servers
1 $options['before']['deploy-symlink'][] = 'deploy_settings_php_task';!
2 /**!
3 * The task needs to be defined with a @task "decorator" in the comment block
preceding it!
4 * @task!
5 */!
6 function deploy_settings_php_task($d) {!
7 $d->run("cp /home/nfs_share/www-data/`whoami`/settings.php ~/deploy/drupal/
shared/settings.php", $d->latest_release());!
8 }!
Deployment Tasks
• update and link settings.php
• link /sites/default/files
• drush updb
• drush cc all
• notify NewRelic about the deployment
Missing Things
• „I just want to update code“ - without running
Tasks
• adding ssh known hosts - connecting to github
on a new vhost
Outlook Drupal 8
• Configuration Management Initiative

www.drupal8cmi.org
• Dealing with Configuration Files
• HEAD is currently moving fast, so changes apply
and deployment might not be as easy as with D7
Take Home
• You don’t have to do all at once
• Automatic aliases files are awesome
• Cleanup your environments
• Standardisation saves time
• Deployments are fun (with drush deploy)
Thank you for having me
here!
Slides : http://s.nrdy.ch/drush-deploy

Mais conteúdo relacionado

Mais procurados

Open Atrium (DrupalCon Paris 2009, Day 3)
Open Atrium (DrupalCon Paris 2009, Day 3)Open Atrium (DrupalCon Paris 2009, Day 3)
Open Atrium (DrupalCon Paris 2009, Day 3)
Cameron Eagans
 
Set up Hadoop Cluster on Amazon EC2
Set up Hadoop Cluster on Amazon EC2Set up Hadoop Cluster on Amazon EC2
Set up Hadoop Cluster on Amazon EC2
IMC Institute
 
London devops logging
London devops loggingLondon devops logging
London devops logging
Tomas Doran
 

Mais procurados (20)

Ansible Meetup Hamburg / Quickstart
Ansible Meetup Hamburg / QuickstartAnsible Meetup Hamburg / Quickstart
Ansible Meetup Hamburg / Quickstart
 
Puppet Development Workflow
Puppet Development WorkflowPuppet Development Workflow
Puppet Development Workflow
 
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2Dev ninja  -> vagrant + virtualbox + chef-solo + git + ec2
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
 
Steamlining your puppet development workflow
Steamlining your puppet development workflowSteamlining your puppet development workflow
Steamlining your puppet development workflow
 
Open Atrium (DrupalCon Paris 2009, Day 3)
Open Atrium (DrupalCon Paris 2009, Day 3)Open Atrium (DrupalCon Paris 2009, Day 3)
Open Atrium (DrupalCon Paris 2009, Day 3)
 
Hadoop on ec2
Hadoop on ec2Hadoop on ec2
Hadoop on ec2
 
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
 
Puppet
PuppetPuppet
Puppet
 
Designing net-aws-glacier
Designing net-aws-glacierDesigning net-aws-glacier
Designing net-aws-glacier
 
OpenStack Austin Meetup January 2014: Chef + OpenStack
OpenStack Austin Meetup January 2014: Chef + OpenStackOpenStack Austin Meetup January 2014: Chef + OpenStack
OpenStack Austin Meetup January 2014: Chef + OpenStack
 
Functional Hostnames and Why they are Bad
Functional Hostnames and Why they are BadFunctional Hostnames and Why they are Bad
Functional Hostnames and Why they are Bad
 
Augeas, swiss knife resources for your puppet tree
Augeas, swiss knife resources for your puppet treeAugeas, swiss knife resources for your puppet tree
Augeas, swiss knife resources for your puppet tree
 
Version Control for Mere Mortals
Version Control for Mere MortalsVersion Control for Mere Mortals
Version Control for Mere Mortals
 
Set up Hadoop Cluster on Amazon EC2
Set up Hadoop Cluster on Amazon EC2Set up Hadoop Cluster on Amazon EC2
Set up Hadoop Cluster on Amazon EC2
 
Git presentation
Git presentationGit presentation
Git presentation
 
Atlanta OpenStack 2014 Chef for OpenStack Deployment Workshop
Atlanta OpenStack 2014 Chef for OpenStack Deployment WorkshopAtlanta OpenStack 2014 Chef for OpenStack Deployment Workshop
Atlanta OpenStack 2014 Chef for OpenStack Deployment Workshop
 
Cyansible
CyansibleCyansible
Cyansible
 
London devops logging
London devops loggingLondon devops logging
London devops logging
 
Chef for OpenStack: OpenStack Spring Summit 2013
Chef for OpenStack: OpenStack Spring Summit 2013Chef for OpenStack: OpenStack Spring Summit 2013
Chef for OpenStack: OpenStack Spring Summit 2013
 
Picconf12
Picconf12Picconf12
Picconf12
 

Semelhante a Manage and Deploy your sites with Drush

Depolying Drupal with Git, Drush Make and Capistrano
Depolying Drupal with Git, Drush Make and CapistranoDepolying Drupal with Git, Drush Make and Capistrano
Depolying Drupal with Git, Drush Make and Capistrano
libsys
 
Drush and drupal. администрирование волчек михаил
Drush and drupal. администрирование  волчек михаилDrush and drupal. администрирование  волчек михаил
Drush and drupal. администрирование волчек михаил
drupalconf
 
Drush and drupal. администрирование. Волчек Михаил
Drush and drupal. администрирование. Волчек МихаилDrush and drupal. администрирование. Волчек Михаил
Drush and drupal. администрирование. Волчек Михаил
PVasili
 
Deploying Rails Applications with Capistrano
Deploying Rails Applications with CapistranoDeploying Rails Applications with Capistrano
Deploying Rails Applications with Capistrano
Almir Mendes
 
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDaysLuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
Luis Rodríguez Castromil
 
SF Gradle Meetup - Netflix OSS
SF Gradle Meetup - Netflix OSSSF Gradle Meetup - Netflix OSS
SF Gradle Meetup - Netflix OSS
Justin Ryan
 

Semelhante a Manage and Deploy your sites with Drush (20)

Test like a_boss
Test like a_bossTest like a_boss
Test like a_boss
 
Dcp'14 drush
Dcp'14 drushDcp'14 drush
Dcp'14 drush
 
Face your fears: Drush and Aegir
Face your fears: Drush and AegirFace your fears: Drush and Aegir
Face your fears: Drush and Aegir
 
Depolying Drupal with Git, Drush Make and Capistrano
Depolying Drupal with Git, Drush Make and CapistranoDepolying Drupal with Git, Drush Make and Capistrano
Depolying Drupal with Git, Drush Make and Capistrano
 
Intro to Drush
Intro to DrushIntro to Drush
Intro to Drush
 
Drush and drupal. администрирование волчек михаил
Drush and drupal. администрирование  волчек михаилDrush and drupal. администрирование  волчек михаил
Drush and drupal. администрирование волчек михаил
 
Drush and drupal. администрирование. Волчек Михаил
Drush and drupal. администрирование. Волчек МихаилDrush and drupal. администрирование. Волчек Михаил
Drush and drupal. администрирование. Волчек Михаил
 
Pure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talkPure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talk
 
Deployer - Deployment tool for PHP
Deployer - Deployment tool for PHPDeployer - Deployment tool for PHP
Deployer - Deployment tool for PHP
 
Deploying Rails Applications with Capistrano
Deploying Rails Applications with CapistranoDeploying Rails Applications with Capistrano
Deploying Rails Applications with Capistrano
 
A Drush Primer - DrupalCamp Chattanooga 2013
A Drush Primer - DrupalCamp Chattanooga 2013A Drush Primer - DrupalCamp Chattanooga 2013
A Drush Primer - DrupalCamp Chattanooga 2013
 
Test complex database systems in your laptop with dbdeployer
Test complex database systems in your laptop with dbdeployerTest complex database systems in your laptop with dbdeployer
Test complex database systems in your laptop with dbdeployer
 
[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
 
Full-Stack CakePHP Deployment
Full-Stack CakePHP DeploymentFull-Stack CakePHP Deployment
Full-Stack CakePHP Deployment
 
From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...
From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...
From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...
 
DevOps in PHP environment
DevOps in PHP environment DevOps in PHP environment
DevOps in PHP environment
 
Twas the night before Malware...
Twas the night before Malware...Twas the night before Malware...
Twas the night before Malware...
 
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDaysLuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
 
Dbdeployer
DbdeployerDbdeployer
Dbdeployer
 
SF Gradle Meetup - Netflix OSS
SF Gradle Meetup - Netflix OSSSF Gradle Meetup - Netflix OSS
SF Gradle Meetup - Netflix OSS
 

Mais de Amazee Labs

Sonova.com building multilingual and multidomain drupal website
Sonova.com building multilingual and multidomain drupal websiteSonova.com building multilingual and multidomain drupal website
Sonova.com building multilingual and multidomain drupal website
Amazee Labs
 
Strategy Session (DrupalCamp CO)
Strategy Session (DrupalCamp CO)Strategy Session (DrupalCamp CO)
Strategy Session (DrupalCamp CO)
Amazee Labs
 
Amazee web expresso 2 2014
Amazee web expresso 2 2014Amazee web expresso 2 2014
Amazee web expresso 2 2014
Amazee Labs
 
Web express-drupal-8
Web express-drupal-8Web express-drupal-8
Web express-drupal-8
Amazee Labs
 
Logging with Elasticsearch, Logstash & Kibana
Logging with Elasticsearch, Logstash & KibanaLogging with Elasticsearch, Logstash & Kibana
Logging with Elasticsearch, Logstash & Kibana
Amazee Labs
 
Web Expresso: Drupal 8 - What's new
Web Expresso: Drupal 8 - What's newWeb Expresso: Drupal 8 - What's new
Web Expresso: Drupal 8 - What's new
Amazee Labs
 
Translation Management
Translation ManagementTranslation Management
Translation Management
Amazee Labs
 
Drupal High Availability High Performance 2012
Drupal High Availability High Performance 2012Drupal High Availability High Performance 2012
Drupal High Availability High Performance 2012
Amazee Labs
 

Mais de Amazee Labs (20)

Marketingtag17 - Master Class "Digital Survival Guide"
Marketingtag17 - Master Class "Digital Survival Guide"Marketingtag17 - Master Class "Digital Survival Guide"
Marketingtag17 - Master Class "Digital Survival Guide"
 
WebExpresso Agiles Projektmanagement 03/03/2016
WebExpresso Agiles Projektmanagement 03/03/2016WebExpresso Agiles Projektmanagement 03/03/2016
WebExpresso Agiles Projektmanagement 03/03/2016
 
Drupal 8 deeper dive
Drupal 8 deeper diveDrupal 8 deeper dive
Drupal 8 deeper dive
 
How to run a successful Drupal shop
How to run a successful Drupal shopHow to run a successful Drupal shop
How to run a successful Drupal shop
 
Messbarkeit seo performance
Messbarkeit seo performance Messbarkeit seo performance
Messbarkeit seo performance
 
Drupalcamp London 2015
Drupalcamp London 2015Drupalcamp London 2015
Drupalcamp London 2015
 
Sonova.com building multilingual and multidomain drupal website
Sonova.com building multilingual and multidomain drupal websiteSonova.com building multilingual and multidomain drupal website
Sonova.com building multilingual and multidomain drupal website
 
WebExpresso - Switch the Switch
WebExpresso - Switch the SwitchWebExpresso - Switch the Switch
WebExpresso - Switch the Switch
 
My Job Is Harder Than Yours (D4D Boston 2014)
My Job Is Harder Than Yours (D4D Boston 2014)My Job Is Harder Than Yours (D4D Boston 2014)
My Job Is Harder Than Yours (D4D Boston 2014)
 
Strategy Session (DrupalCamp CO)
Strategy Session (DrupalCamp CO)Strategy Session (DrupalCamp CO)
Strategy Session (DrupalCamp CO)
 
Amazee web expresso 2 2014
Amazee web expresso 2 2014Amazee web expresso 2 2014
Amazee web expresso 2 2014
 
Web express-drupal-8
Web express-drupal-8Web express-drupal-8
Web express-drupal-8
 
Logging with Elasticsearch, Logstash & Kibana
Logging with Elasticsearch, Logstash & KibanaLogging with Elasticsearch, Logstash & Kibana
Logging with Elasticsearch, Logstash & Kibana
 
Overwriting code in Drupal
Overwriting code in DrupalOverwriting code in Drupal
Overwriting code in Drupal
 
Web Expresso: Drupal 8 - What's new
Web Expresso: Drupal 8 - What's newWeb Expresso: Drupal 8 - What's new
Web Expresso: Drupal 8 - What's new
 
There are no bad clients, just bad project managers
There are no bad clients, just bad project managersThere are no bad clients, just bad project managers
There are no bad clients, just bad project managers
 
Translation Management
Translation ManagementTranslation Management
Translation Management
 
Drupal High Availability High Performance 2012
Drupal High Availability High Performance 2012Drupal High Availability High Performance 2012
Drupal High Availability High Performance 2012
 
Drupal für Entwickler
Drupal für EntwicklerDrupal für Entwickler
Drupal für Entwickler
 
Responsive Web Design - Ein Überblick
Responsive Web Design - Ein ÜberblickResponsive Web Design - Ein Überblick
Responsive Web Design - Ein Überblick
 

Último

Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Monica Sydney
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Monica Sydney
 
75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx
Asmae Rabhi
 
PowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxPowerDirector Explination Process...pptx
PowerDirector Explination Process...pptx
galaxypingy
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
gajnagarg
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
JOHNBEBONYAP1
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
pxcywzqs
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
ydyuyu
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
ydyuyu
 

Último (20)

20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
 
75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
PowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxPowerDirector Explination Process...pptx
PowerDirector Explination Process...pptx
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
 
Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck Microsoft
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
 
Power point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria IuzzolinoPower point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria Iuzzolino
 
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
 

Manage and Deploy your sites with Drush

  • 1. Bastian Widmer / @dasrecht Manage and Deploy your sites with Drush
  • 2. Who are you? Bastian Widmer @dasrecht / bastianwidmer.ch Switzerland DevOps @ Amazee Labs
  • 3. Agenda 1 Introduction 2 3 4 5 Where we want to go! Where we are today? Putting it together Outlook to D8
  • 4. Where we are today • 3rd party deployment frameworks 
 (e.g. capistrano, idephix) • Deployment „Strategies“ • rsync • scp • ftp upload • git pull (and pray)
  • 5. Cluster SSH, anyone? „the DevOps way to kill 5 servers with one keystroke“
  • 6. Where we want to go! • Deploying with a tool we know at heart : DRUSH • Multi Server Deployments • Running Tasks • Git Remote cache • Possibility to rollback a release
  • 7. Where we want to go! • Deploying with a tool we know at heart : DRUSH • Multi Server Deployments • Running Tasks • Git Remote cache • Possibility to rollback a release More Automation leaves less room to human error
  • 8. Look at your future deployment
  • 9. Now, back to me… Putting the parts together, shall we?
  • 10. Parts 1 Installing Drush Deploy 2 3 4 Drush Deploy Configuration Drush Aliases The first deployment
  • 11. Installing drush-deploy • cd ~/.drush • git clone --branch 7.x-1.x http://git.drupal.org/ project/drush_deploy.git
  • 13. Standardisation! • Cleanup your environments • Establish standards for • Configurations (e.g. settings.php) • File paths (/sites/defaults/files) • Webroot paths
  • 14. aliases.drushrc.php 1 <?php! 2 $aliases['web1'] = array(! 3 'root' => '/var/www/drupal',! 4 'remote-user' => 'www-data',! 5 'remote-host' => 'web1.example.com',! 6 );! 7 $aliases['web2'] = $aliases['web1'];! 8 $aliases['web2']['remote-host'] = 'web2.example.com';! 9 ?>!
  • 15. 1 <?php! 2 $aliases['web1'] = array(! 3 'root' => '/var/www/drupal',! 4 'remote-user' => 'www-data',! 5 'remote-host' => 'web1.example.com',! 6 );! 7 $aliases['web2'] = $aliases['web1'];! 8 $aliases['web2']['remote-host'] = 'web2.example.com';! 9 ?>! drush @web1 user-login drush sql-sync @web1 default aliases.drushrc.php
  • 17. deploy.drushrc.php 1 <?php! 2 $options['application'] = 'drupal';! 3 $options['deploy-repository'] = 'git@github.com:AmazeeLabs/ new-site.git';! 4 $options['branch'] = "live";! 5 $options['keep-releases'] = 3;! 6 $options['deploy-via'] = 'RemoteCache';! 7 $options['docroot'] = '/var/www/drupal';! 8 $options['git_enable_submodules'] = TRUE;! 9 ?>!
  • 18. deploy.drushrc.php 1 <?php! 2 $options['application'] = 'drupal';! 3 $options['deploy-repository'] = 'git@github.com:AmazeeLabs/ new-site.git';! 4 $options['branch'] = "live";! 5 $options['keep-releases'] = 3;! 6 $options['deploy-via'] = 'RemoteCache';! 7 $options['docroot'] = '/var/www/drupal';! 8 $options['git_enable_submodules'] = TRUE;! 9 ?>!
  • 19. deploy.drushrc.php 1 <?php! 2 $options['application'] = 'drupal';! 3 $options['deploy-repository'] = 'git@github.com:AmazeeLabs/ new-site.git';! 4 $options['branch'] = "live";! 5 $options['keep-releases'] = 3;! 6 $options['deploy-via'] = 'RemoteCache';! 7 $options['docroot'] = '/var/www/drupal';! 8 $options['git_enable_submodules'] = TRUE;! 9 ?>! Adopt a GIT Workflow Git Flow : http://s.nrdy.ch/git-flow
  • 20. deploy.drushrc.php 1 <?php! 2 $options['application'] = 'drupal';! 3 $options['deploy-repository'] = 'git@github.com:AmazeeLabs/ new-site.git';! 4 $options['branch'] = "live";! 5 $options['keep-releases'] = 3;! 6 $options['deploy-via'] = 'RemoteCache';! 7 $options['docroot'] = '/var/www/drupal';! 8 $options['git_enable_submodules'] = TRUE;! 9 ?>!
  • 21. deploy.drushrc.php 1 <?php! 2 $options['application'] = 'drupal';! 3 $options['deploy-repository'] = 'git@github.com:AmazeeLabs/ new-site.git';! 4 $options['branch'] = "live";! 5 $options['keep-releases'] = 3;! 6 $options['deploy-via'] = 'RemoteCache';! 7 $options['docroot'] = '/var/www/drupal';! 8 $options['git_enable_submodules'] = TRUE;! 9 ?>! keep-releases allows you to roll back to the last state
  • 22. deploy.drushrc.php 1 <?php! 2 $options['application'] = 'drupal';! 3 $options['deploy-repository'] = 'git@github.com:AmazeeLabs/ new-site.git';! 4 $options['branch'] = "live";! 5 $options['keep-releases'] = 3;! 6 $options['deploy-via'] = 'RemoteCache';! 7 $options['docroot'] = '/var/www/drupal';! 8 $options['git_enable_submodules'] = TRUE;! 9 ?>!
  • 23. Filesystem Structure Prepare your server : drush deploy-setup @web1
  • 24. Filesystem Structure Current Release Is a symlink to the latest release directory
  • 26. Filesystem Structure Shared (Git Cache / Configuration)
  • 28. • updates your remote cache • initializes and updates git submodules • creates a new release directory • copies your current codebase to the release directory • executes your tasks • links the ‚current‘ directory with your new deployed code drush deploy @web1
  • 29. drush deploy-rollback @web1 • relinks the current directory with the last release • removes the faulty release
  • 30. Nice but what about drush deploy @live
  • 31. aliases.drushrc.php • Multi Server Deployments? Alias Lists! 10 $aliases['live'] = array(! 11 'site-list' => array('@web1', '@web2');! 12 ); http://drush.ws/examples/ example.aliases.drushrc.php
  • 32. Automated aliases! • aliases are built on the fly • information about servers is stored in a json file • server groups are built automatically
  • 33. Automated aliases! 1 <?php! 2 ! 3 $sitename = 'CHANGEME';! 4 ! 5 // - DO NOT make changes below this Comment! 6 ! 7 // Basic error handling! 8 if($sitename == 'CHANGEME')! 9 die("[ERROR] - Luke, you should change the Sitename in aliases.drushrc.php!n“);! 10 …! http://s.nrdy.ch/drush-aliases
  • 35. Deployment Tasks • Before or after moving to new version • on one or all servers 1 $options['before']['deploy-symlink'][] = 'deploy_settings_php_task';! 2 /**! 3 * The task needs to be defined with a @task "decorator" in the comment block preceding it! 4 * @task! 5 */! 6 function deploy_settings_php_task($d) {! 7 $d->run("cp /home/nfs_share/www-data/`whoami`/settings.php ~/deploy/drupal/ shared/settings.php", $d->latest_release());! 8 }!
  • 36. Deployment Tasks • update and link settings.php • link /sites/default/files • drush updb • drush cc all • notify NewRelic about the deployment
  • 37. Missing Things • „I just want to update code“ - without running Tasks • adding ssh known hosts - connecting to github on a new vhost
  • 38. Outlook Drupal 8 • Configuration Management Initiative
 www.drupal8cmi.org • Dealing with Configuration Files • HEAD is currently moving fast, so changes apply and deployment might not be as easy as with D7
  • 39. Take Home • You don’t have to do all at once • Automatic aliases files are awesome • Cleanup your environments • Standardisation saves time • Deployments are fun (with drush deploy)
  • 40. Thank you for having me here! Slides : http://s.nrdy.ch/drush-deploy