You are here

deploy.sh in Realistic Dummy Content 3.x

#!/bin/bash
#
# This script is run when the Drupal docker container is ready. It prepares
# an environment for development or testing, which contains a full Drupal
# installation with a running website.
#
set -e

echo "Will try to connect to MySQL container until it is up. This can take up to 15 seconds if the container has just been spun up."
OUTPUT="ERROR"
while [[ "$OUTPUT" == *"ERROR"* ]]
do
  OUTPUT=$(echo 'show databases'|{ mysql -h mysql -u root --password=drupal 2>&1 || true; })
  if [[ "$OUTPUT" == *"ERROR"* ]]; then
    echo "MySQL container is not available yet. Should not be long..."
    sleep 2
  else
    echo "MySQL is up! Moving on..."
  fi
done

drush si -y --db-url "mysqli://root:drupal@mysql/drupal"
chown -R www-data:www-data /var/www/html/sites/default/files
drush cr
drush en -y realistic_dummy_content devel_generate

File

scripts/lib/docker-resources/deploy.sh
View source
  1. #!/bin/bash
  2. #
  3. # This script is run when the Drupal docker container is ready. It prepares
  4. # an environment for development or testing, which contains a full Drupal
  5. # installation with a running website.
  6. #
  7. set -e
  8. echo "Will try to connect to MySQL container until it is up. This can take up to 15 seconds if the container has just been spun up."
  9. OUTPUT="ERROR"
  10. while [[ "$OUTPUT" == *"ERROR"* ]]
  11. do
  12. OUTPUT=$(echo 'show databases'|{ mysql -h mysql -u root --password=drupal 2>&1 || true; })
  13. if [[ "$OUTPUT" == *"ERROR"* ]]; then
  14. echo "MySQL container is not available yet. Should not be long..."
  15. sleep 2
  16. else
  17. echo "MySQL is up! Moving on..."
  18. fi
  19. done
  20. drush si -y --db-url "mysqli://root:drupal@mysql/drupal"
  21. chown -R www-data:www-data /var/www/html/sites/default/files
  22. drush cr
  23. drush en -y realistic_dummy_content devel_generate