From a1655c92acf31ec044b6acb6e67fc61404ddb542 Mon Sep 17 00:00:00 2001 From: relikd Date: Thu, 1 Oct 2020 13:13:49 +0200 Subject: [PATCH] Make include local & remote-build --- Makefile | 19 ++++++++++++++----- src/main.py | 6 +++--- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 477bcda..4be64ef 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,14 @@ help: @echo '' @echo 'Commands available:' - @echo ' pull: get newest changes from server (data/ dir only)' - @echo ' push: overwrite source files on server (excl. data/ dir)' - @echo ' push-list: replace custom lists like "Messengers", etc.' + @echo ' pull: get newest changes from server (data/ dir only)' + @echo ' push: overwrite source files on server (excl. data/ dir)' + @echo ' push-list: replace custom lists like "Messengers", etc.' + @echo ' remote-build: force-rebuild all remote files (index & html)' + @echo ' local: force-rebuild all local files (index & html)' + @echo '' + @echo 'Usage:' + @echo ' make push remote-build SSH=your_ssh_key' @echo '' check_defined_ssh = \ $(if $(value SSH),, \ @@ -13,9 +18,13 @@ pull: rsync -ralptv --delete -e ssh $(SSH):/var/www/de-appchk/data/ "data/" push: @:$(call check_defined_ssh,push) - # --dry-run rsync -rlptv --delete --exclude=.DS_Store --exclude=.git/ "." --exclude=/{data/,src/{__pycache__,lists}/,error.log} --include=/out/static/ --exclude=/out/* $(SSH):/var/www/de-appchk/ - # && ssh ma chown -R www-data:www-data /var/www/de-appchk + @# --dry-run && ssh $(SSH) chown -R www-data:www-data /var/www/de-appchk push-list: @:$(call check_defined_ssh,push-list) rsync -rlptv --delete --exclude=.DS_Store --exclude=.git/ "data/_lists/" $(SSH):/var/www/de-appchk/data/_lists/ +remote-build: + @:$(call check_defined_ssh,remote-build) + ssh $(SSH) /var/www/de-appchk/src/main.py run '*' +local: + src/main.py run '*' diff --git a/src/main.py b/src/main.py index 9f35fad..9b14a8c 100755 --- a/src/main.py +++ b/src/main.py @@ -31,7 +31,7 @@ def print_usage_and_exit(): exit(0) -def rebuild_html(bundle_ids=None, cat_ids=None, inclIApp=True, inclRoot=False): +def rebuild_html(bundle_ids=None, cat_ids=None, inclIApp=True): # all of these must happen after index_app_names if bundle_ids: html_bundle.process(bundle_ids) # after index_rank @@ -42,7 +42,7 @@ def rebuild_html(bundle_ids=None, cat_ids=None, inclIApp=True, inclRoot=False): print('no new bundle, not rebuilding index') html_ranking.process() # after html_categories & html_index_apps app_count, dom_count = html_index_domains.process() # after index_domains - html_root.process(app_count, dom_count, inclStatic=inclRoot) + html_root.process(app_count, dom_count, inclStatic=True) def del_id(bundle_ids): @@ -133,7 +133,7 @@ try: index_categories.process(['*'], force=True) index_rank.process(['*']) index_domains.process(['*']) - rebuild_html(inclRoot=True) + rebuild_html() elif cmd == 'run': if len(params) == 0: print_usage_and_exit()