summaryrefslogtreecommitdiff
path: root/manage.sh
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2016-01-02 11:14:49 +0100
committerAdam Tauber <asciimoo@gmail.com>2016-01-10 19:23:10 +0100
commit53979a7bf7669c803c2a493fbf136519f6a293e6 (patch)
tree3b79da9408699108ba89b22cedf73cfff1fe59b7 /manage.sh
parentf9186344b3642fb3d55d2dc46c96c6b25b8ccf41 (diff)
[mod] remove buildout/makefile infrastructure
Diffstat (limited to 'manage.sh')
-rwxr-xr-xmanage.sh70
1 files changed, 70 insertions, 0 deletions
diff --git a/manage.sh b/manage.sh
new file mode 100755
index 00000000..39a8e27d
--- /dev/null
+++ b/manage.sh
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+BASE_DIR=$(dirname `readlink -f $0`)
+PYTHONPATH=$BASE_DIR
+SEARX_DIR="$BASE_DIR/searx"
+ACTION=$1
+
+update_packages() {
+ pip install --upgrade -r "$BASE_DIR/requirements.txt"
+}
+
+update_dev_packages() {
+ pip install --upgrade -r "$BASE_DIR/requirements-dev.txt"
+}
+
+pep8_check() {
+ echo '[!] Running pep8 check'
+ pep8 "$SEARX_DIR" "$BASE_DIR/tests"
+}
+
+unit_tests() {
+ echo '[!] Running unit tests'
+ python -m nose2 -s "$BASE_DIR/tests/unit"
+}
+
+py_test_coverage() {
+ echo '[!] Running python test coverage'
+ PYTHONPATH=`pwd` python -m nose2 -C --coverage "$SEARX_DIR" -s "$BASE_DIR/tests/unit"
+ coverage report
+ coverage html
+}
+
+robot_tests() {
+ echo '[!] Running robot tests'
+ python -c "import zope.testrunner; import sys; sys.exit(zope.testrunner.run("\
+"['--color', '--auto-progress', '--layer', 'SearxRobotLayer', '--test-path', '$BASE_DIR']))"
+}
+
+tests() {
+ set -e
+ pep8_check
+ unit_tests
+ robot_tests
+ set +e
+}
+
+build_style() {
+ lessc -x "$BASE_DIR/searx/static/$1" "$BASE_DIR/searx/static/$2"
+}
+
+styles() {
+ echo '[!] Building styles'
+ build_style themes/default/less/style.less themes/default/css/style.css
+ build_style themes/default/less/style-rtl.less themes/default/css/style-rtl.css
+ build_style themes/courgette/less/style.less themes/courgette/css/style.css
+ build_style themes/courgette/less/style-rtl.less themes/courgette/css/style-rtl.css
+ build_style less/bootstrap/bootstrap.less css/bootstrap.min.css
+ build_style themes/oscar/less/oscar/oscar.less themes/oscar/css/oscar.min.css
+ build_style themes/pix-art/less/style.less themes/pix-art/css/style.css
+}
+
+grunt() {
+ grunt --gruntfile "$SEARX_DIR/static/themes/oscar/gruntfile.js"
+}
+
+locales() {
+ pybabel compile -d "$SEARX_DIR/translations"
+}
+
+$ACTION