SlideShare una empresa de Scribd logo
1 de 40
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

Ansible Meetup Hamburg / Quickstart
Ansible Meetup Hamburg / QuickstartAnsible Meetup Hamburg / Quickstart
Ansible Meetup Hamburg / QuickstartHenry Stamerjohann
 
Puppet Development Workflow
Puppet Development WorkflowPuppet Development Workflow
Puppet Development WorkflowJeffery Smith
 
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 + ec2Yros
 
Steamlining your puppet development workflow
Steamlining your puppet development workflowSteamlining your puppet development workflow
Steamlining your puppet development workflowTomas Doran
 
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
 
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
 
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 + OpenStackMatt Ray
 
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 BadPuppet
 
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 treeJulien Pivotto
 
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 EC2IMC Institute
 
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 WorkshopMatt Ray
 
London devops logging
London devops loggingLondon devops logging
London devops loggingTomas Doran
 
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 2013Matt Ray
 

La actualidad más candente (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
 

Similar a Manage and Deploy your sites with Drush

Face your fears: Drush and Aegir
Face your fears: Drush and AegirFace your fears: Drush and Aegir
Face your fears: Drush and AegirIztok Smolic
 
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 Capistranolibsys
 
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
 
Pure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talkPure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talkBryan Ollendyke
 
Deployer - Deployment tool for PHP
Deployer - Deployment tool for PHPDeployer - Deployment tool for PHP
Deployer - Deployment tool for PHPhernanibf
 
Deploying Rails Applications with Capistrano
Deploying Rails Applications with CapistranoDeploying Rails Applications with Capistrano
Deploying Rails Applications with CapistranoAlmir Mendes
 
A Drush Primer - DrupalCamp Chattanooga 2013
A Drush Primer - DrupalCamp Chattanooga 2013A Drush Primer - DrupalCamp Chattanooga 2013
A Drush Primer - DrupalCamp Chattanooga 2013Chris Hales
 
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 dbdeployerGiuseppe Maxia
 
[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 OverviewLeo Lorieri
 
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...Alexander Dean
 
DevOps in PHP environment
DevOps in PHP environment DevOps in PHP environment
DevOps in PHP environment Evaldo Felipe
 
Twas the night before Malware...
Twas the night before Malware...Twas the night before Malware...
Twas the night before Malware...DoktorMandrake
 
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDaysLuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDaysLuis Rodríguez Castromil
 
SF Gradle Meetup - Netflix OSS
SF Gradle Meetup - Netflix OSSSF Gradle Meetup - Netflix OSS
SF Gradle Meetup - Netflix OSSJustin Ryan
 

Similar 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
 

Más de Amazee Labs

Marketingtag17 - Master Class "Digital Survival Guide"
Marketingtag17 - Master Class "Digital Survival Guide"Marketingtag17 - Master Class "Digital Survival Guide"
Marketingtag17 - Master Class "Digital Survival Guide"Amazee Labs
 
WebExpresso Agiles Projektmanagement 03/03/2016
WebExpresso Agiles Projektmanagement 03/03/2016WebExpresso Agiles Projektmanagement 03/03/2016
WebExpresso Agiles Projektmanagement 03/03/2016Amazee Labs
 
Drupal 8 deeper dive
Drupal 8 deeper diveDrupal 8 deeper dive
Drupal 8 deeper diveAmazee Labs
 
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 shopAmazee Labs
 
Messbarkeit seo performance
Messbarkeit seo performance Messbarkeit seo performance
Messbarkeit seo performance Amazee Labs
 
Drupalcamp London 2015
Drupalcamp London 2015Drupalcamp London 2015
Drupalcamp London 2015Amazee 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 websiteAmazee Labs
 
WebExpresso - Switch the Switch
WebExpresso - Switch the SwitchWebExpresso - Switch the Switch
WebExpresso - Switch the SwitchAmazee Labs
 
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)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 2014Amazee Labs
 
Web express-drupal-8
Web express-drupal-8Web express-drupal-8
Web express-drupal-8Amazee Labs
 
Logging with Elasticsearch, Logstash & Kibana
Logging with Elasticsearch, Logstash & KibanaLogging with Elasticsearch, Logstash & Kibana
Logging with Elasticsearch, Logstash & KibanaAmazee Labs
 
Overwriting code in Drupal
Overwriting code in DrupalOverwriting code in Drupal
Overwriting code in DrupalAmazee 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 newAmazee Labs
 
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 managersAmazee Labs
 
Translation Management
Translation ManagementTranslation Management
Translation ManagementAmazee Labs
 
Drupal High Availability High Performance 2012
Drupal High Availability High Performance 2012Drupal High Availability High Performance 2012
Drupal High Availability High Performance 2012Amazee Labs
 
Drupal für Entwickler
Drupal für EntwicklerDrupal für Entwickler
Drupal für EntwicklerAmazee Labs
 
Responsive Web Design - Ein Überblick
Responsive Web Design - Ein ÜberblickResponsive Web Design - Ein Überblick
Responsive Web Design - Ein ÜberblickAmazee Labs
 

Más 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

办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一z xss
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)Christopher H Felton
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa494f574xmv
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一Fs
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一Fs
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Dana Luther
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Excelmac1
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书zdzoqco
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITMgdsc13
 
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Sonam Pathan
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一Fs
 
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Lucknow
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Sonam Pathan
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一Fs
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作ys8omjxb
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Paul Calvano
 

Último (20)

Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa
 
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in  Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Jamuna Vihar Delhi reach out to us at 🔝9953056974🔝
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170
 
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
 
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
 
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24
 

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