Staging & Deployment
Greg Dunlap
 Senior Programmer
     Palantir.net
The Problem
Traditional Deployment
Traditional Deployment


• Everything is in code
Traditional Deployment


• Everything is in code
• Mature tools to manage the code (svn,
  editors, command line dist. too...
Traditional Deployment


• Everything is in code
• Mature tools to manage the code (svn,
  editors, command line dist. too...
Drupal Deployment
Drupal Deployment
• Drupal stores a lot in the database
Drupal Deployment
• Drupal stores a lot in the database
• CCK, Views, Settings, Blocks, Content
Drupal Deployment
• Drupal stores a lot in the database
• CCK, Views, Settings, Blocks, Content
• Data moves both ways (de...
Drupal Deployment
• Drupal stores a lot in the database
• CCK, Views, Settings, Blocks, Content
• Data moves both ways (de...
Content vs. Config
Content vs. Config
• Content and Configuration have very
  different problems
Content vs. Config
• Content and Configuration have very
  different problems
• Content - Primary key problems,
  inconsiste...
Content vs. Config
• Content and Configuration have very
  different problems
• Content - Primary key problems,
  inconsiste...
hook_form_alter()
hook_form_alter()

• The cause of, and solution to, all life’s
  problems.
hook_form_alter()

• The cause of, and solution to, all life’s
  problems.
• Couples back end and front end
hook_form_alter()

• The cause of, and solution to, all life’s
  problems.
• Couples back end and front end
• Makes it dif...
Options That Suck
Options That Suck

• Develop on production
Options That Suck

• Develop on production
• Repeat everything by hand at launch
Options That Suck

• Develop on production
• Repeat everything by hand at launch
• Seriously life is too short
A Better Option
Move stuff traditionally stored in the database into code.
       This is traditionally how people handle ...
Putting it in code
Putting it in code

• Find an import/export mechanism, write an
  update hook.
Putting it in code

• Find an import/export mechanism, write an
  update hook.
• Devel Macro Module (D5 only)
Putting it in code

• Find an import/export mechanism, write an
  update hook.
• Devel Macro Module (D5 only)
• Views / Pa...
Putting it in code

• Find an import/export mechanism, write an
  update hook.
• Devel Macro Module (D5 only)
• Views / Pa...
Putting it in code

• Find an import/export mechanism, write an
  update hook.
• Devel Macro Module (D5 only)
• Views / Pa...
Some Links
Some Links

• Programmatic CCK Now Possible
Some Links

• Programmatic CCK Now Possible
• Managing Your Views Code
Some Links

• Programmatic CCK Now Possible
• Managing Your Views Code
• Lullabot - Moving CCK Changes From Dev
  To Live
Pros & Cons
Pros & Cons

• Pro - Maintainable through svn and
  deployable through normal tools. Great
  option for developer-only sho...
Pros & Cons

• Pro - Maintainable through svn and
  deployable through normal tools. Great
  option for developer-only sho...
Interesting Conceptually
      Primary key database hacks
Reserved Key IDs
Reserved Key IDs

• Set auto-inc on dev to start at 1
Reserved Key IDs

• Set auto-inc on dev to start at 1
• Set auto-inc on live to start at 1001
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
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
...
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
...
Database Scripts
Database Scripts

• Extension of the reserved number method
Database Scripts

• Extension of the reserved number method
• Keeps database dumps in version control
Database Scripts

• Extension of the reserved number method
• Keeps database dumps in version control
• Merges dev and pro...
Database Scripts

• Extension of the reserved number method
• Keeps database dumps in version control
• Merges dev and pro...
Pros & Cons
Pros & Cons

• Pros - Clever outside the box idea. Starts
  to address the great unknown of how to
  deploy nodes, etc.
Pros & Cons

• Pros - Clever outside the box idea. Starts
  to address the great unknown of how to
  deploy nodes, etc.
• ...
Up & Coming
Exportables
Framework for getting data out
Exportables
Exportables
• A part of CTools
Exportables
• A part of CTools
• Exposes a hook you implement to export
  whatever content you have
Exportables
• A part of CTools
• Exposes a hook you implement to export
  whatever content you have
• Need to write your o...
Exportables
• A part of CTools
• Exposes a hook you implement to export
  whatever content you have
• Need to write your o...
Exportables
• A part of CTools
• Exposes a hook you implement to export
  whatever content you have
• Need to write your o...
Features
  Config
Features
Features

• You all went to Robin’s talk right?
Features

• You all went to Robin’s talk right?
• Bundle settings into modules for
  distribution
Features

• You all went to Robin’s talk right?
• Bundle settings into modules for
  distribution
• Built on exportables c...
Features

• You all went to Robin’s talk right?
• Bundle settings into modules for
  distribution
• Built on exportables c...
Deploy
 Content
Concept
Concept
• Inspired by Services module
Concept
• Inspired by Services module
• API - Manages Deployment Plans and Servers
Concept
• Inspired by Services module
• API - Manages Deployment Plans and Servers
• Modules integrate with API
Concept
• Inspired by Services module
• API - Manages Deployment Plans and Servers
• Modules integrate with API
• Services...
Concept
• Inspired by Services module
• API - Manages Deployment Plans and Servers
• Modules integrate with API
• Services...
Concept
• Inspired by Services module
• API - Manages Deployment Plans and Servers
• Modules integrate with API
• Services...
Demo Here
Demo Here


• w00t
Problems
Problems

• Revisioning
• Rollback (unless you count mysqldump)
Problems

• Revisioning
• Rollback (unless you count mysqldump)
• Can’t do unattended deployments
Problems

• Revisioning
• Rollback (unless you count mysqldump)
• Can’t do unattended deployments
• Gaps in support (uploa...
Conclusions
Conclusions

• No magic bullets
Conclusions

• No magic bullets
• Investigate, evaluate, plan plan plan
Conclusions

• No magic bullets
• Investigate, evaluate, plan plan plan
• Ask questions
Conclusions

• No magic bullets
• Investigate, evaluate, plan plan plan
• Ask questions
• Get involved!
Further Discussion
Further Discussion

• Deployment Framework Posting
Further Discussion

• Deployment Framework Posting
• Development Seed Features posts
Further Discussion

• Deployment Framework Posting
• Development Seed Features posts
• Change Management Group
Staging and Deployment
Staging and Deployment
Staging and Deployment
Upcoming SlideShare
Loading in...5
×

Staging and Deployment

2,525

Published 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 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.

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,525
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
40
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • Staging and Deployment

    1. 1. Staging & Deployment
    2. 2. Greg Dunlap Senior Programmer Palantir.net
    3. 3. The Problem
    4. 4. Traditional Deployment
    5. 5. Traditional Deployment • Everything is in code
    6. 6. Traditional Deployment • Everything is in code • Mature tools to manage the code (svn, editors, command line dist. tools)
    7. 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. 8. Drupal Deployment
    9. 9. Drupal Deployment • Drupal stores a lot in the database
    10. 10. Drupal Deployment • Drupal stores a lot in the database • CCK, Views, Settings, Blocks, Content
    11. 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. 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. 13. Content vs. Config
    14. 14. Content vs. Config • Content and Configuration have very different problems
    15. 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. 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. 17. hook_form_alter()
    18. 18. hook_form_alter() • The cause of, and solution to, all life’s problems.
    19. 19. hook_form_alter() • The cause of, and solution to, all life’s problems. • Couples back end and front end
    20. 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. 21. Options That Suck
    22. 22. Options That Suck • Develop on production
    23. 23. Options That Suck • Develop on production • Repeat everything by hand at launch
    24. 24. Options That Suck • Develop on production • Repeat everything by hand at launch • Seriously life is too short
    25. 25. A Better Option Move stuff traditionally stored in the database into code. This is traditionally how people handle it.
    26. 26. Putting it in code
    27. 27. Putting it in code • Find an import/export mechanism, write an update hook.
    28. 28. Putting it in code • Find an import/export mechanism, write an update hook. • Devel Macro Module (D5 only)
    29. 29. Putting it in code • Find an import/export mechanism, write an update hook. • Devel Macro Module (D5 only) • Views / Panels export/import
    30. 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. 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. 32. Some Links
    33. 33. Some Links • Programmatic CCK Now Possible
    34. 34. Some Links • Programmatic CCK Now Possible • Managing Your Views Code
    35. 35. Some Links • Programmatic CCK Now Possible • Managing Your Views Code • Lullabot - Moving CCK Changes From Dev To Live
    36. 36. Pros & Cons
    37. 37. Pros & Cons • Pro - Maintainable through svn and deployable through normal tools. Great option for developer-only shops
    38. 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. 39. Interesting Conceptually Primary key database hacks
    40. 40. Reserved Key IDs
    41. 41. Reserved Key IDs • Set auto-inc on dev to start at 1
    42. 42. Reserved Key IDs • Set auto-inc on dev to start at 1 • Set auto-inc on live to start at 1001
    43. 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. 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. 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. 46. Database Scripts
    47. 47. Database Scripts • Extension of the reserved number method
    48. 48. Database Scripts • Extension of the reserved number method • Keeps database dumps in version control
    49. 49. Database Scripts • Extension of the reserved number method • Keeps database dumps in version control • Merges dev and production data
    50. 50. Database Scripts • Extension of the reserved number method • Keeps database dumps in version control • Merges dev and production data • DBscripts
    51. 51. Pros & Cons
    52. 52. Pros & Cons • Pros - Clever outside the box idea. Starts to address the great unknown of how to deploy nodes, etc.
    53. 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. 54. Up & Coming
    55. 55. Exportables Framework for getting data out
    56. 56. Exportables
    57. 57. Exportables • A part of CTools
    58. 58. Exportables • A part of CTools • Exposes a hook you implement to export whatever content you have
    59. 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. 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. 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. 62. Features Config
    63. 63. Features
    64. 64. Features • You all went to Robin’s talk right?
    65. 65. Features • You all went to Robin’s talk right? • Bundle settings into modules for distribution
    66. 66. Features • You all went to Robin’s talk right? • Bundle settings into modules for distribution • Built on exportables concept
    67. 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. 68. Deploy Content
    69. 69. Concept
    70. 70. Concept • Inspired by Services module
    71. 71. Concept • Inspired by Services module • API - Manages Deployment Plans and Servers
    72. 72. Concept • Inspired by Services module • API - Manages Deployment Plans and Servers • Modules integrate with API
    73. 73. Concept • Inspired by Services module • API - Manages Deployment Plans and Servers • Modules integrate with API • Services receive and manage deployed data
    74. 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. 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. 76. Demo Here
    77. 77. Demo Here • w00t
    78. 78. Problems
    79. 79. Problems • Revisioning
    80. 80. Problems • Revisioning • Rollback (unless you count mysqldump)
    81. 81. Problems • Revisioning • Rollback (unless you count mysqldump) • Can’t do unattended deployments
    82. 82. Problems • Revisioning • Rollback (unless you count mysqldump) • Can’t do unattended deployments • Gaps in support (upload.module, translations, blocks, etc.)
    83. 83. Conclusions
    84. 84. Conclusions • No magic bullets
    85. 85. Conclusions • No magic bullets • Investigate, evaluate, plan plan plan
    86. 86. Conclusions • No magic bullets • Investigate, evaluate, plan plan plan • Ask questions
    87. 87. Conclusions • No magic bullets • Investigate, evaluate, plan plan plan • Ask questions • Get involved!
    88. 88. Further Discussion
    89. 89. Further Discussion • Deployment Framework Posting
    90. 90. Further Discussion • Deployment Framework Posting • Development Seed Features posts
    91. 91. Further Discussion • Deployment Framework Posting • Development Seed Features posts • Change Management Group

    ×