deployment strategies: managing code, content, and configurations
DESCRIPTION
Most development shops make use of a "development/staging/production" server model. Maintaining code, content, and configurations across multiple environments can be a bit tricky, particularly since drupal doesn't currently provide any native means to separate configuration from content. This session would discuss the various methods to make sure that your development server looks like your production server. We will touch on version control, the backup and migrate module, and the features module, as well as integrating a deployment management software such as hudson or aegir, and how to scale these solutions from a small application to a large enterprise server architecture. Speaker(s): Nick Hepner Experience Level: IntermediateTRANSCRIPT
![Page 2: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/2.jpg)
Deployment Strategies: Deployment Strategies: Managing Code, Content, and Managing Code, Content, and Configurations Across Multiple Configurations Across Multiple
EnvironmentsEnvironments
Nick Hepner
![Page 3: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/3.jpg)
Nick HepnerNick Hepner• Web Developer since 1998• Drupal since 2005• Enterprise Architect since 2008• Founding and active member Baltimore meetup• Likes: beer• Dislikes: PowerPoint Presentations
![Page 4: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/4.jpg)
IntroductionIntroduction• Standard Deployment Model• Code, Content, Configuration and their workflows• Problems• Scalable Solutions for Drupal 6 & 7
![Page 5: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/5.jpg)
Standard Deployment ModelStandard Deployment Model
Development Staging ProductionLocal
Content Staging
![Page 6: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/6.jpg)
Users
Read Cluster
Static Cache
Memcache
Write Cluster
Apache Solr
Single Sign-On
Development/Deployment/Monitoring/Internal tools
File Share
Code Repository
![Page 7: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/7.jpg)
Development
Staging
Production
81 Servers
![Page 8: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/8.jpg)
ConfigurationConfiguration• Consists of Drupal admin and module settings
and presets.• Imagecache/image styles• Configuration workflow begins on development
servero New modules installedo Existing modules configuredo Content types, fields, and profile structures editedo Database stored stylesheets, php code
![Page 9: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/9.jpg)
Configuration WorkflowConfiguration Workflow
Development Staging ProductionLocal
Configuration
Content Staging
![Page 10: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/10.jpg)
ContentContent• Content workflow begins on the production server• User Content
o User registrationso User generated contento Files and uploadso Social interactions (e.g. Private Msg, Statuses, etc.)o Content managemento Site and user administration
• Officiated Contento News Articleso Press Releaseso Internal Announcements
![Page 11: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/11.jpg)
Content WorkflowContent Workflow
Development Staging ProductionLocal
Configuration
Content
Content Staging
Officiated Content
User Content
![Page 12: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/12.jpg)
ConflictsConflicts• Servers no longer synchronized
o Developers begin developing on different setups
• Data often gets overwritten• Most recent/accurate data set difficult to keep
track of• Dogs, Cats living together
![Page 13: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/13.jpg)
CodeCode• Can be versioned for easy
deployment/management (SVN, Git)• Does not conflict with database changes• Does not include database stored code
![Page 14: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/14.jpg)
Deploying Code With Deploying Code With VersioningVersioning• Deploy to development through “trunk”• Create a tag for deployment to staging• Either reject the tag and fix bugs, or promote it to
production.
![Page 15: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/15.jpg)
Development Staging ProductionLocal
Code RepositoryCode Repository
Code
TrunkTrunk TagsTags
Rejected
Code WorkflowCode Workflow
![Page 16: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/16.jpg)
Non-StartersNon-Starters• Migrate – Intended to be used when moving a site
from another framework, such as Wordpress or Joomla.
• Rsync - *nix command line tool for synchronizing files. Does not allow for proper staging.
![Page 17: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/17.jpg)
Strategies: Strategies: Manual Configuration Manual Configuration ManagementManagement• Developer manually sets configuration options on
all servers• Fine for really small implementations• More than one developer causes issues
![Page 18: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/18.jpg)
Strategies: Strategies: Backup and MigrateBackup and Migrate• Use backup and migrate module to create backup
profile for content and for configuration• Use versioning to move code• Configuration must still be entered manually on
development• Takes some trial and error
![Page 19: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/19.jpg)
Strategies: Strategies: Launch ManagerLaunch Manager• Aegir – Seems to work well for launching initial
site rollouts. Not so much for maintenance updates
• Hudsono Extensive initial configurationo Integrates with version controlo Can script specific updates
![Page 20: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/20.jpg)
Strategies: Strategies: The Three Pronged AttackThe Three Pronged Attack• Typically for enterprise environments• Features• Content Publication• File Share
o Mount files driveo Network-Attached Storage (NAS)o Content Delivery Networks (CDN)
![Page 21: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/21.jpg)
The Three Prong Attack: The Three Prong Attack: FeaturesFeatures• Extracts configurations into code workflow to
avoid database conflicts.• Allows versioning of configuration• Great Documentation and support
o http://drupal.org/node/928026o IRC #drupal-support
• Can manage all configuration exports in this way – not feasible or scaleable.
![Page 22: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/22.jpg)
The Three Prong Attack: The Three Prong Attack: ServicesServices• Publish content to lower environments• OAuth Support
![Page 23: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/23.jpg)
The Three Prong Attack: The Three Prong Attack: FeedsFeeds• Pull content, users, and pretty much anything
exportable by views.• Can use Data module to map data to where it
needs to go.• OAuth Support• Use UUID module when importing to avoid
duplicate content.
![Page 24: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/24.jpg)
The Three Prong Attack: The Three Prong Attack: Synching EnvironmentsSynching Environments• For the love of FSM: BACKUP YOUR DATABASES!!!!• Once content is synched, push dev data• If file share, Backup & Migrate exports
will be automatically available to allenvironments.
• Staging environment pushes will be “easy”. Use B&M “Restore”. Can be used with Drush.
• In production, push during off peak hours, put site in maintenance mode and import data.
• This slide has way too much text… sorry.
![Page 25: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/25.jpg)
The Three Prong Attack: The Three Prong Attack: A Note on the Deploy A Note on the Deploy ModuleModule• Integrates with services. • Essential if a content staging environment exists.• Good for publishing content and approval
workflow• Not built to handle configuration settings, or
multiple workflows.
![Page 26: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/26.jpg)
The Three Prong Attack: The Three Prong Attack: Content DistributionContent Distribution
Dev Stage
Production
Local
Content Staging
UsersContent In
Content Out
Network Drive
Config Export
![Page 27: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/27.jpg)
The Three Prong Attack: The Three Prong Attack: Notable ModulesNotable Modules• Features – Export configuration into code.
o Features Tools – Automates feature downloads, and creates versioned change files.
• Feeds – Import pretty much anything on the web into Drupal.o Feeds xPath Parser – Allows xPath style syntax for XMLo Feeds OAuth – OAuth integration selection for feeds module.o Data – Allows customized data storage and mappings.
• Services – Publish anything in drupalo OAuth – contains a services integration for OAuth authentication.
• Backup and Migrate
![Page 28: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/28.jpg)
QuestionsQuestions
![Page 29: Deployment Strategies: Managing Code, Content, and Configurations](https://reader035.vdocument.in/reader035/viewer/2022081512/5557996ed8b42a4a5d8b45e8/html5/thumbnails/29.jpg)
Thank You!Thank You!Nick [email protected]@NickHepner