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.

80 lines
2.6 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_VERSION=""
  21. TYPO3_HOST_IP_ADDRESS=""
  22. TYPO3_HOST_PORT=""
  23. read -p "Enter typo3 project name suffix (leave empty for none): " TYPO3_PROJECT_NAME_SUFFIX
  24. if [ -n "$TYPO3_PROJECT_NAME_SUFFIX" ]; then
  25. TYPO3_PROJECT_NAME="${TYPO3_PROJECT_NAME}_${TYPO3_PROJECT_NAME_SUFFIX}"
  26. TYPO3_CONTAINER_NAME="${TYPO3_CONTAINER_NAME}_${TYPO3_PROJECT_NAME_SUFFIX}"
  27. fi
  28. rm -f .env
  29. touch .env
  30. echo "COMPOSE_PROJECT_NAME="$TYPO3_PROJECT_NAME >> .env
  31. echo "TYPO3_CONTAINER_NAME="$TYPO3_CONTAINER_NAME >> .env
  32. if [ -f "config" ]; then
  33. CONFIG_EXISTS="true"
  34. read -p "Config file 'config' already exists! Would you like to use this? (y/n)" USE_EXISTING_CONFIG
  35. fi
  36. if [ $CONFIG_EXISTS == "false" ] || [ $USE_EXISTING_CONFIG == "n" ]; then
  37. read -p "Enter typo3 version which should be used: " TYPO3_VERSION
  38. read -p "Enter host (vm) ip address on which typo3 should be accessible: " TYPO3_HOST_IP_ADDRESS
  39. read -p "Enter host (vm) port on which typo3 should be accessible: " TYPO3_HOST_PORT
  40. rm -f config
  41. touch config
  42. echo "TYPO3_VERSION="$TYPO3_VERSION >> config
  43. echo "TYPO3_HOST_IP_ADDRESS="$TYPO3_HOST_IP_ADDRESS >> config
  44. echo "TYPO3_HOST_PORT="$TYPO3_HOST_PORT >> config
  45. echo "Config file 'config' created!"
  46. else
  47. echo "Use existing config file 'config'!"
  48. fi
  49. cat "config" >> ".env"
  50. read -p "Should the config file 'config' be deleted after creating the container? (y/n)" DELETE_CONFIG
  51. mkdir -p fileadmin typo3conf uploads
  52. docker-compose up -d
  53. echo -n "Wait until typo3 is ready ..."
  54. #while [ "`docker inspect -f {{.State.Health.Status}} $KIMAI_CONTAINER_NAME`" != "healthy" ]; do
  55. #echo -n "."
  56. #sleep 1
  57. #done
  58. echo -e "\nTypo3 is ready!"
  59. rm -f .env
  60. echo "Done!"