You are here

deploy.sh in Realistic Dummy Content 3.x

#!/bin/bash
#
# Deploy a development or testing environment.
# If this is passed with the argument "9", then Drupal 9 is used. Otherwise
# Drupal 8 is used.
#
set -e

echo ''
echo '-----'
echo 'About to create the realistic_dummy_content_default network if it does not exist,'
echo 'because we need it to have a predictable name when we try to connect'
echo 'other containers to it (for example browser testers).'
echo 'See https://github.com/docker/compose/issues/3736.'
docker network ls | grep realistic_dummy_content_default || docker network create realistic_dummy_content_default

echo ''
echo '-----'
echo 'About to start persistent (-d) containers based on the images defined'
echo 'in ./Dockerfile-* files. We are also telling docker-compose to'
echo 'rebuild the images if they are out of date.'
if [ "$1" == 9 ]; then
  docker-compose -f docker-compose.yml -f docker-compose.drupal9.yml up -d --build
else
  docker-compose up -d --build
fi

echo ''
echo '-----'
echo 'Running the deploy scripts on the container.'
docker-compose exec -T drupal /bin/bash -c 'cd ./modules/custom/realistic_dummy_content/scripts/lib/docker-resources && ./deploy.sh'

echo ''
echo '-----'
echo ''
echo 'If all went well you can now access your site at:'
echo ''
./scripts/uli.sh
echo ''

File

scripts/deploy.sh
View source
  1. #!/bin/bash
  2. #
  3. # Deploy a development or testing environment.
  4. # If this is passed with the argument "9", then Drupal 9 is used. Otherwise
  5. # Drupal 8 is used.
  6. #
  7. set -e
  8. echo ''
  9. echo '-----'
  10. echo 'About to create the realistic_dummy_content_default network if it does not exist,'
  11. echo 'because we need it to have a predictable name when we try to connect'
  12. echo 'other containers to it (for example browser testers).'
  13. echo 'See https://github.com/docker/compose/issues/3736.'
  14. docker network ls | grep realistic_dummy_content_default || docker network create realistic_dummy_content_default
  15. echo ''
  16. echo '-----'
  17. echo 'About to start persistent (-d) containers based on the images defined'
  18. echo 'in ./Dockerfile-* files. We are also telling docker-compose to'
  19. echo 'rebuild the images if they are out of date.'
  20. if [ "$1" == 9 ]; then
  21. docker-compose -f docker-compose.yml -f docker-compose.drupal9.yml up -d --build
  22. else
  23. docker-compose up -d --build
  24. fi
  25. echo ''
  26. echo '-----'
  27. echo 'Running the deploy scripts on the container.'
  28. docker-compose exec -T drupal /bin/bash -c 'cd ./modules/custom/realistic_dummy_content/scripts/lib/docker-resources && ./deploy.sh'
  29. echo ''
  30. echo '-----'
  31. echo ''
  32. echo 'If all went well you can now access your site at:'
  33. echo ''
  34. ./scripts/uli.sh
  35. echo ''