prometheus/scripts/build_react_app.sh
Julius Volz e8027ba515
React UI: Serve React UI under /new (#6229)
This makes React UI URLs look nicer than the previous
/static/graph-new/app.html, but internally still serves all React UI
files from the compiled-in static assets directory.

Also, to allow future usage of the React / Reach router, we need to
serve the main React app's index.html on certain sub-paths that
correspond to current Prometheus's UI pages, instead of trying to serve
actual files that match the provided path name.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2019-10-28 10:45:53 +01:00

19 lines
315 B
Bash
Executable file

#!/usr/bin/env bash
#
# Build React web UI.
# Run from repository root.
set -e
set -u
if ! [[ "$0" =~ "scripts/build_react_app.sh" ]]; then
echo "must be run from repository root"
exit 255
fi
cd web/ui/react-app
echo "building React app"
PUBLIC_URL=. yarn build
rm -rf ../static/react
mv build ../static/react