on master help sign in
[fix] travis build : various fix about grunt builds
commit57dc6b625f85a39f722727b2fd107a64637a8bb9 authorAlexandre Flament <alex@al-f.net> dateSun 13 Aug 2017, 12:17 (9 years ago) parentd0cebd6
4 files changed+36−21
.travis.yml+1−4 manage.sh+30−17 searx/static/themes/oscar/gruntfile.js+4 searx/static/themes/simple/gruntfile.js+1
.travis.yml+1−4
@@ -15,10 +15,7 @@ before_install:
1515 - "sh -e /etc/init.d/xvfb start"
1616 - npm install less less-plugin-clean-css grunt-cli
1717 - export PATH=`pwd`/node_modules/.bin:$PATH
18− - ls -l $VIRTUAL_ENV
19− - ls -l $VIRTUAL_ENV/bin
20− - ( cd searx/static/themes/oscar;npm install; cd - )
21− - ( cd searx/static/themes/simple;npm install; cd - )
18+ - ./manage.sh grunt_packages
2219 - mkdir -p ~/drivers; export PATH=~/drivers:$PATH;
2320 - GECKODRIVER_URL="https://github.com/mozilla/geckodriver/releases/download/v0.18.0/geckodriver-v0.18.0-linux64.tar.gz";
2421 - FILE=`mktemp`; wget "$GECKODRIVER_URL" -qO $FILE && tar xz -C ~/drivers -f $FILE geckodriver; rm $FILE; chmod 777 ~/drivers/geckodriver;
manage.sh+30−17
@@ -5,6 +5,8 @@ PYTHONPATH=$BASE_DIR
55SEARX_DIR="$BASE_DIR/searx"
66ACTION=$1
77
8+cd $BASE_DIR
9+
810update_packages() {
911 pip install -r "$BASE_DIR/requirements.txt"
1012}
@@ -14,7 +16,7 @@ update_dev_packages() {
1416 pip install -r "$BASE_DIR/requirements-dev.txt"
1517}
1618
17−check_geckodriver() {
19+install_geckodriver() {
1820 echo '[!] Checking geckodriver'
1921 set -e
2022 geckodriver -V 2>1 > /dev/null || NOTFOUND=1
@@ -73,37 +75,47 @@ tests() {
7375 set -e
7476 pep8_check
7577 unit_tests
76− check_geckodriver
78+ install_geckodriver
7779 robot_tests
7880 set +e
7981}
8082
8183build_style() {
82− # lessc -x "$BASE_DIR/searx/static/$1" "$BASE_DIR/searx/static/$2"
8384 lessc --clean-css="--s1 --advanced --compatibility=ie9" "$BASE_DIR/searx/static/$1" "$BASE_DIR/searx/static/$2"
8485}
8586
8687styles() {
8788 echo '[!] Building styles'
88− build_style themes/legacy/less/style.less themes/legacy/css/style.css
89− build_style themes/legacy/less/style-rtl.less themes/legacy/css/style-rtl.css
90− build_style themes/courgette/less/style.less themes/courgette/css/style.css
91− build_style themes/courgette/less/style-rtl.less themes/courgette/css/style-rtl.css
92− build_style less/bootstrap/bootstrap.less css/bootstrap.min.css
93− build_style themes/oscar/less/pointhi/oscar.less themes/oscar/css/pointhi.min.css
94− build_style themes/oscar/less/logicodev/oscar.less themes/oscar/css/logicodev.min.css
95− build_style themes/pix-art/less/style.less themes/pix-art/css/style.css
96− build_style themes/simple/less/style.less themes/simple/css/searx.min.css
97− build_style themes/simple/less/style-rtl.less themes/simple/css/searx-rtl.min.css
89+ build_style themes/legacy/less/style.less themes/legacy/css/style.css
90+ build_style themes/legacy/less/style-rtl.less themes/legacy/css/style-rtl.css
91+ build_style themes/courgette/less/style.less themes/courgette/css/style.css
92+ build_style themes/courgette/less/style-rtl.less themes/courgette/css/style-rtl.css
93+ build_style less/bootstrap/bootstrap.less css/bootstrap.min.css
94+ build_style themes/oscar/less/pointhi/oscar.less themes/oscar/css/pointhi.min.css
95+ build_style themes/oscar/less/logicodev/oscar.less themes/oscar/css/logicodev.min.css
96+ build_style themes/pix-art/less/style.less themes/pix-art/css/style.css
97+ build_style themes/simple/less/style.less themes/simple/css/searx.min.css
98+ build_style themes/simple/less/style-rtl.less themes/simple/css/searx-rtl.min.css
99+}
100+
101+grunt_packages() {
102+ echo '[!] Grunt packages: install dependencies'
103+ cd $BASE_DIR/searx/static/themes/oscar
104+ npm install
105+
106+ cd $BASE_DIR/searx/static/themes/simple
107+ npm install
98108}
99109
100110grunt_build() {
101− grunt --gruntfile "$SEARX_DIR/static/themes/oscar/gruntfile.js"
102− grunt --gruntfile "$SEARX_DIR/static/themes/simple/gruntfile.js"
111+ echo '[!] Grunt build : oscar theme'
112+ grunt --gruntfile "$SEARX_DIR/static/themes/oscar/gruntfile.js"
113+ echo '[!] Grunt build : simple theme'
114+ grunt --gruntfile "$SEARX_DIR/static/themes/simple/gruntfile.js"
103115}
104116
105117locales() {
106− pybabel compile -d "$SEARX_DIR/translations"
118+ pybabel compile -d "$SEARX_DIR/translations"
107119}
108120
109121help() {
@@ -112,6 +124,7 @@ help() {
112124
113125Commands
114126========
127+ grunt_packages - Download & install dependencies
115128 grunt_build - Build js files
116129 help - This text
117130 locales - Compile locales
@@ -123,7 +136,7 @@ Commands
123136 unit_tests - Run unit tests
124137 update_dev_packages - Check & update development and production dependency changes
125138 update_packages - Check & update dependency changes
126− check_geckodriver - Check & download geckodriver (required for robot_tests)
139+ install_geckodriver - Download & install geckodriver if not already installed (required for robot_tests)
127140"
128141}
129142
searx/static/themes/oscar/gruntfile.js+4
@@ -24,6 +24,7 @@ module.exports = function(grunt) {
2424 jshint: {
2525 files: ['gruntfile.js', 'js/searx_src/*.js'],
2626 options: {
27+ reporterOutput: "",
2728 // options here to override JSHint defaults
2829 globals: {
2930 jQuery: true,
@@ -51,6 +52,8 @@ module.exports = function(grunt) {
5152 files: {"css/pointhi.min.css": "less/pointhi/oscar.less",
5253 "css/logicodev.min.css": "less/logicodev/oscar.less"}
5354 },
55+ /*
56+ // built with ./manage.sh styles
5457 bootstrap: {
5558 options: {
5659 paths: ["less/bootstrap"],
@@ -58,6 +61,7 @@ module.exports = function(grunt) {
5861 },
5962 files: {"css/bootstrap.min.css": "less/bootstrap/bootstrap.less"}
6063 },
64+ */
6165 },
6266 watch: {
6367 scripts: {
searx/static/themes/simple/gruntfile.js+1
@@ -34,6 +34,7 @@ module.exports = function(grunt) {
3434 jshint: {
3535 files: ['js/searx_src/*.js'],
3636 options: {
37+ reporterOutput: "",
3738 proto: true,
3839 // options here to override JSHint defaults
3940 globals: {