mirror of
https://github.com/searxng/searxng
synced 2024-11-18 15:26:25 +00:00
[fix] travis build : various fix about grunt builds
This commit is contained in:
parent
d0cebd6e77
commit
57dc6b625f
@ -15,10 +15,7 @@ before_install:
|
|||||||
- "sh -e /etc/init.d/xvfb start"
|
- "sh -e /etc/init.d/xvfb start"
|
||||||
- npm install less less-plugin-clean-css grunt-cli
|
- npm install less less-plugin-clean-css grunt-cli
|
||||||
- export PATH=`pwd`/node_modules/.bin:$PATH
|
- export PATH=`pwd`/node_modules/.bin:$PATH
|
||||||
- ls -l $VIRTUAL_ENV
|
- ./manage.sh grunt_packages
|
||||||
- ls -l $VIRTUAL_ENV/bin
|
|
||||||
- ( cd searx/static/themes/oscar;npm install; cd - )
|
|
||||||
- ( cd searx/static/themes/simple;npm install; cd - )
|
|
||||||
- mkdir -p ~/drivers; export PATH=~/drivers:$PATH;
|
- mkdir -p ~/drivers; export PATH=~/drivers:$PATH;
|
||||||
- GECKODRIVER_URL="https://github.com/mozilla/geckodriver/releases/download/v0.18.0/geckodriver-v0.18.0-linux64.tar.gz";
|
- GECKODRIVER_URL="https://github.com/mozilla/geckodriver/releases/download/v0.18.0/geckodriver-v0.18.0-linux64.tar.gz";
|
||||||
- FILE=`mktemp`; wget "$GECKODRIVER_URL" -qO $FILE && tar xz -C ~/drivers -f $FILE geckodriver; rm $FILE; chmod 777 ~/drivers/geckodriver;
|
- FILE=`mktemp`; wget "$GECKODRIVER_URL" -qO $FILE && tar xz -C ~/drivers -f $FILE geckodriver; rm $FILE; chmod 777 ~/drivers/geckodriver;
|
||||||
|
21
manage.sh
21
manage.sh
@ -5,6 +5,8 @@ PYTHONPATH=$BASE_DIR
|
|||||||
SEARX_DIR="$BASE_DIR/searx"
|
SEARX_DIR="$BASE_DIR/searx"
|
||||||
ACTION=$1
|
ACTION=$1
|
||||||
|
|
||||||
|
cd $BASE_DIR
|
||||||
|
|
||||||
update_packages() {
|
update_packages() {
|
||||||
pip install -r "$BASE_DIR/requirements.txt"
|
pip install -r "$BASE_DIR/requirements.txt"
|
||||||
}
|
}
|
||||||
@ -14,7 +16,7 @@ update_dev_packages() {
|
|||||||
pip install -r "$BASE_DIR/requirements-dev.txt"
|
pip install -r "$BASE_DIR/requirements-dev.txt"
|
||||||
}
|
}
|
||||||
|
|
||||||
check_geckodriver() {
|
install_geckodriver() {
|
||||||
echo '[!] Checking geckodriver'
|
echo '[!] Checking geckodriver'
|
||||||
set -e
|
set -e
|
||||||
geckodriver -V 2>1 > /dev/null || NOTFOUND=1
|
geckodriver -V 2>1 > /dev/null || NOTFOUND=1
|
||||||
@ -73,13 +75,12 @@ tests() {
|
|||||||
set -e
|
set -e
|
||||||
pep8_check
|
pep8_check
|
||||||
unit_tests
|
unit_tests
|
||||||
check_geckodriver
|
install_geckodriver
|
||||||
robot_tests
|
robot_tests
|
||||||
set +e
|
set +e
|
||||||
}
|
}
|
||||||
|
|
||||||
build_style() {
|
build_style() {
|
||||||
# lessc -x "$BASE_DIR/searx/static/$1" "$BASE_DIR/searx/static/$2"
|
|
||||||
lessc --clean-css="--s1 --advanced --compatibility=ie9" "$BASE_DIR/searx/static/$1" "$BASE_DIR/searx/static/$2"
|
lessc --clean-css="--s1 --advanced --compatibility=ie9" "$BASE_DIR/searx/static/$1" "$BASE_DIR/searx/static/$2"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,8 +98,19 @@ styles() {
|
|||||||
build_style themes/simple/less/style-rtl.less themes/simple/css/searx-rtl.min.css
|
build_style themes/simple/less/style-rtl.less themes/simple/css/searx-rtl.min.css
|
||||||
}
|
}
|
||||||
|
|
||||||
|
grunt_packages() {
|
||||||
|
echo '[!] Grunt packages: install dependencies'
|
||||||
|
cd $BASE_DIR/searx/static/themes/oscar
|
||||||
|
npm install
|
||||||
|
|
||||||
|
cd $BASE_DIR/searx/static/themes/simple
|
||||||
|
npm install
|
||||||
|
}
|
||||||
|
|
||||||
grunt_build() {
|
grunt_build() {
|
||||||
|
echo '[!] Grunt build : oscar theme'
|
||||||
grunt --gruntfile "$SEARX_DIR/static/themes/oscar/gruntfile.js"
|
grunt --gruntfile "$SEARX_DIR/static/themes/oscar/gruntfile.js"
|
||||||
|
echo '[!] Grunt build : simple theme'
|
||||||
grunt --gruntfile "$SEARX_DIR/static/themes/simple/gruntfile.js"
|
grunt --gruntfile "$SEARX_DIR/static/themes/simple/gruntfile.js"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,6 +124,7 @@ help() {
|
|||||||
|
|
||||||
Commands
|
Commands
|
||||||
========
|
========
|
||||||
|
grunt_packages - Download & install dependencies
|
||||||
grunt_build - Build js files
|
grunt_build - Build js files
|
||||||
help - This text
|
help - This text
|
||||||
locales - Compile locales
|
locales - Compile locales
|
||||||
@ -123,7 +136,7 @@ Commands
|
|||||||
unit_tests - Run unit tests
|
unit_tests - Run unit tests
|
||||||
update_dev_packages - Check & update development and production dependency changes
|
update_dev_packages - Check & update development and production dependency changes
|
||||||
update_packages - Check & update dependency changes
|
update_packages - Check & update dependency changes
|
||||||
check_geckodriver - Check & download geckodriver (required for robot_tests)
|
install_geckodriver - Download & install geckodriver if not already installed (required for robot_tests)
|
||||||
"
|
"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ module.exports = function(grunt) {
|
|||||||
jshint: {
|
jshint: {
|
||||||
files: ['gruntfile.js', 'js/searx_src/*.js'],
|
files: ['gruntfile.js', 'js/searx_src/*.js'],
|
||||||
options: {
|
options: {
|
||||||
|
reporterOutput: "",
|
||||||
// options here to override JSHint defaults
|
// options here to override JSHint defaults
|
||||||
globals: {
|
globals: {
|
||||||
jQuery: true,
|
jQuery: true,
|
||||||
@ -51,6 +52,8 @@ module.exports = function(grunt) {
|
|||||||
files: {"css/pointhi.min.css": "less/pointhi/oscar.less",
|
files: {"css/pointhi.min.css": "less/pointhi/oscar.less",
|
||||||
"css/logicodev.min.css": "less/logicodev/oscar.less"}
|
"css/logicodev.min.css": "less/logicodev/oscar.less"}
|
||||||
},
|
},
|
||||||
|
/*
|
||||||
|
// built with ./manage.sh styles
|
||||||
bootstrap: {
|
bootstrap: {
|
||||||
options: {
|
options: {
|
||||||
paths: ["less/bootstrap"],
|
paths: ["less/bootstrap"],
|
||||||
@ -58,6 +61,7 @@ module.exports = function(grunt) {
|
|||||||
},
|
},
|
||||||
files: {"css/bootstrap.min.css": "less/bootstrap/bootstrap.less"}
|
files: {"css/bootstrap.min.css": "less/bootstrap/bootstrap.less"}
|
||||||
},
|
},
|
||||||
|
*/
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
scripts: {
|
scripts: {
|
||||||
|
@ -34,6 +34,7 @@ module.exports = function(grunt) {
|
|||||||
jshint: {
|
jshint: {
|
||||||
files: ['js/searx_src/*.js'],
|
files: ['js/searx_src/*.js'],
|
||||||
options: {
|
options: {
|
||||||
|
reporterOutput: "",
|
||||||
proto: true,
|
proto: true,
|
||||||
// options here to override JSHint defaults
|
// options here to override JSHint defaults
|
||||||
globals: {
|
globals: {
|
||||||
|
Loading…
Reference in New Issue
Block a user