Skip to content

Commit

Permalink
First pass for scripts to rule them all
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob committed Sep 17, 2015
1 parent 3947ed3 commit 8c77418
Show file tree
Hide file tree
Showing 18 changed files with 52 additions and 44 deletions.
9 changes: 1 addition & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 4 additions & 0 deletions script/bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cd "$(dirname "$0")/.."

script/bootstrap_server
script/bootstrap_frontend
5 changes: 5 additions & 0 deletions script/bootstrap_frontend
Original file line number Diff line number Diff line change
@@ -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 changes: 10 additions & 0 deletions script/bootstrap_server
Original file line number Diff line number Diff line change
@@ -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
6 changes: 1 addition & 5 deletions scripts/build_frontend → script/build_frontend
Original file line number Diff line number Diff line change
@@ -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 ..
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions script/cibuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
script/bootstrap_server
script/test coverage
coveralls
5 changes: 1 addition & 4 deletions scripts/dev_docker → script/dev_docker
Original file line number Diff line number Diff line change
Expand Up @@ -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 .

Expand Down
5 changes: 1 addition & 4 deletions scripts/dev_openzwave_docker → script/dev_openzwave_docker
Original file line number Diff line number Diff line change
@@ -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
Expand Down
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions script/lint
Original file line number Diff line number Diff line change
@@ -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 changes: 3 additions & 0 deletions script/server
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cd "$(dirname "$0")/.."

python3 -m homeassistant -c config
4 changes: 4 additions & 0 deletions script/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cd "$(dirname "$0")/.."

git submodule init
script/bootstrap
9 changes: 5 additions & 4 deletions scripts/run_tests → script/test
Original file line number Diff line number Diff line change
@@ -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 changes: 4 additions & 0 deletions script/update
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cd "$(dirname "$0")/.."

git pull
git submodule update
9 changes: 0 additions & 9 deletions scripts/check_style

This file was deleted.

6 changes: 0 additions & 6 deletions scripts/update

This file was deleted.

0 comments on commit 8c77418

Please sign in to comment.