wunderio / ddev-drupal

Work in progress of template for DDEV Drupal projects
0 stars 0 forks source link

#7 Add script to update grumphp.yml to add DDEV support. #8

Closed hkirsman closed 4 months ago

hkirsman commented 4 months ago

Overview

Most of our project probably have Code Quality (GrumPHP) enabled and probably we have it set to run from Lando. If somebody decides to start using DDEV, then grumphp.yml should be updated to so that it then can decide if to run from DDEV or from Lando. It might not be a big deal that Lando starts temporarily, but ideally why should it, if we have DDEV working.

Current solutions logic:

  1. We assume our projects can have both Lando and DDEV setups for now.
  2. We assume developer uses either Lando or DDEV, but not both. So this means every developer has the project set up with either Lando or DDEV only.
  3. So based on these assumptions, DDEV creates different folders under .ddev if it has been started. These are not there if you clone the project. So the trick is to check if .ddev/traefik/ folder exists and if so then start Code Quality with DDEV, if not then with Lando.

Testing

  1. Check that you have this in your grumphp.yml before the update: image

  2. Remove wunderio/ddev-drupal and install this branch:

    ddev composer remove wunderio/ddev-drupal
    ddev composer require wunderio/ddev-drupal:dev-feature/7-update-grumphp-git-hook-from-lando-to-ddev-aware --dev
  3. You should see this: image

  4. Act accordingly and try to commit something. Code Quality checks should happen in DDEV (you should not see Lando starting up).