def instances_exec_all_cmd(args): remote_cmd = args['remote_cmd'] if not are_you_sure(f'exec command {remote_cmd} in all instances', args): return print("Running '{}' on all instances".format(' '.join(remote_cmd))) exec_remote_all(pick_instances(args), remote_cmd)
def instances_exec_all(cfg: Config, remote_cmd: Sequence[str]): """Execute REMOTE_CMD on all the instances.""" escaped = shlex.join(remote_cmd) if not are_you_sure(f'exec command {escaped} in all instances', cfg): return print("Running '{}' on all instances".format(escaped)) exec_remote_all(pick_instances(cfg), remote_cmd)
def instances_stop(cfg: Config): """Stop the instances.""" if cfg.env == Environment.PROD: print('Operation aborted. This would bring down the site') print( 'If you know what you are doing, edit the code in bin/lib/ce.py, function instances_stop_cmd' ) elif are_you_sure('stop all instances', cfg): exec_remote_all(pick_instances(cfg), ['sudo', 'systemctl', 'stop', 'compiler-explorer'])
def instances_stop_cmd(args): if not are_you_sure('stop', args): return exec_remote_all(pick_instances(args), ['sudo', 'systemctl', 'stop', 'compiler-explorer'])
def instances_start_cmd(args): print("Starting version {}".format(describe_current_release(args))) exec_remote_all(pick_instances(args), ['sudo', 'systemctl', 'start', 'compiler-explorer'])
def instances_exec_all_cmd(args): if not are_you_sure('exec all', args): return remote_cmd = args['remote_cmd'] print("Running '{}' on all instances".format(' '.join(remote_cmd))) exec_remote_all(pick_instances(args), remote_cmd)
def instances_start(cfg: Config): """Start up the instances.""" print("Starting version %s", describe_current_release(cfg)) exec_remote_all(pick_instances(cfg), ['sudo', 'systemctl', 'start', 'compiler-explorer'])