Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

How we maintain 200+ Drupal sites in Georgetown University

1,733 views

Published on

How we maintain 200+ Drupal sites in Georgetown University

Published in: Software

How we maintain 200+ Drupal sites in Georgetown University

  1. 1. How we maintain 200+ Drupal sites in Georgetown University Vadym Myrgorod vm386@georgetown.edu @dealancer
  2. 2. About me
  3. 3. About Georgetown University
  4. 4. 258 sites that looks the same
  5. 5. Session plan
  6. 6. Infrastructure
  7. 7. Drupal CMS Feature A Feature B Feature C Feature D Feature E
  8. 8. Feature C Drupal CMS Feature A Feature B Feature D Feature E Site 1 Site 2 Site 3 Site 4 Site 5 Site 6 Site 7
  9. 9. Multisiting
  10. 10. sites.php <?php #biology $sites['biology.georgetown.edu'] = 'biology'; $sites['biology.gudrupalstg.georgetown.edu'] = 'biology'; $sites['biology.gudrupaldev.georgetown.edu'] = ‘biology';
  11. 11. Multisiting
  12. 12. Site 1 Site 2 Site 3 Site 4 Site 5 Site 6 Site 7
  13. 13. Well known Drupal cloud Dev Test Prod
  14. 14. Local development
  15. 15. Setup any subsite locally within a few minutes
  16. 16. Sitesync script
  17. 17. Script highlights # Getting DB from the remote server ssh $HOST "drush @gudrupal.$ENV -l $SUBSITE sql-dump --skip-tables-key=common --gzip" > $# Resave theme settings drush @gudrupal.local -l $SUBSITE php-eval "# module_load_include('inc', 'system', 'system.admin'); foreach (array('at_georgetown') as $theme_name) { $form_state = form_state_defaults(); $form_state['build_info']['args'][0] = $theme_name; $form_state['values'] = array(); drupal_form_submit('system_theme_settings', $form_state); } "
  18. 18. local.settings.inc if (file_exists('sites/local.settings.inc')) { require_once('sites/local.settings.inc'); }
  19. 19. local.settings.inc $remote_url = 'http://' . $sitedir . '.georgetown.edu'; $conf[‘stage_file_proxy_origin'] = $remote_url; $files_dir = ‘sites/' . $sdir . '/files'; $conf[‘stage_file_proxy_origin_dir'] = $files_dir; $conf['reroute_email_enable'] = 1; $conf['reroute_email_address'] = 'email@example.com'; $conf['reroute_email_enable_message'] = 1;
  20. 20. Development workflow
  21. 21. Deploy new sites, don’t deploy untested code
  22. 22. A successful Git branching model http://nvie.com/posts/a-successful-git-branching-model/
  23. 23. Environments Dev Test Prod develop hotfixes personal branches features branches master branch tag tag
  24. 24. Change Control
  25. 25. Be careful with Features do not overuse it
  26. 26. Features are not a panacea
  27. 27. DevOps
  28. 28. Run certain amount of tasks almost each day across 258 sites
  29. 29. How I did it 6 years ago Advice from my PM: do as described above if it is urgent
  30. 30. What I’ve discovered $ drush updb -y $ drush @gudrupal.prod -l biology fra -y $ drush @sites dis devel
  31. 31. What I am doing now $ ./gudrupal-bulk-drush.sh subsites.txt prod "updb -y" "fra -y" "cc all" > ~/deployment-2014-07-21.txt
  32. 32. What script can do that Drush can’t
  33. 33. What else can be done
  34. 34. Creating a new site
  35. 35. We needed to create 80 new websites for less then a week
  36. 36. Before we launched at least 5 sites a week
  37. 37. It took me more then a day to create my first new site
  38. 38. 4 scripts to automate site creation
  39. 39. Site creation script
  40. 40. Site installation script
  41. 41. Script that adds new SAML record
  42. 42. Sync script
  43. 43. Finally, bulk scripts that do all previous tasks in a batch
  44. 44. Then and now
  45. 45. Why do producers of the hardware make it slower than it actually could be?
  46. 46. Add a delay into your bulk scripts to prevent server from the high load
  47. 47. Introducing Druml github.com/georgetown-university/druml
  48. 48. Questions? Email: vm386@georgetown.edu Twitter: @dealancer
  49. 49. Thanks! Email: vm386@georgetown.edu Twitter: @dealancer

×