env.sh 387 B

1234567891011121314151617181920
  1. #!/bin/bash
  2. # This script is used when the docker container starts and does the magic to
  3. # bring the ENV variables to the generated static UI.
  4. TARGET=./env-config.js
  5. # Recreate config file
  6. echo -n > $TARGET
  7. declare -a vars=(
  8. "WS_URL"
  9. "SAMPLE"
  10. )
  11. echo "window.process_env = {" >> $TARGET
  12. for VAR in ${vars[@]}; do
  13. echo " $VAR: \"${!VAR}\"," >> $TARGET
  14. done
  15. echo "}" >> $TARGET