You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
3.0 KiB

  1. #!/bin/bash
  2. echo "####################################################################"
  3. echo "# docker_typo3_setup_script #"
  4. echo "# Dennis Buchhorn - bucde@b-eit.de #"
  5. echo "####################################################################"
  6. echo "# WARNING: password is plain text input! #"
  7. echo "# #"
  8. echo "# Config will be saved in 'config' file. #"
  9. echo "# (everything in plain text, even the password) #"
  10. #echo "# #"
  11. echo "####################################################################"
  12. echo ""
  13. DATE=$(date +'%y%m%d%H%M%S')
  14. CONFIG_EXISTS="false"
  15. USE_EXISTING_CONFIG=""
  16. DELETE_CONFIG=""
  17. TYPO3_PROJECT_NAME="typo3_${DATE}"
  18. TYPO3_PROJECT_NAME_SUFFIX=""
  19. TYPO3_CONTAINER_NAME="${TYPO3_PROJECT_NAME}_core"
  20. TYPO3_IMAGE="martinhelmich/typo3"
  21. TYPO3_VERSION=""
  22. TYPO3_HOST_IP_ADDRESS=""
  23. TYPO3_HOST_PORT=""
  24. read -p "Enter typo3 project name suffix (leave empty for none): " TYPO3_PROJECT_NAME_SUFFIX
  25. if [ -n "$TYPO3_PROJECT_NAME_SUFFIX" ]; then
  26. TYPO3_PROJECT_NAME="${TYPO3_PROJECT_NAME}_${TYPO3_PROJECT_NAME_SUFFIX}"
  27. TYPO3_CONTAINER_NAME="${TYPO3_CONTAINER_NAME}_${TYPO3_PROJECT_NAME_SUFFIX}"
  28. fi
  29. rm -f .env
  30. touch .env
  31. echo "COMPOSE_PROJECT_NAME="$TYPO3_PROJECT_NAME >> .env
  32. echo "TYPO3_CONTAINER_NAME="$TYPO3_CONTAINER_NAME >> .env
  33. if [ -f "config" ]; then
  34. CONFIG_EXISTS="true"
  35. read -p "Config file 'config' already exists! Would you like to use this? (y/n)" USE_EXISTING_CONFIG
  36. fi
  37. if [ $CONFIG_EXISTS == "false" ] || [ $USE_EXISTING_CONFIG == "n" ]; then
  38. read -p "Would you like to use custom image 'b-eit/typo3'? (y/n)" USE_CUSTOM_IMAGE
  39. if [ $USE_CUSTOM_IMAGE == "y" ]; then
  40. echo "You have to build this image (with correct version you want to use) befor manualy with the build script!"
  41. read -p "Have you done this? (ENTER)"
  42. TYPO3_IMAGE="b-eit/typo3"
  43. fi
  44. read -p "Enter typo3 version which should be used: " TYPO3_VERSION
  45. read -p "Enter host (vm) ip address on which typo3 should be accessible: " TYPO3_HOST_IP_ADDRESS
  46. read -p "Enter host (vm) port on which typo3 should be accessible: " TYPO3_HOST_PORT
  47. rm -f config
  48. touch config
  49. echo "TYPO3_VERSION="$TYPO3_VERSION >> config
  50. echo "TYPO3_HOST_IP_ADDRESS="$TYPO3_HOST_IP_ADDRESS >> config
  51. echo "TYPO3_HOST_PORT="$TYPO3_HOST_PORT >> config
  52. echo "Config file 'config' created!"
  53. else
  54. echo "Use existing config file 'config'!"
  55. fi
  56. cat "config" >> ".env"
  57. read -p "Should the config file 'config' be deleted after creating the container? (y/n)" DELETE_CONFIG
  58. mkdir -p fileadmin typo3conf uploads
  59. docker-compose up -d
  60. echo -n "Wait until typo3 is ready ..."
  61. #while [ "`docker inspect -f {{.State.Health.Status}} $KIMAI_CONTAINER_NAME`" != "healthy" ]; do
  62. #echo -n "."
  63. #sleep 1
  64. #done
  65. echo -e "\nTypo3 is ready!"
  66. if [ $DELETE_CONFIG == "y" ]; then
  67. rm -f config
  68. echo "Config file 'config' deleted!"
  69. fi
  70. rm -f .env
  71. echo "Done!"