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:
Michaël Arnauts authored and Paulus Schoutsen committed 2017-01-02 22:04:09 +01:00
1 parent b2371c6614
commit c864ea60c9
21 files changed
+142 -71

No files matched your search

+3 -3
View File
@@ -1,9 +1,9 @@
#!/bin/sh
# Resolve all dependencies that the application requires to run.
# script/bootstrap: Resolve all dependencies that the application requires to
# run.
# Stop on errors
set -e
cd "$(dirname "$0")/.."
script/bootstrap_server
script/bootstrap_frontend
+15 -1
View File
@@ -1,7 +1,21 @@
#!/bin/sh
# Resolve all frontend dependencies that the application requires to run.
# Stop on errors
set -e
cd "$(dirname "$0")/.."
echo "Bootstrapping frontend..."
git submodule update
cd homeassistant/components/frontend/www_static/home-assistant-polymer
# Install node modules
npm install
./node_modules/.bin/bower install
# Install bower web components. Allow to download the components as root since the user in docker is root.
./node_modules/.bin/bower install --allow-root
npm run setup_js_dev
cd ../../../../..
+6
View File
@@ -1,3 +1,9 @@
#!/bin/sh
# Resolve all server dependencies that the application requires to run.
# Stop on errors
set -e
cd "$(dirname "$0")/.."
echo "Installing dependencies..."
+14 -6
View File
@@ -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
+6 -2
View File
@@ -1,7 +1,11 @@
# Sets up and builds python open zwave to be used with Home Assistant
#!/bin/sh
# Sets up and builds python open zwave to be used with Home Assistant.
# Dependencies that need to be installed:
# apt-get install cython3 libudev-dev python3-sphinx python3-setuptools
# Stop on errors
set -e
cd "$(dirname "$0")/.."
if [ ! -d build ]; then
@@ -15,7 +19,7 @@ if [ -d python-openzwave ]; then
git pull --recurse-submodules=yes
git submodule update --init --recursive
else
git clone --recursive --depth 1 https://github.com/OpenZWave/python-openzwave.git
git clone --branch python3 --recursive --depth 1 https://github.com/OpenZWave/python-openzwave.git
cd python-openzwave
fi
+6 -2
View File
@@ -1,11 +1,15 @@
# Build and run Home Assinstant in Docker
#!/bin/sh
# Build and run Home Assinstant in Docker.
# Optional: pass in a timezone as first argument
# If not given will attempt to mount /etc/localtime
# Stop on errors
set -e
cd "$(dirname "$0")/.."
docker build -t home-assistant-dev .
docker build -t home-assistant-dev -f virtualization/Docker/Dockerfile.dev .
if [ $# -gt 0 ]
then
+2 -2
View File
@@ -1,5 +1,5 @@
# Open a docker that can be used to debug/dev python-openzwave
# Pass in a command line argument to build
#!/bin/sh
# Open a docker that can be used to debug/dev python-openzwave. Pass in a command line argument to build
cd "$(dirname "$0")/.."
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
"""Generate a file with all md5 hashes of the assets."""
from collections import OrderedDict
import glob
import hashlib
+1 -3
View File
@@ -1,7 +1,5 @@
#!/bin/sh
#
# NOTE: all testing is now driven through tox. The tox command below
# performs roughly what this test did in the past.
# Execute lint to spot code mistakes.
if [ "$1" = "--changed" ]; then
export files="`git diff upstream/dev --name-only | grep -e '\.py$'`"
+5 -2
View File
@@ -1,5 +1,8 @@
#!/bin/bash
#!/bin/sh
# Execute lint in a docker container to spot code mistakes.
# Stop on errors
set -e
docker build -t home-assistant-test -f virtualization/Docker/Dockerfile.test .
docker build -t home-assistant-test -f virtualization/Docker/Dockerfile.dev .
docker run --rm -it home-assistant-test tox -e lint
+5 -1
View File
@@ -1,4 +1,8 @@
# Pushes a new version to PyPi
#!/bin/sh
# Pushes a new version to PyPi.
# Stop on errors
set -e
cd "$(dirname "$0")/.."
+3 -3
View File
@@ -1,8 +1,8 @@
#!/bin/sh
# Launch the application and any extra required processes locally.
# script/server: Launch the application and any extra required processes
# locally.
# Stop on errors
set -e
cd "$(dirname "$0")/.."
python3 -m homeassistant -c config
+6 -2
View File
@@ -1,6 +1,10 @@
#!/usr/bin/env sh
cd "$(dirname "$0")/.."
#!/bin/sh
# Setups the repository.
# Stop on errors
set -e
cd "$(dirname "$0")/.."
git submodule init
script/bootstrap
python3 setup.py develop
+1 -3
View File
@@ -1,6 +1,4 @@
#!/bin/sh
#
# NOTE: all testing is now driven through tox. The tox command below
# performs roughly what this test did in the past.
# Excutes the tests with tox.
tox -e py34
+6 -3
View File
@@ -1,5 +1,8 @@
#!/bin/bash
#!/bin/sh
# Excutes the tests with tox in a docker container.
# Stop on errors
set -e
docker build -t home-assistant-test -f virtualization/Docker/Dockerfile.test .
docker run --rm -it home-assistant-test tox -e py34
docker build -t home-assistant-test -f virtualization/Docker/Dockerfile.dev .
docker run --rm -it home-assistant-test tox -e py35
+3 -2
View File
@@ -1,8 +1,9 @@
#!/bin/sh
# Update application to run for its current checkout.
# script/update: Update application to run for its current checkout.
# Stop on errors
set -e
cd "$(dirname "$0")/.."
git pull
git submodule update
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
"""Download the latest Polymer v1 iconset for materialdesignicons.com."""
import gzip
import os
import re