To use the post-staging-update hook:
Create a directory called factory-hooks in the root of your code repository, if it doesn’t already exist.
The factory-hooks and docroot directories are separate directories at the same level in your code repository.
post-staging-update directory in the factory-hooks directory, if it doesn’t already exist./factory-hooks/post-staging-update directory, add the script file or files you created for this procedure.After executing a staging deployment, review the newly staged website, as well as any logging output created by your hook script, to check if your hook script executed successfully.
If a script in the post-staging-update directory ends with an error (a non-zero exit code), no additional scripts will run in the directory, and the task logs will display error messages in SynchronizeSingleSite tasks.
Change the following script to meet your needs:
#!/usr/bin/env bash
SITEGROUP="$1"
ENVIRONMENT="$2"
DB_ROLE="$3"
DOMAIN="$4"
echo "sitegroup: $SITEGROUP"
echo "env: $ENVIRONMENT"
echo "db role: $DB_ROLE"
echo "domain: $DOMAIN"
\drush8 -r /var/www/html/$SITEGROUP.$ENVIRONMENT/docroot -l $DOMAIN ev 'echo "Hello world";'If this content did not answer your questions, try searching or contacting our support team for further assistance.
If this content did not answer your questions, try searching or contacting our support team for further assistance.