You are here

build-dev-environment.sh in Realistic Dummy Content 7.2

Same filename and directory in other branches
  1. 8.2 developer/build-dev-environment.sh
#!/bin/bash
#
# Build a development environment.
#

set -e

BASEPATH="$(pwd)"
SCRIPTNAME="$(basename "$0")"

if [ ! -f "$BASEPATH"/"$SCRIPTNAME" ]; then
  echo -e '[error] Please run this script from the developer directory of'
  echo -e '        realistic_dummy_content, like this:'
  echo -e ''
  echo -e '            cd /path/to/realistic_dummy_content/developer'
  echo -e "            ./$SCRIPTNAME"
  echo -e ''
  exit 1;
fi

./kill.sh

./docker-compose-in-docker.sh build && \
./docker-compose-in-docker.sh up \
  -d \
  --remove-orphans

SECONDS=15
echo -e "Waiting $SECONDS seconds for the database container to warm up."
sleep "$SECONDS"

for FRAMEWORK in $(/bin/ls frameworks | grep -v README); do
  ./exec.sh "$FRAMEWORK" '/resources/install.sh'
done

echo -e ""
echo -e "-----"
echo -e ""
echo -e "Congratulations! Your development environments are ready."
echo -e ""
./uli.sh
echo -e ""
echo -e "The same code for realistic_dummy_content can be used for"
echo -e "Drupal 7 and Drupal 8. Changes you make to the code at "
echo -e "$(pwd) will be reflected on both environments."

File

developer/build-dev-environment.sh
View source
  1. #!/bin/bash
  2. #
  3. # Build a development environment.
  4. #
  5. set -e
  6. BASEPATH="$(pwd)"
  7. SCRIPTNAME="$(basename "$0")"
  8. if [ ! -f "$BASEPATH"/"$SCRIPTNAME" ]; then
  9. echo -e '[error] Please run this script from the developer directory of'
  10. echo -e ' realistic_dummy_content, like this:'
  11. echo -e ''
  12. echo -e ' cd /path/to/realistic_dummy_content/developer'
  13. echo -e " ./$SCRIPTNAME"
  14. echo -e ''
  15. exit 1;
  16. fi
  17. ./kill.sh
  18. ./docker-compose-in-docker.sh build && \
  19. ./docker-compose-in-docker.sh up \
  20. -d \
  21. --remove-orphans
  22. SECONDS=15
  23. echo -e "Waiting $SECONDS seconds for the database container to warm up."
  24. sleep "$SECONDS"
  25. for FRAMEWORK in $(/bin/ls frameworks | grep -v README); do
  26. ./exec.sh "$FRAMEWORK" '/resources/install.sh'
  27. done
  28. echo -e ""
  29. echo -e "-----"
  30. echo -e ""
  31. echo -e "Congratulations! Your development environments are ready."
  32. echo -e ""
  33. ./uli.sh
  34. echo -e ""
  35. echo -e "The same code for realistic_dummy_content can be used for"
  36. echo -e "Drupal 7 and Drupal 8. Changes you make to the code at "
  37. echo -e "$(pwd) will be reflected on both environments."