mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 14:02:15 +00:00
add noninteractive option
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -19,3 +19,4 @@ venv
|
|||||||
|
|
||||||
|
|
||||||
/pnpm-lock.yaml
|
/pnpm-lock.yaml
|
||||||
|
/deploy-all.sh
|
||||||
|
|||||||
@@ -46,6 +46,9 @@ def common_options(func):
|
|||||||
func = click.argument('hostname')(func)
|
func = click.argument('hostname')(func)
|
||||||
func = click.option('--port', type=int, help='SSH port (if not in .ssh/config)')(func)
|
func = click.option('--port', type=int, help='SSH port (if not in .ssh/config)')(func)
|
||||||
func = click.option('--user', help='SSH user (if not in .ssh/config)')(func)
|
func = click.option('--user', help='SSH user (if not in .ssh/config)')(func)
|
||||||
|
func = click.option('-y', '--noninteractive', is_flag=True, help='Skip confirmation questions')(
|
||||||
|
func
|
||||||
|
)
|
||||||
return func
|
return func
|
||||||
|
|
||||||
|
|
||||||
@@ -56,8 +59,8 @@ def cli():
|
|||||||
|
|
||||||
@cli.command()
|
@cli.command()
|
||||||
@common_options
|
@common_options
|
||||||
def http_host_static(hostname, user, port):
|
def http_host_static(hostname, user, port, noninteractive):
|
||||||
if not click.confirm(f'Run script on {hostname}?'):
|
if not noninteractive and click.confirm(f'Run script on {hostname}?'):
|
||||||
return
|
return
|
||||||
|
|
||||||
c = get_connection(hostname, user, port)
|
c = get_connection(hostname, user, port)
|
||||||
@@ -72,8 +75,8 @@ def http_host_static(hostname, user, port):
|
|||||||
|
|
||||||
@cli.command()
|
@cli.command()
|
||||||
@common_options
|
@common_options
|
||||||
def http_host_autoupdate(hostname, user, port):
|
def http_host_autoupdate(hostname, user, port, noninteractive):
|
||||||
if not click.confirm(f'Run script on {hostname}?'):
|
if not noninteractive and click.confirm(f'Run script on {hostname}?'):
|
||||||
return
|
return
|
||||||
|
|
||||||
c = get_connection(hostname, user, port)
|
c = get_connection(hostname, user, port)
|
||||||
@@ -93,8 +96,8 @@ def http_host_autoupdate(hostname, user, port):
|
|||||||
@cli.command()
|
@cli.command()
|
||||||
@common_options
|
@common_options
|
||||||
@click.option('--cron', is_flag=True, help='Enable cron task')
|
@click.option('--cron', is_flag=True, help='Enable cron task')
|
||||||
def tile_gen(hostname, user, port, cron):
|
def tile_gen(hostname, user, port, cron, noninteractive):
|
||||||
if not click.confirm(f'Run script on {hostname}?'):
|
if not noninteractive and click.confirm(f'Run script on {hostname}?'):
|
||||||
return
|
return
|
||||||
|
|
||||||
c = get_connection(hostname, user, port)
|
c = get_connection(hostname, user, port)
|
||||||
@@ -105,8 +108,8 @@ def tile_gen(hostname, user, port, cron):
|
|||||||
|
|
||||||
@cli.command()
|
@cli.command()
|
||||||
@common_options
|
@common_options
|
||||||
def ledns(hostname, user, port):
|
def ledns(hostname, user, port, noninteractive):
|
||||||
if not click.confirm(f'Run script on {hostname}?'):
|
if not noninteractive and click.confirm(f'Run script on {hostname}?'):
|
||||||
return
|
return
|
||||||
|
|
||||||
c = get_connection(hostname, user, port)
|
c = get_connection(hostname, user, port)
|
||||||
@@ -116,8 +119,8 @@ def ledns(hostname, user, port):
|
|||||||
|
|
||||||
@cli.command()
|
@cli.command()
|
||||||
@common_options
|
@common_options
|
||||||
def loadbalancer(hostname, user, port):
|
def loadbalancer(hostname, user, port, noninteractive):
|
||||||
if not click.confirm(f'Run script on {hostname}?'):
|
if not noninteractive and click.confirm(f'Run script on {hostname}?'):
|
||||||
return
|
return
|
||||||
|
|
||||||
c = get_connection(hostname, user, port)
|
c = get_connection(hostname, user, port)
|
||||||
@@ -128,7 +131,7 @@ def loadbalancer(hostname, user, port):
|
|||||||
|
|
||||||
@cli.command()
|
@cli.command()
|
||||||
@common_options
|
@common_options
|
||||||
def debug(hostname, user, port):
|
def debug(hostname, user, port, noninteractive):
|
||||||
c = get_connection(hostname, user, port)
|
c = get_connection(hostname, user, port)
|
||||||
|
|
||||||
upload_config_json(c)
|
upload_config_json(c)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ def auto_mount():
|
|||||||
if not config.runs_dir.exists():
|
if not config.runs_dir.exists():
|
||||||
sys.exit(' download-btrfs needs to be run first')
|
sys.exit(' download-btrfs needs to be run first')
|
||||||
|
|
||||||
clean_up_mounts(config.mnt_dir)
|
# clean_up_mounts(config.mnt_dir) # disabling, as it can be in use before the nginx sync works
|
||||||
create_fstab()
|
create_fstab()
|
||||||
|
|
||||||
print(' running mount -a')
|
print(' running mount -a')
|
||||||
|
|||||||
@@ -3,7 +3,10 @@ CMD="sudo /data/ofm/venv/bin/python -u /data/ofm/tile_gen/bin/tile_gen.py"
|
|||||||
LOG_DIR=/data/ofm/tile_gen/logs
|
LOG_DIR=/data/ofm/tile_gen/logs
|
||||||
|
|
||||||
# every day at 2:10, make a monaco run
|
# every day at 2:10, make a monaco run
|
||||||
10 2 * * * ofm $CMD make-tiles monaco --upload >> $LOG_DIR/monaco-make-tiles.log 2>&1
|
#10 2 * * * ofm $CMD make-tiles monaco --upload >> $LOG_DIR/monaco-make-tiles.log 2>&1
|
||||||
|
|
||||||
|
# debug every 15 minutes
|
||||||
|
*/15 * * * * ofm $CMD make-tiles monaco --upload >> $LOG_DIR/monaco-make-tiles.log 2>&1
|
||||||
|
|
||||||
# every minute, set monaco to latest
|
# every minute, set monaco to latest
|
||||||
* * * * * ofm $CMD set-version monaco >> $LOG_DIR/monaco-set-version.log 2>&1
|
* * * * * ofm $CMD set-version monaco >> $LOG_DIR/monaco-set-version.log 2>&1
|
||||||
|
|||||||
Reference in New Issue
Block a user