Make include local & remote-build

This commit is contained in:
relikd
2020-10-01 13:13:49 +02:00
parent cb46520949
commit a1655c92ac
2 changed files with 17 additions and 8 deletions

View File

@@ -4,6 +4,11 @@ help:
@echo ' pull: get newest changes from server (data/ dir only)' @echo ' pull: get newest changes from server (data/ dir only)'
@echo ' push: overwrite source files on server (excl. data/ dir)' @echo ' push: overwrite source files on server (excl. data/ dir)'
@echo ' push-list: replace custom lists like "Messengers", etc.' @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 '' @echo ''
check_defined_ssh = \ check_defined_ssh = \
$(if $(value SSH),, \ $(if $(value SSH),, \
@@ -13,9 +18,13 @@ pull:
rsync -ralptv --delete -e ssh $(SSH):/var/www/de-appchk/data/ "data/" rsync -ralptv --delete -e ssh $(SSH):/var/www/de-appchk/data/ "data/"
push: push:
@:$(call check_defined_ssh,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/ 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: push-list:
@:$(call check_defined_ssh,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/ 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 '*'

View File

@@ -31,7 +31,7 @@ def print_usage_and_exit():
exit(0) 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 # all of these must happen after index_app_names
if bundle_ids: if bundle_ids:
html_bundle.process(bundle_ids) # after index_rank 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') print('no new bundle, not rebuilding index')
html_ranking.process() # after html_categories & html_index_apps html_ranking.process() # after html_categories & html_index_apps
app_count, dom_count = html_index_domains.process() # after index_domains 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): def del_id(bundle_ids):
@@ -133,7 +133,7 @@ try:
index_categories.process(['*'], force=True) index_categories.process(['*'], force=True)
index_rank.process(['*']) index_rank.process(['*'])
index_domains.process(['*']) index_domains.process(['*'])
rebuild_html(inclRoot=True) rebuild_html()
elif cmd == 'run': elif cmd == 'run':
if len(params) == 0: if len(params) == 0:
print_usage_and_exit() print_usage_and_exit()