Dropsolid Help Center home page
Product documentation
DevOps

Using drush 9 or newer on dropsolid platform

Using drush 9 or newer is now as simple as requiring your chosen drush version in your composer.json file, same way you required drush versions before 9. Below is the old documentation, for reference purposes. We have fixed our hard requirement for drush 8, so it is no longer relevant.

Deprecated drush 9 documentation As more and more Drupal modules require Drush 9 or newer for executing tasks, you may have to add it to your project. The current implementation of Dropsolid Experience Platform has a hard requirement on Drush 8 (and the config and aliases defined as php code/arrays). The plans are there to move to a less Drush dependent ecosystem, but until then some extra steps are needed to be able to use Drush 9 or newer in your deploy flow **Be aware** that Drush 9 is [already EOL](https://www.drush.org/latest/install/#drupal-compatibility), and it makes not much sense to install that version. Use Drush 10 instead. ### Needed steps following steps will describe how to add Drush 10 to a Dropsolid Experience Platform Drupal project. - Ensure you have **no Drush dependency (no 8, 9 or 10)** in your root `composer.json` file. Dropsolid Experience Platform provides a globally installed Drush 8 version (currently 8.3.5) - Create a `composer_drush10` folder inside `project_root/etc` with following composer.json file
{
  "name": "project/composer_drush10",
  "require": {
    "drush/drush": "^10.3",
    "twig/twig": "<<TWIG VERSION>>",
    "guzzlehttp/guzzle": "<<GUZZLE VERSION>>",
    "cweagans/composer-patches": "^1.7"
  },
  "extra": {
    "patches": {
      "drush/drush": {
        "Set location of drush logger service file, skip Robo logger when out of drush context": "https://support.dropsolid.io/assets/devops/general/drush10-external-set-logger-service-location.patch"
      }
    }
  }
}
- ensure the version of twig and guzzle are the same as in the root composer file. This is necessary to prevent incompatibility issues. You can look up the current version by executing following commands in the root folder: `composer show -i twig/twig` `composer show -i guzzlehttp/guzzle` - Additional patch is needed to ensure that drush10 can set a location of `logger.drupaltodrush` service file. Without that patch in place, class `Drush\Log\DrushLog` cannot be located when performing web requests. - Run `composer install` to get the Drush 10 and it's dependencies Now you can use Drush 10 in your deploy scripts with following snippet
#!/bin/sh
DRUSH10="$SCRIPT_DIR/../../etc/composer_drush10/vendor/bin/drush"

php ${DRUSH10} <command_you_want_to_execute>

Send us your question

Do you still have unanswered questions or do you want to make some adjustments to your project? Don't hesitate to ask us your question at support@dropsolid.com or at +3293950290.