in_docker_test_script.sh 877 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/env bash
  2. set -euxo pipefail
  3. SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
  4. export TELEMETRY_ENABLED=false
  5. function do_export () {
  6. template=$1
  7. mkdir ~/"$template"
  8. cd ~/"$template"
  9. rm -rf ~/.local/share/reflex ~/"$template"/.web
  10. reflex init --template "$template"
  11. reflex export
  12. (
  13. cd "$SCRIPTPATH/../.."
  14. scripts/integration.sh ~/"$template" dev
  15. pkill -9 -f 'next-server|python3' || true
  16. sleep 10
  17. REDIS_URL=redis://localhost scripts/integration.sh ~/"$template" prod
  18. pkill -9 -f 'next-server|python3' || true
  19. sleep 10
  20. )
  21. }
  22. echo "Preparing test project dir"
  23. python3 -m venv ~/venv
  24. source ~/venv/bin/activate
  25. echo "Installing reflex from local repo code"
  26. pip install /reflex-repo
  27. redis-server &
  28. echo "Running reflex init in test project dir"
  29. do_export blank