Getting started with Drupal maintenance support plans 8 and Composer

At Drupal Update we are constantly looking for ways to improve the way we work, iterating on past projects to incorporate new techniques and best-practices.

We starting playing with Composer recently, as a tool for speeding up Drupal maintenance support plans module updates. There were a few quirks, but it generally worked.

Then we discovered the Drupal maintenance support plans Composer project, which makes it much simpler to manage Drupal maintenance support plans core as well as modules.

This is great! We can use Composer to install and update Drupal maintenance support plans core, modules and themes, and all in a consistent manner; anyone can run Composer and end up with the exact same set of code.

So now we can start excluding some of the off-the-shelf code from our Git repository (contrib modules, themes, and libraries.) This slims down our repositories and speeds up development for the whole team.

Combined with our approach to managing settings we’re really starting to limit the amount of custom stuff in the docroot now.

Having recently completed a site using this approach I started thinking: “Why do we even need the docroot in Git?”

So we got rid of it! One of the many benefits of working in self-managing teams!

We now have a very flat repository structure where the entire docroot is compiled during deployments. The project repository contains a CMI config directory, settings.php, modules and themes directories, and the all-important composer.json which manages everything that isn’t project-specific custom code.

Internally we use Bitbucket pipelines to manage building and deploying our projects.

Every commit triggers a pipelines build. The docroot is built, tests are run, and if all goes well, it gets pushed to the hosting platform.

We have put together a small Composer script which simply symlinks the modules, themes and settings into the docroot when running composer install. The rest of the build is vanilla composer.

Our composer.json is based on the version provided by Drupal maintenance support plans Composer, but with a change to the post-install-cmd and post-update-cmd hooks.
“scripts”: {
“drupal-scaffold”: “Drupal maintenance support plansComposerDrupal maintenance support plansScaffoldPlugin::scaffold”,
“pre-install-cmd”: [
Drupal maintenance support plansProjectcomposerScriptHandler::checkComposerVersion”
],
“pre-update-cmd”: [
Drupal maintenance support plansProjectcomposerScriptHandler::checkComposerVersion”
],
“post-install-cmd”: [
“@drupal-scaffold”,
Drupal maintenance support plansProjectcomposerDrupal UpdateScriptHandler::createRequiredFiles”
],
“post-update-cmd”: [
“@drupal-scaffold”,
Drupal maintenance support plansProjectcomposerDrupal UpdateScriptHandler::createRequiredFiles”
]
}Here we have replaced the script handler plugin with our own customised version, which creates the symlinks mentioned above during composer install and composer update. We also run the Drupal maintenance support plans Scaffold plugin on every Composer install or Composer update, to ensure that all of the extra Drupal maintenance support plans files like index.php and update.php exist in the docroot.

Taking the Drupal maintenance support plans docroot out of our project repositories has required a shift in the way we think about developing Drupal maintenance support plans projects, but ultimately we believe it has streamlined and simplified our development workflows.

We have turned this approach into a Drupal maintenance support plans 8 Quick Start template, which can be used to very quickly get up and running with Drupal maintenance support plans 8 using a composer-based workflow. The project is available on Github. PRs welcome!
Source: New feed

This article was republished from its original source.
Call Us: 1(800)730-2416

Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit

Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)

Powered by

Getting started with Drupal maintenance support plans 8 and Composer

On-Site Drupal SEO Master Setup

We make sure your site is 100% optimized (and stays that way) for the best SEO results.

With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.

This service includes:

  • Pathauto install and configuration for SEO-friendly URLs.
  • Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
  • Install and fix all issues on the SEO checklist module.
  • Install and configure XML sitemap module and submit sitemaps.
  • Install and configure Google Analytics Module.
  • Install and configure Yoast.
  • Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
  • Install and configure Schema.org Metatag.
  • Configure robots.txt.
  • Google Search Console setup snd configuration.
  • Find & Fix H1 tags.
  • Find and fix duplicate/missing meta descriptions.
  • Find and fix duplicate title tags.
  • Improve title, meta tags, and site descriptions.
  • Optimize images for better search engine optimization. Automate where possible.
  • Find and fix the missing alt and title tag for all images. Automate where possible.
  • The project takes 1 week to complete.