From e75af78d7aacdd545825ebb2aee902276e9d55a6 Mon Sep 17 00:00:00 2001 From: Natal Ngétal Date: Wed, 5 Dec 2018 18:52:36 +0100 Subject: [Scripts] Force upgrade requirements. Force the upgrade of requirements with pip. At the moment, if the version in the requirement file is changed, there will be no effect, because the dependencies is already present. --- manage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'manage.sh') diff --git a/manage.sh b/manage.sh index a352ccc6e..20d2cba3d 100755 --- a/manage.sh +++ b/manage.sh @@ -18,12 +18,12 @@ ACTION="$1" update_packages() { pip install --upgrade pip pip install --upgrade setuptools - pip install -r "$BASE_DIR/requirements.txt" + pip install -Ur "$BASE_DIR/requirements.txt" } update_dev_packages() { update_packages - pip install -r "$BASE_DIR/requirements-dev.txt" + pip install -Ur "$BASE_DIR/requirements-dev.txt" } install_geckodriver() { -- cgit v1.2.3-54-g00ecf From 757ebb5d9fdc24757f199e52575f32f6faf091b3 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Wed, 25 Mar 2020 14:09:47 +0100 Subject: [fix] brands: add variables from build env to grunt process We have some variables in the build environment which are also needed in the grunt process when building themes. Theses variables are relavant if one creates a fork with its own branding. We treat these variables under the term 'brands'. Signed-off-by: Markus Heiser --- Makefile | 15 +++++++++++++++ docs/dev/quickstart.rst | 6 +++--- manage.sh | 10 ---------- searx/static/themes/oscar/gruntfile.js | 4 +--- searx/static/themes/simple/gruntfile.js | 6 +++--- 5 files changed, 22 insertions(+), 19 deletions(-) (limited to 'manage.sh') diff --git a/Makefile b/Makefile index 3b2d499e8..4914a309e 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,7 @@ help: @echo ' gh-pages - build docs & deploy on gh-pages branch' @echo ' clean - drop builds and environments' @echo ' project - re-build generic files of the searx project' + @echo ' themes - re-build build the source of the themes' @echo '' @$(MAKE) -s -f utils/makefile.include make-help @echo '' @@ -87,6 +88,20 @@ searx.brand: $(Q)echo "DOCS_URL = '$(DOCS_URL)'" >> searx/brand.py $(Q)echo "PUBLIC_INSTANCES = 'https://searx.space'" >> searx/brand.py +# build themes +# ------------ + +PHONY += themes themes.oscar themes.simple +themes: themes.oscar themes.simple + +themes.oscar: + $(Q)echo '[!] Grunt build : oscar theme' + $(Q)grunt --gruntfile "searx/static/themes/oscar/gruntfile.js" + +themes.simple: + $(Q)echo '[!] Grunt build : simple theme' + $(Q)grunt --gruntfile "searx/static/themes/simple/gruntfile.js" + # test # ---- diff --git a/docs/dev/quickstart.rst b/docs/dev/quickstart.rst index e40772b3b..cb079a753 100644 --- a/docs/dev/quickstart.rst +++ b/docs/dev/quickstart.rst @@ -87,8 +87,8 @@ After satisfying the requirements styles can be build using ``manage.sh`` ./manage.sh styles -How to build the source of the oscar theme -========================================== +How to build the source of the themes +===================================== .. _grunt: https://gruntjs.com/ @@ -104,7 +104,7 @@ After installing grunt, the files can be built using the following command: .. code:: sh - ./manage.sh grunt_build + make themes Tips for debugging/development diff --git a/manage.sh b/manage.sh index 496a522ba..0551f02d3 100755 --- a/manage.sh +++ b/manage.sh @@ -156,15 +156,6 @@ styles() { build_style less/bootstrap/bootstrap.less css/bootstrap.min.css } -grunt_build() { - npm_path_setup - - echo '[!] Grunt build : oscar theme' - grunt --gruntfile "$SEARX_DIR/static/themes/oscar/gruntfile.js" - echo '[!] Grunt build : simple theme' - grunt --gruntfile "$SEARX_DIR/static/themes/simple/gruntfile.js" -} - docker_build() { # Check if it is a git repository if [ ! -d .git ]; then @@ -257,7 +248,6 @@ Commands ----- locales - Compile locales styles - Build less files - grunt_build - Build files for themes docker_build - Build Docker image Tests diff --git a/searx/static/themes/oscar/gruntfile.js b/searx/static/themes/oscar/gruntfile.js index def035dba..606b6bcfb 100644 --- a/searx/static/themes/oscar/gruntfile.js +++ b/searx/static/themes/oscar/gruntfile.js @@ -13,7 +13,7 @@ module.exports = function(grunt) { }, uglify: { options: { - banner: '/*! oscar/searx.min.js | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n' + banner: '/*! oscar/searx.min.js | <%= grunt.template.today("dd-mm-yyyy") %> | <%= process.env.GIT_URL %> */\n' }, dist: { files: { @@ -38,7 +38,6 @@ module.exports = function(grunt) { development: { options: { paths: ["less/pointhi", "less/logicodev", "less/logicodev-dark"] - //banner: '/*! less/oscar/oscar.css | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n' }, files: {"css/pointhi.css": "less/pointhi/oscar.less", "css/logicodev.css": "less/logicodev-dark/oscar.less", @@ -47,7 +46,6 @@ module.exports = function(grunt) { production: { options: { paths: ["less/pointhi", "less/logicodev", "less/logicodev-dark"], - //banner: '/*! less/oscar/oscar.css | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n', cleancss: true }, files: {"css/pointhi.min.css": "less/pointhi/oscar.less", diff --git a/searx/static/themes/simple/gruntfile.js b/searx/static/themes/simple/gruntfile.js index c372ec730..c8f2ed3c6 100644 --- a/searx/static/themes/simple/gruntfile.js +++ b/searx/static/themes/simple/gruntfile.js @@ -36,7 +36,7 @@ module.exports = function(grunt) { }, uglify: { options: { - banner: '/*! simple/searx.min.js | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n', + banner: '/*! simple/searx.min.js | <%= grunt.template.today("dd-mm-yyyy") %> | <%= process.env.GIT_URL %> */\n', output: { comments: 'some' }, @@ -57,7 +57,7 @@ module.exports = function(grunt) { development: { options: { paths: ["less"], - banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n' + banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | <%= process.env.GIT_URL %> */\n' }, files: { "css/searx.css": "less/style.less", @@ -73,7 +73,7 @@ module.exports = function(grunt) { compatibility: '*' }) ], - banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n' + banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | <%= process.env.GIT_URL %> */\n' }, files: { "css/searx.min.css": "less/style.less", -- cgit v1.2.3-54-g00ecf From 3dbade0aed048e6001f2ed0f261c7d26f04768ba Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Wed, 25 Mar 2020 14:50:39 +0100 Subject: [fix] brands: add GIT_URL variable to the docker build Signed-off-by: Markus Heiser --- Dockerfile | 3 ++- Makefile | 9 +++++++++ manage.sh | 5 ++--- 3 files changed, 13 insertions(+), 4 deletions(-) (limited to 'manage.sh') diff --git a/Dockerfile b/Dockerfile index 9885fb794..700a21ffc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,7 @@ EXPOSE 8080 VOLUME /etc/searx VOLUME /var/log/uwsgi +ARG GIT_URL=unknown ARG VERSION_GITCOMMIT=unknown ARG SEARX_GIT_VERSION=unknown @@ -66,7 +67,7 @@ RUN su searx -c "/usr/bin/python3 -m compileall -q searx"; \ # Keep this argument at the end since it change each time ARG LABEL_DATE= -LABEL maintainer="searx " \ +LABEL maintainer="searx <${GIT_URL}>" \ description="A privacy-respecting, hackable metasearch engine." \ version="${SEARX_GIT_VERSION}" \ org.label-schema.schema-version="1.0" \ diff --git a/Makefile b/Makefile index 4914a309e..f81b4e1de 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,7 @@ help: @echo ' clean - drop builds and environments' @echo ' project - re-build generic files of the searx project' @echo ' themes - re-build build the source of the themes' + @echo ' docker - build Docker image' @echo '' @$(MAKE) -s -f utils/makefile.include make-help @echo '' @@ -102,6 +103,14 @@ themes.simple: $(Q)echo '[!] Grunt build : simple theme' $(Q)grunt --gruntfile "searx/static/themes/simple/gruntfile.js" +# docker +# ------ + +PHONY += docker +docker: + $(Q)./manage.sh docker_build + + # test # ---- diff --git a/manage.sh b/manage.sh index 0551f02d3..bb3fe8831 100755 --- a/manage.sh +++ b/manage.sh @@ -202,13 +202,13 @@ docker_build() { fi # define the docker image name - # /!\ HACK to get the user name /!\ - GITHUB_USER=$(git remote get-url origin | sed 's/.*github\.com\/\([^\/]*\).*/\1/') + GITHUB_USER=$(echo "${GIT_URL}" | sed 's/.*github\.com\/\([^\/]*\).*/\1/') SEARX_IMAGE_NAME="${GITHUB_USER:-searx}/searx" # build Docker image echo "Building image ${SEARX_IMAGE_NAME}:${SEARX_GIT_VERSION}" sudo docker build \ + --build-arg GIT_URL="${GIT_URL}" \ --build-arg SEARX_GIT_VERSION="${SEARX_GIT_VERSION}" \ --build-arg VERSION_GITCOMMIT="${VERSION_GITCOMMIT}" \ --build-arg LABEL_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ @@ -248,7 +248,6 @@ Commands ----- locales - Compile locales styles - Build less files - docker_build - Build Docker image Tests ----- -- cgit v1.2.3-54-g00ecf From 2d12f221a7afbbbaedfb27c5705efd8b94ad6a81 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Wed, 25 Mar 2020 15:17:11 +0100 Subject: [fix] docker build: set build argument LABEL_VCS_URL to GIT_URL Signed-off-by: Markus Heiser --- manage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manage.sh') diff --git a/manage.sh b/manage.sh index bb3fe8831..4c11576a3 100755 --- a/manage.sh +++ b/manage.sh @@ -213,7 +213,7 @@ docker_build() { --build-arg VERSION_GITCOMMIT="${VERSION_GITCOMMIT}" \ --build-arg LABEL_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ --build-arg LABEL_VCS_REF=$(git rev-parse HEAD) \ - --build-arg LABEL_VCS_URL=$(git remote get-url origin) \ + --build-arg LABEL_VCS_URL="${GIT_URL}" \ --build-arg TIMESTAMP_SETTINGS=$(git log -1 --format="%cd" --date=unix -- searx/settings.yml) \ --build-arg TIMESTAMP_UWSGI=$(git log -1 --format="%cd" --date=unix -- dockerfiles/uwsgi.ini) \ -t ${SEARX_IMAGE_NAME}:latest -t ${SEARX_IMAGE_NAME}:${SEARX_GIT_VERSION} . -- cgit v1.2.3-54-g00ecf From 00251d7c66e60dc9859bf6368ab68d545660b90e Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Thu, 26 Mar 2020 13:32:08 +0100 Subject: Makefile: add target 'useragents.update' to fetch versions of Firefox Update searx/data/useragents.json with the most recent versions of Firefox. BTW: add 'useragents.update' to 'project' target and clean up the Makefile and remove it from the manage.sh script. Signed-off-by: Markus Heiser closes: https://github.com/asciimoo/searx/issues/1882 --- Makefile | 19 +++++++++++++------ manage.sh | 6 ------ 2 files changed, 13 insertions(+), 12 deletions(-) (limited to 'manage.sh') diff --git a/Makefile b/Makefile index 2bea06c9d..89e83dc59 100644 --- a/Makefile +++ b/Makefile @@ -74,14 +74,21 @@ $(GH_PAGES):: # update project files # -------------------- -PHONY += project engines-languages searx.brand +PHONY += project engines.languages searx.brand useragents.update -project: searx/data/engines_languages.json searx.brand +project: useragents.update engines.languages searx.brand -engines-languages: pyenvinstall - $(PY_ENV_ACT); python utils/fetch_languages.py - mv engines_languages.json searx/data/engines_languages.json - mv languages.py searx/languages.py +engines.languages: pyenvinstall + $(Q)echo "fetch languages .." + $(Q)$(PY_ENV_ACT); python utils/fetch_languages.py + $(Q)echo "update searx/data/engines_languages.json" + $(Q)mv engines_languages.json searx/data/engines_languages.json + $(Q)echo "update searx/languages.py" + $(Q)mv languages.py searx/languages.py + +useragents.update: pyenvinstall + $(Q)echo "Update searx/data/useragents.json with the most recent versions of Firefox." + $(Q)$(PY_ENV_ACT); python utils/fetch_firefox_version.py searx.brand: $(Q)echo "build searx/brand.py" diff --git a/manage.sh b/manage.sh index 4c11576a3..5c9b332aa 100755 --- a/manage.sh +++ b/manage.sh @@ -70,11 +70,6 @@ locales() { pybabel compile -d "$SEARX_DIR/translations" } -update_useragents() { - echo '[!] Updating user agent versions' - python utils/fetch_firefox_version.py -} - pep8_check() { echo '[!] Running pep8 check' # ignored rules: @@ -242,7 +237,6 @@ Commands update_dev_packages - Check & update development and production dependency changes install_geckodriver - Download & install geckodriver if not already installed (required for robot_tests) npm_packages - Download & install npm dependencies - update_useragents - Update useragents.json with the most recent versions of Firefox Build ----- -- cgit v1.2.3-54-g00ecf From e7fbefa8bdecca04824b3ef744786d8bb45c35fe Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Thu, 26 Mar 2020 18:00:07 +0100 Subject: build: move build styles from manage.sh to Makefile To build all styles use: make styles To build individual styles use one of: make style.legacy make style.courgette make style.pixart make style.bootstrap Signed-off-by: Markus Heiser --- Makefile | 25 +++++++++++++++++++++++++ manage.sh | 22 ---------------------- 2 files changed, 25 insertions(+), 22 deletions(-) (limited to 'manage.sh') diff --git a/Makefile b/Makefile index 89e83dc59..8b760093b 100644 --- a/Makefile +++ b/Makefile @@ -128,6 +128,31 @@ themes.simple: $(Q)echo '[!] Grunt build : simple theme' $(Q)PATH="$$(npm bin):$$PATH" grunt --gruntfile "searx/static/themes/simple/gruntfile.js" +# build styles +# ------------ + +PHONY += styles style.legacy style.courgette style.pixart style.bootstrap +styles: style.legacy style.courgette style.pixart style.bootstrap + +quiet_cmd_lessc = STYLE $3 + cmd_lessc = PATH="$$(npm bin):$$PATH" \ + lessc --clean-css="--s1 --advanced --compatibility=ie9" "searx/static/$2" "searx/static/$3" + +style.legacy: + $(call cmd,lessc,themes/legacy/less/style-rtl.less,themes/legacy/css/style-rtl.css) + $(call cmd,lessc,themes/legacy/less/style.less,themes/legacy/css/style.css) + +style.courgette: + $(call cmd,lessc,themes/courgette/less/style.less,themes/courgette/css/style.css) + $(call cmd,lessc,themes/courgette/less/style-rtl.less,themes/courgette/css/style-rtl.css) + +style.pixart: + $(call cmd,lessc,themes/pix-art/less/style.less,themes/pix-art/css/style.css) + +style.bootstrap: + $(call cmd,lessc,less/bootstrap/bootstrap.less,css/bootstrap.min.css) + + # docker # ------ diff --git a/manage.sh b/manage.sh index 5c9b332aa..4f46fd6d7 100755 --- a/manage.sh +++ b/manage.sh @@ -130,27 +130,6 @@ npm_packages() { npm install } -build_style() { - npm_path_setup - - lessc --clean-css="--s1 --advanced --compatibility=ie9" "$BASE_DIR/searx/static/$1" "$BASE_DIR/searx/static/$2" -} - -styles() { - npm_path_setup - - echo '[!] Building legacy style' - build_style themes/legacy/less/style.less themes/legacy/css/style.css - build_style themes/legacy/less/style-rtl.less themes/legacy/css/style-rtl.css - echo '[!] Building courgette style' - 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 - echo '[!] Building pix-art style' - build_style themes/pix-art/less/style.less themes/pix-art/css/style.css - echo '[!] Building bootstrap style' - build_style less/bootstrap/bootstrap.less css/bootstrap.min.css -} - docker_build() { # Check if it is a git repository if [ ! -d .git ]; then @@ -241,7 +220,6 @@ Commands Build ----- locales - Compile locales - styles - Build less files Tests ----- -- cgit v1.2.3-54-g00ecf From 1075f58a722fad7801a7b8397cd7e6de31d99da2 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Thu, 26 Mar 2020 18:41:45 +0100 Subject: test: move tests from manage.sh to Makefile Signed-off-by: Markus Heiser --- Makefile | 47 ++++++++++++++++++++++++++++++++++++----------- manage.sh | 42 ------------------------------------------ 2 files changed, 36 insertions(+), 53 deletions(-) (limited to 'manage.sh') diff --git a/Makefile b/Makefile index 8b760093b..fe65acade 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ PHONY += uninstall uninstall: pyenvuninstall PHONY += clean -clean: pyclean node.clean +clean: pyclean node.clean test.clean $(call cmd,common_clean) PHONY += run @@ -160,27 +160,52 @@ PHONY += docker docker: $(Q)./manage.sh docker_build +# gecko +# ----- + +PHONY += gecko.driver +gecko.driver: + $(PY_ENV_ACT); ./manage.sh install_geckodriver # test # ---- -PHONY += test test.pylint test.pep8 test.unit test.robot +PHONY += test test.pylint test.pep8 test.unit test.coverage test.robot -test: test.pylint test.pep8 test.unit test.robot +test: test.pylint test.pep8 test.unit gecko.driver test.robot # TODO: balance linting with pylint test.pylint: pyenvinstall - $(call cmd,pylint,searx/preferences.py) - $(call cmd,pylint,searx/testing.py) + $(call cmd,pylint,\ + searx/preferences.py \ + searx/testing.py \ + ) + +# ignored rules: +# E402 module level import not at top of file +# W503 line break before binary operator test.pep8: pyenvinstall - $(PY_ENV_ACT); ./manage.sh pep8_check + @echo "TEST pep8" + $(Q)$(PY_ENV_ACT); pep8 --exclude=searx/static --max-line-length=120 --ignore "E402,W503" searx tests test.unit: pyenvinstall - $(PY_ENV_ACT); ./manage.sh unit_tests - -test.robot: pyenvinstall - $(PY_ENV_ACT); ./manage.sh install_geckodriver - $(PY_ENV_ACT); ./manage.sh robot_tests + @echo "TEST tests/unit" + $(Q)$(PY_ENV_ACT); python -m nose2 -s tests/unit + +test.coverage: pyenvinstall + @echo "TEST unit test coverage" + $(Q)$(PY_ENV_ACT); \ + python -m nose2 -C --log-capture --with-coverage --coverage searx -s tests/unit \ + && coverage report \ + && coverage html \ + +test.robot: pyenvinstall gecko.driver + @echo "TEST robot" + $(Q)$(PY_ENV_ACT); PYTHONPATH=. python searx/testing.py robot + +test.clean: + @echo "CLEAN intermediate test stuff" + $(Q)rm -rf geckodriver.log .coverage coverage/ .PHONY: $(PHONY) diff --git a/manage.sh b/manage.sh index 4f46fd6d7..6667274b1 100755 --- a/manage.sh +++ b/manage.sh @@ -70,40 +70,6 @@ locales() { pybabel compile -d "$SEARX_DIR/translations" } -pep8_check() { - echo '[!] Running pep8 check' - # ignored rules: - # E402 module level import not at top of file - # W503 line break before binary operator - pep8 --exclude=searx/static --max-line-length=120 --ignore "E402,W503" "$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 --log-capture --with-coverage --coverage "$SEARX_DIR" -s "$BASE_DIR/tests/unit" \ - && coverage report \ - && coverage html -} - -robot_tests() { - echo '[!] Running robot tests' - PYTHONPATH="`pwd`" python "$SEARX_DIR/testing.py" robot -} - -tests() { - set -e - pep8_check - unit_tests - install_geckodriver - robot_tests - set +e -} - # # Web @@ -220,14 +186,6 @@ Commands Build ----- locales - Compile locales - - Tests - ----- - unit_tests - Run unit tests - pep8_check - Pep8 validation - robot_tests - Run selenium tests - tests - Run all python tests (pep8, unit, robot_tests) - py_test_coverage - Unit test coverage " } -- cgit v1.2.3-54-g00ecf From 442b27ac1b1f54669fbb9785d780327f62814431 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sun, 29 Mar 2020 11:41:59 +0200 Subject: bash: use build environment from Makefile To Makefile target brand, add creation of bash environment in:: utils/brand.env In bash scripts (manage.sh) source env by:: . utils/brand.env manage.sh help: show GIT_URL and more environment Signed-off-by: Markus Heiser --- Makefile | 7 +++++++ manage.sh | 8 ++++++++ utils/brand.env | 5 +++++ 3 files changed, 20 insertions(+) create mode 100644 utils/brand.env (limited to 'manage.sh') diff --git a/Makefile b/Makefile index 5b890374e..d09e92828 100644 --- a/Makefile +++ b/Makefile @@ -97,6 +97,13 @@ searx.brand: $(Q)echo "SEARX_URL = '$(SEARX_URL)'" >> searx/brand.py $(Q)echo "DOCS_URL = '$(DOCS_URL)'" >> searx/brand.py $(Q)echo "PUBLIC_INSTANCES = 'https://searx.space'" >> searx/brand.py + $(Q)echo "build utils/brand.env" + $(Q)echo "export GIT_URL='$(GIT_URL)'" > utils/brand.env + $(Q)echo "export ISSUE_URL='https://github.com/asciimoo/searx/issues'" >> utils/brand.env + $(Q)echo "export SEARX_URL='$(SEARX_URL)'" >> utils/brand.env + $(Q)echo "export DOCS_URL='$(DOCS_URL)'" >> utils/brand.env + $(Q)echo "export PUBLIC_INSTANCES='https://searx.space'" >> utils/brand.env + # node / npm # ---------- diff --git a/manage.sh b/manage.sh index 6667274b1..4831fc1fa 100755 --- a/manage.sh +++ b/manage.sh @@ -10,6 +10,7 @@ PYTHONPATH="$BASE_DIR" SEARX_DIR="$BASE_DIR/searx" ACTION="$1" +. "${BASE_DIR}/utils/brand.env" # # Python @@ -186,6 +187,13 @@ Commands Build ----- locales - Compile locales + +Environment: + GIT_URL: ${GIT_URL} + ISSUE_URL: ${ISSUE_URL} + SEARX_URL: ${SEARX_URL} + DOCS_URL: ${DOCS_URL} + PUBLIC_INSTANCES: ${PUBLIC_INSTANCES} " } diff --git a/utils/brand.env b/utils/brand.env new file mode 100644 index 000000000..7fe1a3911 --- /dev/null +++ b/utils/brand.env @@ -0,0 +1,5 @@ +export GIT_URL='https://github.com/asciimoo/searx' +export ISSUE_URL='https://github.com/asciimoo/searx/issues' +export SEARX_URL='https://searx.me' +export DOCS_URL='https://asciimoo.github.io/searx' +export PUBLIC_INSTANCES='https://searx.space' -- cgit v1.2.3-54-g00ecf From 4dad3661461659dd39f88795f461fc19ac9c1fb5 Mon Sep 17 00:00:00 2001 From: Dalf Date: Thu, 2 Apr 2020 15:06:10 +0200 Subject: [fix] travis: fix docker tag. the "-dirty" ignores the searx/brand.py and utils/brand.env files. --- manage.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'manage.sh') diff --git a/manage.sh b/manage.sh index 4831fc1fa..b2ffb638d 100755 --- a/manage.sh +++ b/manage.sh @@ -121,8 +121,9 @@ docker_build() { SEARX_GIT_VERSION=$(git describe --match "v[0-9]*\.[0-9]*\.[0-9]*" HEAD 2>/dev/null | awk -F'-' '{OFS="-"; $1=substr($1, 2); $3=substr($3, 2); print}') # add the suffix "-dirty" if the repository has uncommited change + # /!\ HACK for searx/searx: ignore searx/brand.py and utils/brand.env git update-index -q --refresh - if [ ! -z "$(git diff-index --name-only HEAD --)" ]; then + if [ ! -z "$(git diff-index --name-only HEAD -- | grep -v 'searx/brand.py' | grep -v 'utils/brand.env')" ]; then SEARX_GIT_VERSION="${SEARX_GIT_VERSION}-dirty" fi -- cgit v1.2.3-54-g00ecf