def refresh_running_state(): hosts_list = [ findout_instance_ips()["serversInstance"] ] fo.local("rm -rf http2/media/*") run("rm -rf /home/ubuntu/http2_loadimpact/http2/static_dev/build") print( "Proceeding with hosts_list: {0}".format(hosts_list) ) with settings(hosts=hosts_list): rsync_subdirs() rsync_resources() # grunt() collect_static() # The one below also happens to trigger a restart of the services... config_supervisord()
def complete_remote_deploy(): hosts_list = [ findout_instance_ips()["serversInstance"] ] print( "Proceeding with hosts_list: {0}".format(hosts_list) ) with settings(hosts=hosts_list): install_node() install_postgresql() create_empty_directories() # <-- Logging information for example install_ruby_pieces() rsync_resources() run_preliminary_script() install_global_python_packages() install_nginx() install_grunt() grunt() install_newrelic_agent() config_supervisord() configure_nginx()
"requirements.txt", "SNIPPETS.md" ] EC2_REMOTE_DIR="/home/ubuntu/http2_loadimpact" if "HTTP2_LOAD_IMPACT__PROJECT_DIR" not in os.environ: print("** Could not find HTTP2_LOAD_IMPACT__PROJECT_DIR, maybe you need " " to do `source makeenv` first") else: local_project_dir = os.environ["HTTP2_LOAD_IMPACT__PROJECT_DIR"] hosts_list = [ "ubuntu@" + findout_instance_ips()["serversInstance"] ] env["hosts"] = hosts_list # TODO: Put a proper deployment mechanism here. env.key_filename = '/home/alcides/.ssh/zunzun_ec2_keypair_0.pem' current_dir = os.path.dirname(os.path.realpath(__file__)) def _rsync_subdirs(*subdirs): for subdir_name in subdirs: rsync_project( local_dir = os.path.join( local_project_dir, subdir_name), remote_dir = os.path.join(EC2_REMOTE_DIR, os.path.dirname(subdir_name))