mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Improve development workflow in docker (#5079)
* Allow bower install of frontend components as root. Needed for frontend development in docker since everything runs as root in the docker image. * Improve development workflow in docker * Use LANG=C.UTF-8 in tox. Fixes installation of libraries with UTF-8 in it's readme. * Install mysqlclient psycopg2 uvloop after requirements_all.txt again, but with a --no-cache-dir this time. Allows bootstrap_frontend to be executed in a different path like the other scripts.
This commit is contained in:
committed by
Paulus Schoutsen
parent
b2371c6614
commit
c864ea60c9
@@ -1,22 +1,30 @@
|
||||
#!/bin/sh
|
||||
# Builds the frontend for production
|
||||
|
||||
# Stop on errors
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
cd homeassistant/components/frontend/www_static
|
||||
rm -rf core.js* frontend.html* webcomponents-lite.min.js* panels
|
||||
cd home-assistant-polymer
|
||||
# Clean up
|
||||
rm -rf homeassistant/components/frontend/www_static/core.js* \
|
||||
homeassistant/components/frontend/www_static/frontend.html* \
|
||||
homeassistant/components/frontend/www_static/webcomponents-lite.min.js* \
|
||||
homeassistant/components/frontend/www_static/panels
|
||||
cd homeassistant/components/frontend/www_static/home-assistant-polymer
|
||||
npm run clean
|
||||
npm run frontend_prod
|
||||
|
||||
# Build frontend
|
||||
npm run frontend_prod
|
||||
cp bower_components/webcomponentsjs/webcomponents-lite.min.js ..
|
||||
cp -r build/* ..
|
||||
BUILD_DEV=0 node script/gen-service-worker.js
|
||||
cp build/service_worker.js ..
|
||||
|
||||
cd ..
|
||||
|
||||
# Pack frontend
|
||||
gzip -f -k -9 *.html *.js ./panels/*.html
|
||||
cd ../../../..
|
||||
|
||||
# Generate the MD5 hash of the new frontend
|
||||
cd ../../../..
|
||||
script/fingerprint_frontend.py
|
||||
|
||||
Reference in New Issue
Block a user