View
441
Download
2
Category
Tags:
Preview:
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, and developing an effective, managed, workflow with multiple developers can be chaotic, if not impossible. This session would discuss introduce the development -> staging -> production environment model, how to effectively apply version control to manage workflow, and how to coordinate the moving parts involved in creating a managed, QA friendly release process, using Git, Drupal Install Profiles, and effective ticketing.
Citation preview
Nick Hepnernick@SimpleInformation.com
@NickHepner
Managing Deployments with Git and
Install ProfilesManaging Code, Content, and Configurations Across Multiple Environments
…Part Deux
Nick Hepner
• Building web sites since 1998 Building Drupal sites since 2006 “Large Scale” Drupal since 2009
• Drupal Specialist Data Migrations Enterprise Scalability Configuration Management
• Director Unallocated Space
Why am I here?
• Standard Deployment Model• Code, Content, Configuration and their workflows
• Using Install Profiles for configuration management
• Deploying your code with Git
Standard Deployment Model
Content Staging
Development
Staging
Production
Local
Configuration
• Consists of Drupal admin and module settings.
• Exportable site structures Content Types Contexts Image Styles
• User Roles and Permissions• Configuration workflow begins on the development side of the model. New modules installed Existing modules configured Content types, fields, profile structures edited.
Database stored stylesheets, php code (don’t judge, we’ve all been there).
Configuration Workflow
Configuration
Development
Staging
Production
Local
Content
• User generated content• User registration and accounts• Content workflow begins on the production server User registrations User generated content
Nodes Entities
Files and uploads Content management workflows. Commerce General site and user administration
Configuration Workflow
Development
Staging
Production
Configuration
Local
Content
Conflicts
• Servers no longer syncronized Developers begin working and testing on different setups
“Where is the most recent copy of the database?”
• Data is at risk to be overwritten• Forces many manual, time consuming updates
• Most recent/accurate data set difficult to keep track of
Code
• Code can be versioned for easy deployment and management (Git, SVN)
• Does not conflict with database changes.• Does not include database stored code.• Follows same workflow as configuration – originates from development side of model.
Exportables
• Building web sites since 1998 Building Drupal sites since 2006 “Large Scale” Drupal since 2009
• Drupal Specialist Data Migrations Enterprise Scalability Configuration Management
• Director Unallocated Space• World famous drinking buddy.
Install Profiles
• Used to package re-usable functionality
• Preconfigured Drupal distributions Commerce Kickstart OpenAtrium OpenPublish OpenPublic Commons
• Provides convenient wrapper to store global setup and configuration tasks.
Exportables• Use Features and Ctools to export your
configurations into code. This removes configurations from the
configurations workflow, and places them into the code workflow with no database conflicts. Content types and fields Views Contexts Deltas/Panels
• The more things you can export now, the more time you will save later.
Profile Setup Use your .info file to set any modules or features
as requirements. This will automatically enable them, which is useful for
especially useful for features. In the .profile file, use the hook_form_install_configure_form_alter() to change the profile setup form if necessary.
The magic happens in the .install file!!
Profile Install Files Use hook_install() can be used to set up initial configurations. This will run
the FIRST time the site is installed. Use hook_update_N() to provide any later configurations.
Don't overwrite scripts in previous code – create an update hook with a higher version number.
Code
Dev
Staging
Production
Local
Branches Tags
Deployment When deploying an update, use drush updb to run your update hooks Can automate deploying git pushes using Jenkins
Devel Generate Use devel generate's functions to automate test data.
devel_generate_word() devel_create_greeking() devel_create_para()
Should be used to replace need for actual data. Great for PII, PHI and high security sites. Can still facilitate distributed develpoment.
Advantages Very easy to test deployments to any environment. Site rebuilds exactly the same way, every time, for all developers Can manage configuration changes in Git. No more question about the most recent data set. Easier to project manage
The Future Drupal 8 will use YAML to manage configurations. Configurations will be exported into Code by default. A lot of “one-touch” deployment features and setup. D7 and D6 sites will still require maintenance.
Questions? @NickHepner
nick@simpleinformation.com
Recommended