First pass for scripts to rule them all

This commit is contained in:
Paulus Schoutsen 2015-09-17 00:35:26 -07:00
parent 3947ed3c2b
commit 8c77418b6a
18 changed files with 52 additions and 44 deletions

View File

@ -2,12 +2,5 @@ sudo: false
language: python
python:
- "3.4"
install:
- pip install -r requirements_all.txt
- pip install flake8 pylint coveralls
script:
- flake8 homeassistant
- pylint homeassistant
- coverage run -m unittest discover tests
after_success:
- coveralls
- script/cibuild

4
script/bootstrap Executable file
View File

@ -0,0 +1,4 @@
cd "$(dirname "$0")/.."
script/bootstrap_server
script/bootstrap_frontend

5
script/bootstrap_frontend Executable file
View File

@ -0,0 +1,5 @@
echo "Bootstrapping frontend..."
cd homeassistant/components/frontend/www_static/home-assistant-polymer
npm install
npm run setup_js_dev
cd ../../../../..

10
script/bootstrap_server Normal file
View File

@ -0,0 +1,10 @@
cd "$(dirname "$0")/.."
echo "Update the submodule to latest version..."
git submodule update
echo "Installing dependencies..."
python3 -m pip install --upgrade -r requirements_all.txt
echo "Installing development dependencies.."
python3 -m pip install --upgrade flake8 pylint coveralls py.test

View File

@ -1,12 +1,8 @@
# Builds the frontend for production
# If current pwd is scripts, go 1 up.
if [ ${PWD##*/} == "scripts" ]; then
cd ..
fi
cd "$(dirname "$0")/.."
cd homeassistant/components/frontend/www_static/home-assistant-polymer
npm install
npm run frontend_prod
cp bower_components/webcomponentsjs/webcomponents-lite.min.js ..

View File

@ -3,10 +3,7 @@
# apt-get install cython3 libudev-dev python-sphinx python3-setuptools
# pip3 install cython
# If current pwd is scripts, go 1 up.
if [ ${PWD##*/} == "scripts" ]; then
cd ..
fi
cd "$(dirname "$0")/.."
if [ ! -d build ]; then
mkdir build

3
script/cibuild Executable file
View File

@ -0,0 +1,3 @@
script/bootstrap_server
script/test coverage
coveralls

View File

@ -3,10 +3,7 @@
# Optional: pass in a timezone as first argument
# If not given will attempt to mount /etc/localtime
# If current pwd is scripts, go 1 up.
if [ ${PWD##*/} == "scripts" ]; then
cd ..
fi
cd "$(dirname "$0")/.."
docker build -t home-assistant-dev .

View File

@ -1,10 +1,7 @@
# Open a docker that can be used to debug/dev python-openzwave
# Pass in a command line argument to build
# If current pwd is scripts, go 1 up.
if [ ${PWD##*/} == "scripts" ]; then
cd ..
fi
cd "$(dirname "$0")/.."
if [ $# -gt 0 ]
then

0
scripts/hass-daemon → script/hass-daemon Normal file → Executable file
View File

9
script/lint Executable file
View File

@ -0,0 +1,9 @@
# Run style checks
cd "$(dirname "$0")/.."
echo "Checking style with flake8..."
flake8 homeassistant
echo "Checking style with pylint..."
pylint homeassistant

3
script/server Executable file
View File

@ -0,0 +1,3 @@
cd "$(dirname "$0")/.."
python3 -m homeassistant -c config

4
script/setup Executable file
View File

@ -0,0 +1,4 @@
cd "$(dirname "$0")/.."
git submodule init
script/bootstrap

View File

@ -1,10 +1,11 @@
# If current pwd is scripts, go 1 up.
if [ ${PWD##*/} == "scripts" ]; then
cd ..
fi
cd "$(dirname "$0")/.."
echo "Running tests..."
if [ "$1" = "coverage" ]; then
coverage run -m unittest discover tests
else
python3 -m unittest discover tests
fi
script/lint

4
script/update Executable file
View File

@ -0,0 +1,4 @@
cd "$(dirname "$0")/.."
git pull
git submodule update

View File

@ -1,9 +0,0 @@
# Run style checks
# If current pwd is scripts, go 1 up.
if [ ${PWD##*/} == "scripts" ]; then
cd ..
fi
flake8 homeassistant
pylint homeassistant

View File

@ -1,6 +0,0 @@
echo "The update script has been deprecated since Home Assistant v0.7"
echo
echo "Home Assistant is now distributed via PyPi and can be installed and"
echo "upgraded by running: pip3 install --upgrade homeassistant"
echo
echo "If you are developing a new feature for Home Assistant, run: git pull"