From 0606cde105859d9bdb751825bf89952297b335ed Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Wed, 23 Jun 2021 12:48:31 +0200 Subject: [mod] add make targets to manage the build files in the /searx/static directory The idea is to avoid conflict when there are differents branches with changes are made on the static files. A solution is to ask the administrators to build the files from the sources, but it requires to install the npm dependencies. So the solution in this commit keep the sources and the build files in the same git repository. In one branch, the modification of the source (*.less, *.js) are commited without the built files. The built files are commited in a uniq commit, with a commit message "Static build" In case of merge or rebase, this commit can be dropped. New make targets: * static.build.commit.drop: drop the last "Static build". The command checks that there are only build files in the commit. * static.build.commit : call "make static.build.commit.drop" call "make themes.all" commit the files * static.git.restore.staged: git restore --staged * static.git.restore: git restore Related to https://github.com/searxng/searxng/issues/137 --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index cd541a9a7..ab2f6cc20 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ .DEFAULT_GOAL=help export MTOOLS=./manage +export MSTATIC=./utils/manage_static.sh include utils/makefile.include @@ -89,6 +90,12 @@ PHONY += $(MANAGE) $(MANAGE): $(Q)$(MTOOLS) $@ + +MANAGE_STATIC += static.build.commit.drop static.build.commit static.git.restore.staged static.git.restore + +$(MANAGE_STATIC): + $(Q)$(MSTATIC) $@ + # deprecated PHONY += docs docs-clean docs-live docker themes -- cgit v1.2.3 From 2cb1f350869e0c7998d3c99d7d6ba38250ab7675 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Thu, 24 Jun 2021 15:15:34 +0200 Subject: [mod] utils/manage_static.sh: add script to shellcheck - add script to shellcheck, - fix error messages from shellcheck and - moved global variables to local variables (lower case) No functional change! Signed-off-by: Markus Heiser --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ab2f6cc20..9c99aed0c 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,8 @@ test.shell: dockerfiles/docker-entrypoint.sh $(Q)shellcheck -x -s bash \ utils/brand.env \ - ./manage \ + $(MTOOLS) \ + $(MSTATIC) \ utils/lib.sh \ utils/filtron.sh \ utils/searx.sh \ @@ -67,7 +68,7 @@ test.shell: utils/lxc.sh \ utils/lxc-searx.env \ .config.sh - $(Q)./manage build_msg TEST "$@ OK" + $(Q)$(MTOOLS) build_msg TEST "$@ OK" # wrap ./manage script -- cgit v1.2.3 From 25b6309cf248a1c5c092780e98107d281999bd85 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sat, 26 Jun 2021 08:46:20 +0200 Subject: [mod] move functions from utils/manage_static.sh to ./manage script The functions: - static.build.commit - static.build.commit.drop - static.build.restore are imported into the ./manage script. To avoid name collisions some variables and fucntions has been renamed by adding the prefix *static_*. Signed-off-by: Markus Heiser --- Makefile | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 9c99aed0c..ea743dd35 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,6 @@ .DEFAULT_GOAL=help export MTOOLS=./manage -export MSTATIC=./utils/manage_static.sh include utils/makefile.include @@ -60,8 +59,8 @@ test.shell: $(Q)shellcheck -x -s bash \ utils/brand.env \ $(MTOOLS) \ - $(MSTATIC) \ utils/lib.sh \ + utils/lib_static.sh \ utils/filtron.sh \ utils/searx.sh \ utils/morty.sh \ @@ -85,6 +84,7 @@ MANAGE += pyenv pyenv.install pyenv.uninstall MANAGE += pypi.upload pypi.upload.test MANAGE += test.yamllint test.pylint test.pep8 test.unit test.coverage test.robot test.clean MANAGE += themes.all themes.oscar themes.simple pygments.less +MANAGE += static.build.commit static.build.drop static.build.restore PHONY += $(MANAGE) @@ -92,11 +92,6 @@ $(MANAGE): $(Q)$(MTOOLS) $@ -MANAGE_STATIC += static.build.commit.drop static.build.commit static.git.restore.staged static.git.restore - -$(MANAGE_STATIC): - $(Q)$(MSTATIC) $@ - # deprecated PHONY += docs docs-clean docs-live docker themes -- cgit v1.2.3