deployment strategies: managing code, content, and configurations

29
Nick Hepner [email protected] @NickHepner

Upload: nyccamp

Post on 17-May-2015

3.757 views

Category:

Technology


4 download

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: Intermediate

TRANSCRIPT

Page 1: Deployment Strategies: Managing Code, Content, and Configurations

Nick [email protected]

@NickHepner

Page 2: Deployment Strategies: Managing Code, Content, and Configurations

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

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

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

Standard Deployment ModelStandard Deployment Model

Development Staging ProductionLocal

Content Staging

Page 6: Deployment Strategies: Managing Code, Content, and Configurations

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

Development

Staging

Production

81 Servers

Page 8: Deployment Strategies: Managing Code, Content, and Configurations

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

Configuration WorkflowConfiguration Workflow

Development Staging ProductionLocal

Configuration

Content Staging

Page 10: Deployment Strategies: Managing Code, Content, and Configurations

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

Content WorkflowContent Workflow

Development Staging ProductionLocal

Configuration

Content

Content Staging

Officiated Content

User Content

Page 12: Deployment Strategies: Managing Code, Content, and Configurations

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

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

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

Development Staging ProductionLocal

Code RepositoryCode Repository

Code

TrunkTrunk TagsTags

Rejected

Code WorkflowCode Workflow

Page 16: Deployment Strategies: Managing Code, Content, and Configurations

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

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

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

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

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

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

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

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

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

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

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

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

QuestionsQuestions

Page 29: Deployment Strategies: Managing Code, Content, and Configurations

Thank You!Thank You!Nick [email protected]@NickHepner