def upload_app(config_file="./config.yaml", upload_config_path="upload_config.yaml", key_filename="./xxx..pem", user="******"): ip_tomcat = select_hosts(config_file) if ip_tomcat is None: return local_file_to_remote_dir = load_upload_config(tomcat_root_dir=ip_tomcat[1], upload_config_path=upload_config_path) if len(local_file_to_remote_dir) == 0: return if not confirm("确定上传这些文件?"): return with settings(key_filename=key_filename, user=user): execute(upload2, local_file_to_remote_dir=local_file_to_remote_dir, hosts=[ip_tomcat[0]])
def restart_tomcat(config_file="./config.yaml", key_filename="./xxx..pem", user="******"): ip_tomcat = select_hosts(config_file) if ip_tomcat is None: return with settings(key_filename=key_filename, user=user): execute(do_restart_tomcat, tomcat_root_dir=ip_tomcat[1], hosts=[ip_tomcat[0]])