Staging and Deployment

  • 2,475 views
Uploaded on

Drupal and its contributed modules provides an impressive amount of functionality without needing to write a single line of code by storing information in Drupal’s database tables. Unfortunately this …

Drupal and its contributed modules provides an impressive amount of functionality without needing to write a single line of code by storing information in Drupal’s database tables. Unfortunately this poses a challenge for developers wanting to stage changes between servers. This talk starts to address these issues by describing the problem and presenting a variety of solutions as well as their pros and cons. I also discuss some possible paths to make this easier coming down the pipe.

More in: Technology , Business
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
2,475
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
39
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Staging & Deployment
  • 2. Greg Dunlap Senior Programmer Palantir.net
  • 3. The Problem
  • 4. Traditional Deployment
  • 5. Traditional Deployment • Everything is in code
  • 6. Traditional Deployment • Everything is in code • Mature tools to manage the code (svn, editors, command line dist. tools)
  • 7. Traditional Deployment • Everything is in code • Mature tools to manage the code (svn, editors, command line dist. tools) • Code moves one way (dev -> qa -> prod)
  • 8. Drupal Deployment
  • 9. Drupal Deployment • Drupal stores a lot in the database
  • 10. Drupal Deployment • Drupal stores a lot in the database • CCK, Views, Settings, Blocks, Content
  • 11. Drupal Deployment • Drupal stores a lot in the database • CCK, Views, Settings, Blocks, Content • Data moves both ways (dev/configuration starts in production and moves out, user- generated content starts at prod and comes in) so can’t just mysqldump from dev
  • 12. Drupal Deployment • Drupal stores a lot in the database • CCK, Views, Settings, Blocks, Content • Data moves both ways (dev/configuration starts in production and moves out, user- generated content starts at prod and comes in) so can’t just mysqldump from dev • No mature toolset to merge
  • 13. Content vs. Config
  • 14. Content vs. Config • Content and Configuration have very different problems
  • 15. Content vs. Config • Content and Configuration have very different problems • Content - Primary key problems, inconsistent dependencies, some poor APIs (although most are better in D7 yay)
  • 16. Content vs. Config • Content and Configuration have very different problems • Content - Primary key problems, inconsistent dependencies, some poor APIs (although most are better in D7 yay) • Config - Wildly inconsistent storage and exportability, plus a lot of the above too
  • 17. hook_form_alter()
  • 18. hook_form_alter() • The cause of, and solution to, all life’s problems.
  • 19. hook_form_alter() • The cause of, and solution to, all life’s problems. • Couples back end and front end
  • 20. hook_form_alter() • The cause of, and solution to, all life’s problems. • Couples back end and front end • Makes it difficult for any purely backend solution to work consistently
  • 21. Options That Suck
  • 22. Options That Suck • Develop on production
  • 23. Options That Suck • Develop on production • Repeat everything by hand at launch
  • 24. Options That Suck • Develop on production • Repeat everything by hand at launch • Seriously life is too short
  • 25. A Better Option Move stuff traditionally stored in the database into code. This is traditionally how people handle it.
  • 26. Putting it in code
  • 27. Putting it in code • Find an import/export mechanism, write an update hook.
  • 28. Putting it in code • Find an import/export mechanism, write an update hook. • Devel Macro Module (D5 only)
  • 29. Putting it in code • Find an import/export mechanism, write an update hook. • Devel Macro Module (D5 only) • Views / Panels export/import
  • 30. Putting it in code • Find an import/export mechanism, write an update hook. • Devel Macro Module (D5 only) • Views / Panels export/import • Content Copy
  • 31. Putting it in code • Find an import/export mechanism, write an update hook. • Devel Macro Module (D5 only) • Views / Panels export/import • Content Copy • Patterns
  • 32. Some Links
  • 33. Some Links • Programmatic CCK Now Possible
  • 34. Some Links • Programmatic CCK Now Possible • Managing Your Views Code
  • 35. Some Links • Programmatic CCK Now Possible • Managing Your Views Code • Lullabot - Moving CCK Changes From Dev To Live
  • 36. Pros & Cons
  • 37. Pros & Cons • Pro - Maintainable through svn and deployable through normal tools. Great option for developer-only shops
  • 38. Pros & Cons • Pro - Maintainable through svn and deployable through normal tools. Great option for developer-only shops • Con - Non-technical users left behind. GUI does not automatically update code, still have to do that by hand.
  • 39. Interesting Conceptually Primary key database hacks
  • 40. Reserved Key IDs
  • 41. Reserved Key IDs • Set auto-inc on dev to start at 1
  • 42. Reserved Key IDs • Set auto-inc on dev to start at 1 • Set auto-inc on live to start at 1001
  • 43. Reserved Key IDs • Set auto-inc on dev to start at 1 • Set auto-inc on live to start at 1001 • Module to move items over
  • 44. Reserved Key IDs • Set auto-inc on dev to start at 1 • Set auto-inc on live to start at 1001 • Module to move items over • Always have a clear set of IDs
  • 45. Reserved Key IDs • Set auto-inc on dev to start at 1 • Set auto-inc on live to start at 1001 • Module to move items over • Always have a clear set of IDs • Dave Cohen's blog post
  • 46. Database Scripts
  • 47. Database Scripts • Extension of the reserved number method
  • 48. Database Scripts • Extension of the reserved number method • Keeps database dumps in version control
  • 49. Database Scripts • Extension of the reserved number method • Keeps database dumps in version control • Merges dev and production data
  • 50. Database Scripts • Extension of the reserved number method • Keeps database dumps in version control • Merges dev and production data • DBscripts
  • 51. Pros & Cons
  • 52. Pros & Cons • Pros - Clever outside the box idea. Starts to address the great unknown of how to deploy nodes, etc.
  • 53. Pros & Cons • Pros - Clever outside the box idea. Starts to address the great unknown of how to deploy nodes, etc. • Cons - Core hacks, not forward-thinking, not always db-portable, not the “Drupal way”
  • 54. Up & Coming
  • 55. Exportables Framework for getting data out
  • 56. Exportables
  • 57. Exportables • A part of CTools
  • 58. Exportables • A part of CTools • Exposes a hook you implement to export whatever content you have
  • 59. Exportables • A part of CTools • Exposes a hook you implement to export whatever content you have • Need to write your own import stuff
  • 60. Exportables • A part of CTools • Exposes a hook you implement to export whatever content you have • Need to write your own import stuff • Good: Standardized, consistent
  • 61. Exportables • A part of CTools • Exposes a hook you implement to export whatever content you have • Need to write your own import stuff • Good: Standardized, consistent • Bad: Still suffers from form_alter() issue
  • 62. Features Config
  • 63. Features
  • 64. Features • You all went to Robin’s talk right?
  • 65. Features • You all went to Robin’s talk right? • Bundle settings into modules for distribution
  • 66. Features • You all went to Robin’s talk right? • Bundle settings into modules for distribution • Built on exportables concept
  • 67. Features • You all went to Robin’s talk right? • Bundle settings into modules for distribution • Built on exportables concept • Coverage is small but growing
  • 68. Deploy Content
  • 69. Concept
  • 70. Concept • Inspired by Services module
  • 71. Concept • Inspired by Services module • API - Manages Deployment Plans and Servers
  • 72. Concept • Inspired by Services module • API - Manages Deployment Plans and Servers • Modules integrate with API
  • 73. Concept • Inspired by Services module • API - Manages Deployment Plans and Servers • Modules integrate with API • Services receive and manage deployed data
  • 74. Concept • Inspired by Services module • API - Manages Deployment Plans and Servers • Modules integrate with API • Services receive and manage deployed data • Implements UUIDs to alleviate primary key issues
  • 75. Concept • Inspired by Services module • API - Manages Deployment Plans and Servers • Modules integrate with API • Services receive and manage deployed data • Implements UUIDs to alleviate primary key issues • Manages dependencies between nodes and other Drupal objects (users, taxonomy, etc.)
  • 76. Demo Here
  • 77. Demo Here • w00t
  • 78. Problems
  • 79. Problems • Revisioning
  • 80. Problems • Revisioning • Rollback (unless you count mysqldump)
  • 81. Problems • Revisioning • Rollback (unless you count mysqldump) • Can’t do unattended deployments
  • 82. Problems • Revisioning • Rollback (unless you count mysqldump) • Can’t do unattended deployments • Gaps in support (upload.module, translations, blocks, etc.)
  • 83. Conclusions
  • 84. Conclusions • No magic bullets
  • 85. Conclusions • No magic bullets • Investigate, evaluate, plan plan plan
  • 86. Conclusions • No magic bullets • Investigate, evaluate, plan plan plan • Ask questions
  • 87. Conclusions • No magic bullets • Investigate, evaluate, plan plan plan • Ask questions • Get involved!
  • 88. Further Discussion
  • 89. Further Discussion • Deployment Framework Posting
  • 90. Further Discussion • Deployment Framework Posting • Development Seed Features posts
  • 91. Further Discussion • Deployment Framework Posting • Development Seed Features posts • Change Management Group