I have a nested root Drupal 8 site. I would like to create an import and deploy script that runs multiple drush commands. Is this possible via custom script?

| improve this question | | | | |

I was able to do this. Here is a simple example:

First, create a file called import.sh and place it in the scripts folder.


# Exit immediately on errors, and echo commands as they are executed.
set -ex

# Run coniguration import.
cd web
echo "Running coniguration import (config split imoprt)"
drush config-split-import -y

# Clear Cache.
drush cr

Second update composer.json by adding the script to the scripts folder.

"scripts": {
  "import": [

Now you can run composer import

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.