Using Post Update Scripts to Deploy Content Across Environments

This session focuses on how we rolled out large amounts of content using a #Drupal post update script. This method was used for several tools on Farmers.gov, most recently The Disaster Assistance Tool. A post update script can build pages, create paragraph types or blocks, and can fill in the content. After running the post update script, all pages will be up and running with properly placed blocks and paragraph types filled with content significantly cutting down on the time needed to launch tools, features, and large content elements. This method is particularly useful in rolling out the same content across environments when you don’t have the manpower or time to recreate content repeatedly.

Presentation by Matt Calvert & Jason Glisson with an introduction by Ashley Miller of USDA.

Synopsis:

Setting up pages, blocks, paragraphs, and content on various environments can often times be a pain. If you deploy from your local environment, to a development environment, a QA environment, a client facing staging environment, and then a production environment, valuable time can be spent creating the same content over and over again. And if the pages you are rolling out include creating a large number of new paragraphs and blocks as well as placing them in a content type, the process can become monotonous and drag on for hours.

Configuration files can help with some of this process such as creating content types, paragraph types, or block types. However, filling in the content, embedded blocks or reference types can sometimes cause issues or simply not work properly with configuration. Properly placing block types, view blocks, module produced blocks and paragraph reference may not even be an option in configuration at times.

Enter Drupal's Update Script. With an update script, entire tools and large sections of a website can be rolled out flawlessly with all content in place and ready to go in a matter of seconds. The days of copying and pasting content from environment to environment are behind you! Simply run drush updb, and your update script will create your content, place blocks, create paragraphs and embed them, upload images, create views, etc. The possibilities are nearly endless.


USDA's Farmers.Gov initiative has used update scripts to roll out very large interactive tools with high volumes of blocks and paragraphs that would take hours on end to setup manually. By spending the time on an update script, we've cut down on setup time across our environments and reduced production launch time to just seconds.


🎤 Presenter(s): tk421jag, ashleyfmiller, MattC
🔗 Session Details: https://www.drupalgovcon.org/2020/program/sessions/using-post-update-scripts-deploy-content-across-environments

Drupal is a registered trademark of Dries Buytaert.